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 128049 Details for
Bug 267658
[formatter] Javadoc comments may be still formatted as block comments
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
v00.txt (text/plain), 3.38 KB, created by
Frederic Fusier
on 2009-03-09 12:12:03 EDT
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2009-03-09 12:12:03 EDT
Size:
3.38 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.161 >diff -u -r1.161 Scribe.java >--- formatter/org/eclipse/jdt/internal/formatter/Scribe.java 27 Feb 2009 16:25:36 -0000 1.161 >+++ formatter/org/eclipse/jdt/internal/formatter/Scribe.java 9 Mar 2009 16:11:49 -0000 >@@ -1223,7 +1223,7 @@ > private void printBlockComment(boolean isJavadoc) { > int currentTokenStartPosition = this.scanner.getCurrentTokenStartPosition(); > int currentTokenEndPosition = this.scanner.getCurrentTokenEndPosition() + 1; >- boolean includesBlockComments = includesBlockComments(); >+ boolean includesBlockComments = !isJavadoc && includesBlockComments(); > > this.scanner.resetTo(currentTokenStartPosition, currentTokenEndPosition - 1); > int currentCharacter; >#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.37 >diff -u -r1.37 FormatterCommentsBugsTest.java >--- src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsBugsTest.java 27 Feb 2009 14:58:07 -0000 1.37 >+++ src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsBugsTest.java 9 Mar 2009 16:11:51 -0000 >@@ -4426,4 +4426,73 @@ > ); > } > >+/** >+ * @bug 267658: [formatter] Javadoc comments may be still formatted as block comments >+ * @test Ensure that javadoc comment are formatted as block comment with certain >+ * options configuration >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=267658" >+ */ >+public void testBug267658() throws JavaModelException { >+ this.formatterPrefs.comment_format_javadoc_comment = false; >+ this.formatterPrefs.comment_format_block_comment = true; >+ this.formatterPrefs.comment_format_line_comment = false; >+ String source = >+ "/**\n" + >+ " * Test for\n" + >+ " * bug 267658\n" + >+ " */\n" + >+ "package javadoc;\n" + >+ "\n" + >+ "/**\n" + >+ " * Test for\n" + >+ " * bug 267658\n" + >+ " */\n" + >+ "public class Test {\n" + >+ "/**\n" + >+ " * Test for\n" + >+ " * bug 267658\n" + >+ " */\n" + >+ "int field;\n" + >+ "}\n"; >+ formatSource(source, >+ "/**\n" + >+ " * Test for\n" + >+ " * bug 267658\n" + >+ " */\n" + >+ "package javadoc;\n" + >+ "\n" + >+ "/**\n" + >+ " * Test for\n" + >+ " * bug 267658\n" + >+ " */\n" + >+ "public class Test {\n" + >+ " /**\n" + >+ " * Test for\n" + >+ " * bug 267658\n" + >+ " */\n" + >+ " int field;\n" + >+ "}\n" >+ ); >+} >+public void testBug267658b() throws JavaModelException { >+ this.formatterPrefs.comment_format_javadoc_comment = false; >+ this.formatterPrefs.comment_format_block_comment = true; >+ this.formatterPrefs.comment_format_line_comment = false; >+ String source = >+ "public class Test {\n" + >+ "/**\n" + >+ " * @test bug\n" + >+ " */\n" + >+ "int field;\n" + >+ "}\n"; >+ formatSource(source, >+ "public class Test {\n" + >+ " /**\n" + >+ " * @test bug\n" + >+ " */\n" + >+ " int field;\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 267658
: 128049