Community
Participate
Working Groups
Build Identifier: I20110523-2200 when hovering mouse over the method, its displayed javadoc is empty, but only when using "{@link" and "<a href" inside the "@link" Eclipse SDK Version: 4.1.0 Build id: I20110523-2200 Reproducible: Always Steps to Reproduce: package org.some; public class DatabaseConfig { /** * See the {@link <a href="{@docRoot}/../GettingStartedGuide/DB.html#dwdatabase">Getting * Started Guide, Database chapter</a>} for a full description * of deferred-write databases. * */ public void boo() { } } ======= hover over boo() method, javadoc is empty to fix do either 1 or 2 1. remove "{@link" and "}" 2. remove everything between "{@link" and "}" in either case, javadoc now shows
Created attachment 196500 [details] just in case paste failed
This is not valid Javadoc, see http://download.oracle.com/javase/1.5.0/docs/tooldocs/windows/javadoc.html#{@link} for details. Having said that, we should not show nothing in that case.
This is a bug in the AST parser: The Javadoc node has no children in this case. Works fine if I add an error, e.g. an "x" before "<a href", or if I use another tag like "<ax href=...".
Unfortunately, the Javadoc "spec" is not entirely clear here. It starts with title: {@link package.class#member label} ... but later says: This tag is very similar to @see – both require the same references [..] While the "string" and <a href="URL#value">label</a> forms are completely unnecessary in @link, the Javadoc tool silently accepts and processes all 3 forms of @see references also in @link inline tags. As long as the Javadoc tool doesn't issue a warning/error here, the best fix in JDT Core is to also accept and properly process all 3 forms. Example: /** * Link to {@link #foo()},<br> * link to {@link "Hello World"},<br> * and {@link <a href="../package-summary.html">package documentation</a>} * * @see #foo() * @see "Hello World" * @see <a href="../package-summary.html">package documentation</a> */ void foo();
org.eclipse.jdt.internal.compiler.parser.AbstractCommentParser#commentParse() catches Exception and swallows this one: java.lang.StringIndexOutOfBoundsException: String index out of range: -16 at java.lang.String.<init>(String.java:207) at org.eclipse.jdt.core.dom.DocCommentParser.pushText(DocCommentParser.java:663) at org.eclipse.jdt.internal.compiler.parser.AbstractCommentParser.verifyEndLine(AbstractCommentParser.java:1656) at org.eclipse.jdt.internal.compiler.parser.AbstractCommentParser.parseReference(AbstractCommentParser.java:1172) at org.eclipse.jdt.core.dom.DocCommentParser.parseTag(DocCommentParser.java:483) at org.eclipse.jdt.internal.compiler.parser.AbstractCommentParser.commentParse(AbstractCommentParser.java:241) at org.eclipse.jdt.core.dom.DocCommentParser.parse(DocCommentParser.java:74) at org.eclipse.jdt.core.dom.DocCommentParser.parse(DocCommentParser.java:60) at org.eclipse.jdt.core.dom.ASTConverter.createComment(ASTConverter.java:3382) at org.eclipse.jdt.core.dom.ASTConverter.buildCommentsTable(ASTConverter.java:348) at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1193) at org.eclipse.jdt.core.dom.CompilationUnitResolver.convert(CompilationUnitResolver.java:291) at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:1207) at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:807) Fixed with http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=2778a965ba1e30dc1a115e4e03837a51f2d404df
Verified for M6 build eclipse-SDK-I20130310-2000