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 106929 Details for
Bug 237937
[javadoc] Wrong "Javadoc: Malformed link reference" if href label contains //
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
v01.txt (text/plain), 9.52 KB, created by
Frederic Fusier
on 2008-07-09 05:27:40 EDT
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2008-07-09 05:27:40 EDT
Size:
9.52 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.47 >diff -u -r1.47 JavadocBugsTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java 8 Jul 2008 15:12:56 -0000 1.47 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java 8 Jul 2008 16:29:50 -0000 >@@ -7415,4 +7415,22 @@ > JavacTestOptions.Excuse.EclipseWarningConfiguredAsError > ); > } >+ >+/** >+ * @bug 237937: [javadoc] Wrong "Javadoc: Malformed link reference" if href label contains // >+ * @test Ensure that no warning is raised when href label contains '//' >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=237937" >+ */ >+public void testBug237937() { >+ runConformTest( >+ new String[] { >+ "src/Link.java", >+ "/**\n" + >+ " * @see <a href=\"http://www.eclipse.org/\">http://www.eclipse.org</a>\n" + >+ " * @see <a href=\"http://www.eclipse.org/\">//</a>\n" + >+ " */\n" + >+ "public class Link {}\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.78 >diff -u -r1.78 AbstractCommentParser.java >--- compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java 27 Jun 2008 16:03:54 -0000 1.78 >+++ compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java 8 Jul 2008 16:29:51 -0000 >@@ -623,83 +623,90 @@ > * Parse an URL link reference in @see tag > */ > protected boolean parseHref() throws InvalidInputException { >- int start = this.scanner.getCurrentTokenStartPosition(); >- char currentChar = readChar(); >- if (currentChar == 'a' || currentChar == 'A') { >- this.scanner.currentPosition = this.index; >- if (readToken() == TerminalTokens.TokenNameIdentifier) { >- consumeToken(); >- try { >- if (CharOperation.equals(this.scanner.getCurrentIdentifierSource(), HREF_TAG, false) && >- readToken() == TerminalTokens.TokenNameEQUAL) { >- consumeToken(); >- if (readToken() == TerminalTokens.TokenNameStringLiteral) { >+ boolean skipComments = this.scanner.skipComments; >+ this.scanner.skipComments = true; >+ try { >+ int start = this.scanner.getCurrentTokenStartPosition(); >+ char currentChar = readChar(); >+ if (currentChar == 'a' || currentChar == 'A') { >+ this.scanner.currentPosition = this.index; >+ if (readToken() == TerminalTokens.TokenNameIdentifier) { >+ consumeToken(); >+ try { >+ if (CharOperation.equals(this.scanner.getCurrentIdentifierSource(), HREF_TAG, false) && >+ readToken() == TerminalTokens.TokenNameEQUAL) { > consumeToken(); >- while (this.index < this.javadocEnd) { // main loop to search for the </a> pattern >- // Skip all characters after string literal until closing '>' (see bug 68726) >- while (readToken() != TerminalTokens.TokenNameGREATER) { >- if (this.scanner.currentPosition >= this.scanner.eofPosition || this.scanner.currentCharacter == '@' || >- (this.inlineTagStarted && this.scanner.currentCharacter == '}')) { >- // Reset position: we want to rescan last token >- this.index = this.tokenPreviousPosition; >- this.scanner.currentPosition = this.tokenPreviousPosition; >- this.currentTokenType = -1; >- // Signal syntax error >- if (this.tagValue != TAG_VALUE_VALUE) { // do not report error for @value tag, this will be done after... >- if (this.reportProblems) this.sourceParser.problemReporter().javadocInvalidSeeHref(start, this.lineEnd); >+ if (readToken() == TerminalTokens.TokenNameStringLiteral) { >+ consumeToken(); >+ while (this.index < this.javadocEnd) { // main loop to search for the </a> pattern >+ // Skip all characters after string literal until closing '>' (see bug 68726) >+ while (readToken() != TerminalTokens.TokenNameGREATER) { >+ if (this.scanner.currentPosition >= this.scanner.eofPosition || this.scanner.currentCharacter == '@' || >+ (this.inlineTagStarted && this.scanner.currentCharacter == '}')) { >+ // Reset position: we want to rescan last token >+ this.index = this.tokenPreviousPosition; >+ this.scanner.currentPosition = this.tokenPreviousPosition; >+ this.currentTokenType = -1; >+ // Signal syntax error >+ if (this.tagValue != TAG_VALUE_VALUE) { // do not report error for @value tag, this will be done after... >+ if (this.reportProblems) this.sourceParser.problemReporter().javadocInvalidSeeHref(start, this.lineEnd); >+ } >+ return false; > } >- return false; >+ this.currentTokenType = -1; // consume token without updating line end > } >- this.currentTokenType = -1; // consume token without updating line end >- } >- consumeToken(); // update line end as new lines are allowed in URL description >- while (readToken() != TerminalTokens.TokenNameLESS) { >- if (this.scanner.currentPosition >= this.scanner.eofPosition || this.scanner.currentCharacter == '@' || >- (this.inlineTagStarted && this.scanner.currentCharacter == '}')) { >- // Reset position: we want to rescan last token >- this.index = this.tokenPreviousPosition; >- this.scanner.currentPosition = this.tokenPreviousPosition; >- this.currentTokenType = -1; >- // Signal syntax error >- if (this.tagValue != TAG_VALUE_VALUE) { // do not report error for @value tag, this will be done after... >- if (this.reportProblems) this.sourceParser.problemReporter().javadocInvalidSeeHref(start, this.lineEnd); >+ consumeToken(); // update line end as new lines are allowed in URL description >+ while (readToken() != TerminalTokens.TokenNameLESS) { >+ if (this.scanner.currentPosition >= this.scanner.eofPosition || this.scanner.currentCharacter == '@' || >+ (this.inlineTagStarted && this.scanner.currentCharacter == '}')) { >+ // Reset position: we want to rescan last token >+ this.index = this.tokenPreviousPosition; >+ this.scanner.currentPosition = this.tokenPreviousPosition; >+ this.currentTokenType = -1; >+ // Signal syntax error >+ if (this.tagValue != TAG_VALUE_VALUE) { // do not report error for @value tag, this will be done after... >+ if (this.reportProblems) this.sourceParser.problemReporter().javadocInvalidSeeHref(start, this.lineEnd); >+ } >+ return false; > } >- return false; >+ consumeToken(); > } > consumeToken(); >- } >- consumeToken(); >- start = this.scanner.getCurrentTokenStartPosition(); >- currentChar = readChar(); >- // search for the </a> pattern and store last char read >- if (currentChar == '/') { >+ start = this.scanner.getCurrentTokenStartPosition(); > currentChar = readChar(); >- if (currentChar == 'a' || currentChar =='A') { >+ // search for the </a> pattern and store last char read >+ if (currentChar == '/') { > currentChar = readChar(); >- if (currentChar == '>') { >- return true; // valid href >+ if (currentChar == 'a' || currentChar =='A') { >+ currentChar = readChar(); >+ if (currentChar == '>') { >+ return true; // valid href >+ } > } > } >- } >- // search for invalid char in tags >- if (currentChar == '\r' || currentChar == '\n' || currentChar == '\t' || currentChar == ' ') { >- break; >+ // search for invalid char in tags >+ if (currentChar == '\r' || currentChar == '\n' || currentChar == '\t' || currentChar == ' ') { >+ break; >+ } > } > } > } >+ } catch (InvalidInputException ex) { >+ // Do nothing as we want to keep positions for error message > } >- } catch (InvalidInputException ex) { >- // Do nothing as we want to keep positions for error message > } > } >+ // Reset position: we want to rescan last token >+ this.index = this.tokenPreviousPosition; >+ this.scanner.currentPosition = this.tokenPreviousPosition; >+ this.currentTokenType = -1; >+ // Signal syntax error >+ if (this.tagValue != TAG_VALUE_VALUE) { // do not report error for @value tag, this will be done after... >+ if (this.reportProblems) this.sourceParser.problemReporter().javadocInvalidSeeHref(start, this.lineEnd); >+ } > } >- // Reset position: we want to rescan last token >- this.index = this.tokenPreviousPosition; >- this.scanner.currentPosition = this.tokenPreviousPosition; >- this.currentTokenType = -1; >- // Signal syntax error >- if (this.tagValue != TAG_VALUE_VALUE) { // do not report error for @value tag, this will be done after... >- if (this.reportProblems) this.sourceParser.problemReporter().javadocInvalidSeeHref(start, this.lineEnd); >+ finally { >+ this.scanner.skipComments = skipComments; > } > 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 237937
: 106929