### 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.50 diff -u -r1.50 JavadocBugsTest.java --- src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java 9 Sep 2008 19:03:12 -0000 1.50 +++ src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java 10 Sep 2008 08:42:42 -0000 @@ -7326,10 +7326,10 @@ String[] units = new String[] { "X.java", "/**\n" + - " * @author\n" + " * {@code}\n" + - " * @deprecated\n" + " * {@literal}\n" + + " * @author\n" + + " * @deprecated\n" + " * @since\n" + " * @version\n" + " * @generated\n" + // should not get a warning for missing description on non-standard tag @@ -7359,25 +7359,25 @@ runConformTest(true, units, "----------\n" + "1. WARNING in X.java (at line 2)\n" + - " * @author\n" + - " ^^^^^^\n" + - "Javadoc: Description expected after @author\n" + - "----------\n" + - "2. WARNING in X.java (at line 3)\n" + " * {@code}\n" + " ^^^^\n" + "Javadoc: Description expected after @code\n" + "----------\n" + + "2. WARNING in X.java (at line 3)\n" + + " * {@literal}\n" + + " ^^^^^^^\n" + + "Javadoc: Description expected after @literal\n" + + "----------\n" + "3. WARNING in X.java (at line 4)\n" + + " * @author\n" + + " ^^^^^^\n" + + "Javadoc: Description expected after @author\n" + + "----------\n" + + "4. WARNING in X.java (at line 5)\n" + " * @deprecated\n" + " ^^^^^^^^^^\n" + "Javadoc: Description expected after @deprecated\n" + "----------\n" + - "4. WARNING in X.java (at line 5)\n" + - " * {@literal}\n" + - " ^^^^^^^\n" + - "Javadoc: Description expected after @literal\n" + - "----------\n" + "5. WARNING in X.java (at line 6)\n" + " * @since\n" + " ^^^^^\n" + @@ -7566,6 +7566,35 @@ } ); } +public void testBug246712b() { + this.reportMissingJavadocDescription = CompilerOptions.ALL_STANDARD_TAGS; + runConformTest( + new String[] { + "src/X.java", + "/**\n" + + " * @author {@link String}\n" + + " * @since {@link String}\n" + + " * @version {@link String}\n" + + " * @deprecated {@link String}\n" + + "*/\n" + + "public class X {\n" + + " /**\n" + + " * @return {@link String}\n" + + " * @since {@link String}\n" + + " * @throws Exception {@link String}\n" + + " * @exception Exception {@link String}\n" + + " * @serial {@link String}\n" + + " * @serialData {@link String}\n" + + " * @serialField {@link String}\n" + + " * @deprecated {@link String}\n" + + " */\n" + + " public String foo(String aParam) throws Exception {\n" + + " return new String();\n" + + " }\n" + + "}" + } + ); +} // duplicate public void testBug246715() { this.reportMissingJavadocDescription = CompilerOptions.ALL_STANDARD_TAGS; #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java,v retrieving revision 1.73 diff -u -r1.73 JavadocParser.java --- compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java 9 Sep 2008 19:03:16 -0000 1.73 +++ compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java 10 Sep 2008 08:42:43 -0000 @@ -407,11 +407,13 @@ protected boolean parseTag(int previousPosition) throws InvalidInputException { - // Signal tag missing description if necessary + // Complain when tag is missing a description + // Note that if the parse of an inline tag has already started, consider it + // as the expected description, hence do not report any warning switch (this.tagWaitingForDescription) { case TAG_PARAM_VALUE: case TAG_THROWS_VALUE: - if (!this.inlineTagStarted) { // if an inline tag is started, then consider as the expected description... + if (!this.inlineTagStarted) { int start = (int) (this.identifierPositionStack[0] >>> 32); int end = (int) this.identifierPositionStack[this.identifierPtr]; this.sourceParser.problemReporter().javadocMissingTagDescriptionAfterReference(start, end, this.sourceParser.modifiers); @@ -420,7 +422,9 @@ case NO_TAG_VALUE: break; default: - this.sourceParser.problemReporter().javadocMissingTagDescription(TAG_NAMES[this.tagWaitingForDescription], this.tagSourceStart, this.tagSourceEnd, this.sourceParser.modifiers); + if (!this.inlineTagStarted) { + this.sourceParser.problemReporter().javadocMissingTagDescription(TAG_NAMES[this.tagWaitingForDescription], this.tagSourceStart, this.tagSourceEnd, this.sourceParser.modifiers); + } break; } this.tagWaitingForDescription = NO_TAG_VALUE; @@ -835,11 +839,13 @@ */ protected void updateDocComment() { - // Signal tag missing description if necessary + // Complain when tag is missing a description + // Note that if the parse of an inline tag has already started, consider it + // as the expected description, hence do not report any warning switch (this.tagWaitingForDescription) { case TAG_PARAM_VALUE: case TAG_THROWS_VALUE: - if (!this.inlineTagStarted) { // if an inline tag is started, then consider as the expected description... + if (!this.inlineTagStarted) { int start = (int) (this.identifierPositionStack[0] >>> 32); int end = (int) this.identifierPositionStack[this.identifierPtr]; this.sourceParser.problemReporter().javadocMissingTagDescriptionAfterReference(start, end, this.sourceParser.modifiers); @@ -848,7 +854,9 @@ case NO_TAG_VALUE: break; default: - this.sourceParser.problemReporter().javadocMissingTagDescription(TAG_NAMES[this.tagWaitingForDescription], this.tagSourceStart, this.tagSourceEnd, this.sourceParser.modifiers); + if (!this.inlineTagStarted) { + this.sourceParser.problemReporter().javadocMissingTagDescription(TAG_NAMES[this.tagWaitingForDescription], this.tagSourceStart, this.tagSourceEnd, this.sourceParser.modifiers); + } break; } this.tagWaitingForDescription = NO_TAG_VALUE;