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 101724 Details for
Bug 200207
[javadoc] Incorrect flagging of @see as malformed javadoc
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
[proposed patch + test case] on top v_868
v01.txt (text/plain), 5.26 KB, created by
Eric Jodet
on 2008-05-23 09:13:13 EDT
(
hide
)
Description:
[proposed patch + test case] on top v_868
Filename:
MIME Type:
Creator:
Eric Jodet
Created:
2008-05-23 09:13:13 EDT
Size:
5.26 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java,v >retrieving revision 1.42 >diff -u -r1.42 JavadocBugsTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java 7 May 2008 17:55:04 -0000 1.42 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java 23 May 2008 13:09:41 -0000 >@@ -7247,4 +7247,55 @@ > reportMissingJavadocDescription = CompilerOptions.ALL_STANDARD_TAGS; > runConformTest(units); > } >+ >+ >+ /** >+ * @bug 200207: [javadoc] Incorrect flagging of @see as malformed javadoc >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=200207" >+ */ >+ public void testBug200207a() { >+ String[] units = new String[] { >+ "pkg/X.java", >+ "package pkg;\n" + >+ "public class X\n" + >+ "{\n" + >+ " /**\n" + >+ " * @see this text\n" + >+ " * is expected\n" + >+ " * to be ok\"\n" + >+ " */\n" + >+ " public String toString() { \n" + >+ " return \"foo\";\n" + >+ " }\n" + >+ "}\n" >+ }; >+ reportInvalidJavadoc = CompilerOptions.WARNING; >+ runConformTest(units); >+ } >+ public void testBug200207b() { >+ String[] units = new String[] { >+ "pkg/X.java", >+ "package pkg;\n" + >+ "public class X\n" + >+ "{\n" + >+ " /**\n" + >+ " * @see \"unterminated\n" + >+ " * string literal\n" + >+ " * should be warned\n" + >+ " */\n" + >+ " public String toString() { \n" + >+ " return \"foo\";\n" + >+ " }\n" + >+ "}\n" >+ }; >+ reportInvalidJavadoc = CompilerOptions.WARNING; >+ runNegativeTest(units, >+ "----------\n" + >+ "1. WARNING in pkg\\X.java (at line 5)\n" + >+ " * @see \"unterminated\n" + >+ " ^^^^^^^^^^^^^\n" + >+ "Javadoc: Invalid reference\n" + >+ "----------\n" >+ ); >+ } > } >\ No newline at end of file >#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.75 >diff -u -r1.75 AbstractCommentParser.java >--- compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java 15 May 2008 17:45:49 -0000 1.75 >+++ compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java 23 May 2008 13:09:42 -0000 >@@ -1096,6 +1096,10 @@ > int previousPosition = -1; > int typeRefStartPosition = -1; > >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=200207 >+ boolean considerAsStringLiteral = false; >+ int literalStartPosition = -1; >+ > // Get reference tokens > nextToken : while (this.index < this.scanner.eofPosition) { > previousPosition = this.index; >@@ -1151,11 +1155,33 @@ > } > char[] currentError = this.scanner.getCurrentIdentifierSource(); > if (currentError.length>0 && currentError[0] == '"') { >- if (this.reportProblems) this.sourceParser.problemReporter().javadocInvalidReference(this.scanner.getCurrentTokenStartPosition(), getTokenEndPosition()); >- return false; >- } >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=200207 >+ // handle double quoted strings than span on several lines >+ if (considerAsStringLiteral) { >+ // closing '"' found >+ considerAsStringLiteral = false; >+ literalStartPosition = -1; >+ break; >+ } else { >+ if (this.scanner.currentCharacter == '\r') { >+ // unterminated string literal: keep on parsing the reference until closing '"' found >+ considerAsStringLiteral = true; >+ // store position for error handling >+ literalStartPosition = this.scanner.getCurrentTokenStartPosition(); >+ break; >+ } else { >+ if (this.reportProblems) this.sourceParser.problemReporter().javadocInvalidReference(this.scanner.getCurrentTokenStartPosition(), getTokenEndPosition()); >+ return false; >+ } >+ } >+ } > break nextToken; > case TerminalTokens.TokenNameIdentifier : >+ // discard identifiers when inside an unterminated string literal >+ if (considerAsStringLiteral) { >+ consumeToken(); >+ break; >+ } > if (typeRef == null) { > typeRefStartPosition = this.scanner.getCurrentTokenStartPosition(); > typeRef = parseQualifiedName(true); >@@ -1178,7 +1204,12 @@ > return true; > } > if (this.reportProblems) { >- this.sourceParser.problemReporter().javadocMissingReference(this.tagSourceStart, this.tagSourceEnd, this.sourceParser.modifiers); >+ if (considerAsStringLiteral) { >+ // unterminated string literal >+ this.sourceParser.problemReporter().javadocInvalidReference(literalStartPosition, getTokenEndPosition()); >+ } else { >+ this.sourceParser.problemReporter().javadocMissingReference(this.tagSourceStart, this.tagSourceEnd, this.sourceParser.modifiers); >+ } > } > return false; > }
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 200207
:
101724
|
129193
|
130273