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 158477 Details for
Bug 302123
[formatter] AssertionFailedException occurs while formatting a source containing the specific javadoc comment /** ***/
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
v02.txt (text/plain), 4.62 KB, created by
Frederic Fusier
on 2010-02-08 11:10:20 EST
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2010-02-08 11:10:20 EST
Size:
4.62 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java,v >retrieving revision 1.92 >diff -u -r1.92 AbstractCommentParser.java >--- compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java 14 Dec 2009 19:54:53 -0000 1.92 >+++ compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java 8 Feb 2010 16:09:55 -0000 >@@ -147,6 +147,7 @@ > boolean verifText = (this.kind & TEXT_VERIF) != 0; > boolean isDomParser = (this.kind & DOM_PARSER) != 0; > boolean isFormatterParser = (this.kind & FORMATTER_COMMENT_PARSER) != 0; >+ int lastStarPosition = -1; > > // Init scanner position > this.linePtr = getLineNumber(this.firstTagPosition); >@@ -325,6 +326,7 @@ > break; > case '*' : > // Store the star position as text start while formatting >+ lastStarPosition = previousPosition; > if (previousChar != '*') { > this.starPosition = previousPosition; > if (isDomParser || isFormatterParser) { >@@ -401,7 +403,7 @@ > } > refreshInlineTagPosition(textEndPosition); > setInlineTagStarted(false); >- } else if (this.lineStarted && this.textStart != -1 && this.textStart <= textEndPosition) { >+ } else if (this.lineStarted && this.textStart != -1 && this.textStart <= textEndPosition && (this.textStart < this.starPosition || this.starPosition == lastStarPosition)) { > pushText(this.textStart, textEndPosition); > } > updateDocComment(); >#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.17 >diff -u -r1.17 FormatterBugsTests.java >--- src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java 4 Jan 2010 19:48:24 -0000 1.17 >+++ src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java 8 Feb 2010 16:09:57 -0000 >@@ -3928,4 +3928,94 @@ > "}\n"; > formatSource(source); > } >+ >+/** >+ * @bug 302123: [formatter] AssertionFailedException occurs while formatting a source containing the specific javadoc comment... >+ * @test Verify that no exception occurs while formatting source including the specific comment >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=302123" >+ */ >+public void testBug302123() { >+ String source = >+ "package test;\n" + >+ "public class Test {\n" + >+ " public static void main(String[] args) {\n" + >+ " String s=\"X\"+/** ***/\"Y\";\n" + >+ " }\n" + >+ "\n" + >+ "}\n"; >+ formatSource(source, >+ "package test;\n" + >+ "\n" + >+ "public class Test {\n" + >+ " public static void main(String[] args) {\n" + >+ " String s = \"X\" + /** ***/\n" + >+ " \"Y\";\n" + >+ " }\n" + >+ "\n" + >+ "}\n" >+ ); >+} >+public void testBug302123b() { >+ String source = >+ "package test;\n" + >+ "public class Test {\n" + >+ " public static void main(String[] args) {\n" + >+ " String s=\"X\"+/** XXX ***/\"Y\";\n" + >+ " }\n" + >+ "\n" + >+ "}\n"; >+ formatSource(source, >+ "package test;\n" + >+ "\n" + >+ "public class Test {\n" + >+ " public static void main(String[] args) {\n" + >+ " String s = \"X\" + /** XXX ***/\n" + >+ " \"Y\";\n" + >+ " }\n" + >+ "\n" + >+ "}\n" >+ ); >+} >+public void testBug302123c() { >+ String source = >+ "package test;\n" + >+ "public class Test {\n" + >+ " public static void main(String[] args) {\n" + >+ " String s=\"X\"+/** ** XXX ** ***/\"Y\";\n" + >+ " }\n" + >+ "\n" + >+ "}\n"; >+ formatSource(source, >+ "package test;\n" + >+ "\n" + >+ "public class Test {\n" + >+ " public static void main(String[] args) {\n" + >+ " String s = \"X\" + /** ** XXX ** ***/\n" + >+ " \"Y\";\n" + >+ " }\n" + >+ "\n" + >+ "}\n" >+ ); >+} >+public void testBug302123d() { >+ String source = >+ "package test;\n" + >+ "public class Test {\n" + >+ " public static void main(String[] args) {\n" + >+ " String s=\"X\"+/**AAA *** BBB *** CCC***/\"Y\";\n" + >+ " }\n" + >+ "\n" + >+ "}\n"; >+ formatSource(source, >+ "package test;\n" + >+ "\n" + >+ "public class Test {\n" + >+ " public static void main(String[] args) {\n" + >+ " String s = \"X\" + /** AAA *** BBB *** CCC ***/\n" + >+ " \"Y\";\n" + >+ " }\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 302123
: 158477