Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 154769 Details for
Bug 297546
[formatter] Formatter removes blank after @see if reference is wrapped
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
v00.txt (text/plain), 3.78 KB, created by
Frederic Fusier
on 2009-12-18 08:40:11 EST
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2009-12-18 08:40:11 EST
Size:
3.78 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: formatter/org/eclipse/jdt/internal/formatter/Scribe.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/Scribe.java,v >retrieving revision 1.184 >diff -u -r1.184 Scribe.java >--- formatter/org/eclipse/jdt/internal/formatter/Scribe.java 8 Dec 2009 22:05:12 -0000 1.184 >+++ formatter/org/eclipse/jdt/internal/formatter/Scribe.java 17 Dec 2009 16:49:09 -0000 >@@ -1798,15 +1798,16 @@ > // Append next token inserting a new line if max line is reached > if (lineHasTokens && !firstWord && lastColumn > maxColumn) { > String tokensString = tokensBuffer.toString().trim(); >+ int tokensStringLength = tokensString.length(); > // not enough space on the line > if (hasTextOnFirstLine == 1) { > printBlockCommentHeaderLine(buffer); > } >- if ((this.indentationLevel+tokensString.length()+tokenLength) > maxColumn) { >+ if ((this.indentationLevel+tokensStringLength+tokenLength) > maxColumn) { > // there won't be enough room even if we break the line before the buffered tokens > // So add the buffered tokens now >- buffer.append(tokensString); >- this.column += tokensString.length(); >+ buffer.append(tokensBuffer); >+ this.column += tokensBuffer.length(); > tokensBuffer.setLength(0); > bufferHasNewLine = false; > bufferHasTokens = true; >@@ -1820,7 +1821,7 @@ > } > if (tokensBuffer.length() > 0) { > buffer.append(tokensString); >- this.column += tokensString.length(); >+ this.column += tokensStringLength; > tokensBuffer.setLength(0); > } > buffer.append(this.scanner.source, tokenStart, tokenLength); >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java,v >retrieving revision 1.13 >diff -u -r1.13 FormatterBugsTests.java >--- src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java 17 Dec 2009 16:13:58 -0000 1.13 >+++ src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java 17 Dec 2009 16:49:11 -0000 >@@ -3531,4 +3531,49 @@ > "}\n" > ); > } >+ >+/** >+ * @bug 297546: [formatter] Formatter removes blank after @see if reference is wrapped >+ * @test Verify that space after the @see tag is not removed while formatting >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=297546" >+ */ >+public void testBug297546() { >+ String source = >+ "package org.eclipse.jdt.core;\n" + >+ "public class TestClass implements TestInterface {\n" + >+ "\n" + >+ " /* (non-Javadoc)\n" + >+ " * @see org.eclipse.jdt.core.TestInterface#testMethod(org.eclipse.jdt.core.TestInterface)\n" + >+ " */\n" + >+ " public void testMethod(TestInterface aLongNameForAParam) {\n" + >+ " // do nothing\n" + >+ " }\n" + >+ "\n" + >+ " \n" + >+ "}\n" + >+ "interface TestInterface {\n" + >+ " void testMethod(TestInterface aLongNameForAParam);\n" + >+ "}\n"; >+ formatSource(source, >+ "package org.eclipse.jdt.core;\n" + >+ "\n" + >+ "public class TestClass implements TestInterface {\n" + >+ "\n" + >+ " /*\n" + >+ " * (non-Javadoc)\n" + >+ " * \n" + >+ " * @see org.eclipse.jdt.core.TestInterface#testMethod(org.eclipse.jdt.core.\n" + >+ " * TestInterface)\n" + >+ " */\n" + >+ " public void testMethod(TestInterface aLongNameForAParam) {\n" + >+ " // do nothing\n" + >+ " }\n" + >+ "\n" + >+ "}\n" + >+ "\n" + >+ "interface TestInterface {\n" + >+ " void testMethod(TestInterface aLongNameForAParam);\n" + >+ "}\n" >+ ); >+} > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 297546
:
154279
|
154675
| 154769