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 186374 Details for
Bug 282988
[formatter] Option to align single-line comments in a column
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
patch that addresses comment 2
patch.txt (text/plain), 3.06 KB, created by
Ray V.
on 2011-01-10 06:03:35 EST
(
hide
)
Description:
patch that addresses comment 2
Filename:
MIME Type:
Creator:
Ray V.
Created:
2011-01-10 06:03:35 EST
Size:
3.06 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.222 >diff -u -r1.222 Scribe.java >--- formatter/org/eclipse/jdt/internal/formatter/Scribe.java 26 Nov 2010 16:42:56 -0000 1.222 >+++ formatter/org/eclipse/jdt/internal/formatter/Scribe.java 10 Jan 2011 10:54:42 -0000 >@@ -2457,7 +2457,9 @@ > // delete consumed white spaces > hasWhitespaces = true; > currentTokenStartPosition = this.scanner.currentPosition; >- addDeleteEdit(tokenStartPosition, whitespacesEndPosition); >+ if (this.formatter.preferences.comment_format_line_comment) { >+ addDeleteEdit(tokenStartPosition, whitespacesEndPosition); >+ } > } else { > if (lines == 0) { > hasWhitespaces = true; >@@ -2731,7 +2733,7 @@ > this.lastLineComment.indentation = commentIndentationLevel; > > // Add pending space if necessary >- if (this.pendingSpace) { >+ if (this.formatter.preferences.comment_format_line_comment && this.pendingSpace) { > addInsertEdit(currentTokenStartPosition, " "); //$NON-NLS-1$ > } > this.needSpace = false; >#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 10 Jan 2011 10:54:45 -0000 >@@ -7628,4 +7628,36 @@ > "}\n" > ); > } >+ >+/** >+ * @bug 282988: [formatter] Option to align single-line comments in a column >+ * @test Ensure that with line comment formatting turned off comment alignment doesn't change >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=282988" >+ */ >+public void testBug282988() throws Exception { >+ this.formatterPrefs.comment_format_line_comment = false; >+ String source = >+ "package test;\n" + >+ "\n" + >+ "public class FormatterError {\n" + >+ " public void storeSomething(java.nio.ByteBuffer buffer) throws Exception {\n" + >+ " buffer.clear();\n" + >+ " buffer.putLong(0); // backlink to previous version of this object\n" + >+ " buffer.putInt(1); // version identifier\n" + >+ " buffer.flip(); // prepare to write\n" + >+ " }\n" + >+ "}\n"; >+ formatSource(source, >+ "package test;\n" + >+ "\n" + >+ "public class FormatterError {\n" + >+ " public void storeSomething(java.nio.ByteBuffer buffer) throws Exception {\n" + >+ " buffer.clear();\n" + >+ " buffer.putLong(0); // backlink to previous version of this object\n" + >+ " buffer.putInt(1); // version identifier\n" + >+ " buffer.flip(); // prepare to write\n" + >+ " }\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 282988
:
186374
|
186960
|
187048
|
187113
|
187195