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 185723 Details for
Bug 332877
[formatter] line comment wrongly put on a new line
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
v00.txt (text/plain), 2.09 KB, created by
Frederic Fusier
on 2010-12-22 11:37:27 EST
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2010-12-22 11:37:27 EST
Size:
2.09 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: formatter/org/eclipse/jdt/internal/formatter/CodeFormatterVisitor.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/CodeFormatterVisitor.java,v >retrieving revision 1.237 >diff -u -r1.237 CodeFormatterVisitor.java >--- formatter/org/eclipse/jdt/internal/formatter/CodeFormatterVisitor.java 9 Nov 2010 14:24:24 -0000 1.237 >+++ formatter/org/eclipse/jdt/internal/formatter/CodeFormatterVisitor.java 22 Dec 2010 12:56:37 -0000 >@@ -1156,6 +1156,7 @@ > this.scribe.printNewLine(); > } > } else if (hasConstants) { >+ this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT); > // only had a new line if there is at least one enum constant > this.scribe.printNewLine(); > } >#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.39 >diff -u -r1.39 FormatterBugsTests.java >--- src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java 26 Nov 2010 16:42:57 -0000 1.39 >+++ src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java 22 Dec 2010 12:56:40 -0000 >@@ -7628,4 +7628,23 @@ > "}\n" > ); > } >+ >+/** >+ * @bug 332877: [formatter] line comment wrongly put on a new line >+ * @test Ensure that the comment on last enum constant is not wrongly put on a new line >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=332877" >+ */ >+public void testBug332877() throws Exception { >+ String source = >+ "public enum Environment {\n" + >+ " PROD, // Production level environments\n" + >+ " STAGING // Staging\n" + >+ "}\n"; >+ formatSource(source, >+ "public enum Environment {\n" + >+ " PROD, // Production level environments\n" + >+ " STAGING // Staging\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 332877
:
185570
| 185723