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 160758 Details for
Bug 251133
[formatter] Automatic formatting single line comments is incoherent among tools
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Patch to fix the option dependency inconsistency
v04.txt (text/plain), 6.17 KB, created by
Frederic Fusier
on 2010-03-03 05:30:46 EST
(
hide
)
Description:
Patch to fix the option dependency inconsistency
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2010-03-03 05:30:46 EST
Size:
6.17 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.196 >diff -u -r1.196 Scribe.java >--- formatter/org/eclipse/jdt/internal/formatter/Scribe.java 2 Mar 2010 18:28:48 -0000 1.196 >+++ formatter/org/eclipse/jdt/internal/formatter/Scribe.java 3 Mar 2010 10:23:18 -0000 >@@ -2470,7 +2470,7 @@ > commentIndentationLevel = this.column - 1; > } else { > if (onFirstColumn && >- (!this.formatter.preferences.comment_format_line_comment_starting_on_first_column || >+ ((includesLineComments && !this.formatter.preferences.comment_format_line_comment_starting_on_first_column) || > this.formatter.preferences.never_indent_line_comments_on_first_column) > ) { > commentIndentationLevel = this.column - 1; >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsBugsTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsBugsTest.java,v >retrieving revision 1.56 >diff -u -r1.56 FormatterCommentsBugsTest.java >--- src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsBugsTest.java 1 Mar 2010 17:09:26 -0000 1.56 >+++ src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsBugsTest.java 3 Mar 2010 10:23:29 -0000 >@@ -3625,7 +3625,7 @@ > * @test Test the new formatter capability to completely ignore line comments starting at first column > * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=251133" > */ >-public void testBug251133_Line01() throws JavaModelException { >+public void testBug251133() throws JavaModelException { > String source = > "public class X01 {\n" + > "// int a = 1;\n" + >@@ -3638,36 +3638,103 @@ > "}" > ); > } >-public void testBug251133_Line02() throws JavaModelException { >+public void testBug251133a() throws JavaModelException { >+ this.formatterPrefs.comment_format_line_comment = true; >+ this.formatterPrefs.comment_format_line_comment_starting_on_first_column = true; >+ this.formatterPrefs.never_indent_line_comments_on_first_column = false; >+ String source = >+ "public class X {\n" + >+ "// first column comment \n" + >+ "}"; >+ formatSource(source, >+ "public class X {\n" + >+ " // first column comment\n" + >+ "}" >+ ); >+} >+public void testBug251133b() throws JavaModelException { >+ this.formatterPrefs.comment_format_line_comment = true; >+ this.formatterPrefs.comment_format_line_comment_starting_on_first_column = true; > this.formatterPrefs.never_indent_line_comments_on_first_column = true; > String source = >- "public class X01 {\n" + >- "// int a = 1;\n" + >- "// int b = 2;\n" + >+ "public class X {\n" + >+ "// first column comment \n" + > "}"; > formatSource(source, >- "public class X01 {\n" + >- "// int a = 1;\n" + >- "// int b = 2;\n" + >+ "public class X {\n" + >+ "// first column comment\n" + > "}" > ); > } >-public void testBug251133_Line03() throws JavaModelException { >+public void testBug251133c() throws JavaModelException { >+ this.formatterPrefs.comment_format_line_comment = true; >+ this.formatterPrefs.comment_format_line_comment_starting_on_first_column = false; >+ this.formatterPrefs.never_indent_line_comments_on_first_column = false; >+ String source = >+ "public class X {\n" + >+ "// first column comment \n" + >+ "}"; >+ formatSource(source); >+} >+public void testBug251133d() throws JavaModelException { >+ this.formatterPrefs.comment_format_line_comment = true; > this.formatterPrefs.comment_format_line_comment_starting_on_first_column = false; >+ this.formatterPrefs.never_indent_line_comments_on_first_column = true; > String source = >- "public class X01 {\n" + >- "// int a = 1;\n" + >- "// int b = 2;\n" + >+ "public class X {\n" + >+ "// first column comment \n" + > "}"; > formatSource(source); > } >-public void testBug251133_Line04() throws JavaModelException { >+public void testBug251133e() throws JavaModelException { >+ this.formatterPrefs.comment_format_line_comment = false; >+ this.formatterPrefs.comment_format_line_comment_starting_on_first_column = true; > this.formatterPrefs.never_indent_line_comments_on_first_column = false; >+ String source = >+ "public class X {\n" + >+ "// first column comment \n" + >+ "}"; >+ formatSource(source, >+ "public class X {\n" + >+ " // first column comment \n" + >+ "}" >+ ); >+} >+public void testBug251133f() throws JavaModelException { >+ this.formatterPrefs.comment_format_line_comment = false; >+ this.formatterPrefs.comment_format_line_comment_starting_on_first_column = true; >+ this.formatterPrefs.never_indent_line_comments_on_first_column = true; >+ String source = >+ "public class X {\n" + >+ "// first column comment \n" + >+ "}"; >+ formatSource(source, >+ "public class X {\n" + >+ "// first column comment \n" + >+ "}" >+ ); >+} >+public void testBug251133g() throws JavaModelException { >+ this.formatterPrefs.comment_format_line_comment = false; > this.formatterPrefs.comment_format_line_comment_starting_on_first_column = false; >+ this.formatterPrefs.never_indent_line_comments_on_first_column = false; > String source = >- "public class X01 {\n" + >- "// int a = 1;\n" + >- "// int b = 2;\n" + >+ "public class X {\n" + >+ "// first column comment \n" + >+ "}"; >+ formatSource(source, >+ "public class X {\n" + >+ " // first column comment \n" + >+ "}" >+ ); >+} >+public void testBug251133h() throws JavaModelException { >+ this.formatterPrefs.comment_format_line_comment = false; >+ this.formatterPrefs.comment_format_line_comment_starting_on_first_column = false; >+ this.formatterPrefs.never_indent_line_comments_on_first_column = true; >+ String source = >+ "public class X {\n" + >+ "// first column comment \n" + > "}"; > formatSource(source); > }
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 Raw
Actions:
View
Attachments on
bug 251133
:
160324
|
160495
|
160496
| 160758