### 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.38 diff -u -r1.38 JavadocBugsTest.java --- src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java 16 Oct 2007 10:24:51 -0000 1.38 +++ src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java 21 Mar 2008 12:19:55 -0000 @@ -3083,7 +3083,7 @@ "}\n" }; reportInvalidJavadoc = CompilerOptions.WARNING; - reportMissingJavadocDescription = CompilerOptions.ALL_TAGS; + reportMissingJavadocDescription = CompilerOptions.ALL_STANDARD_TAGS; runNegativeTest(units, "----------\n" + "1. WARNING in X.java (at line 2)\n" + @@ -3180,7 +3180,7 @@ "}\n" }; reportInvalidJavadoc = CompilerOptions.WARNING; - reportMissingJavadocDescription = CompilerOptions.ALL_TAGS; + reportMissingJavadocDescription = CompilerOptions.ALL_STANDARD_TAGS; runConformTest(units); } public void testBug73352c() { @@ -6936,4 +6936,29 @@ "Javadoc: Malformed reference (missing end space separator)\n" + "----------\n"); } + /** + * @bug 222902: [Javadoc] Missing description should not be warned in some cases + * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=222902" + */ + public void testBug222902() { + String[] units = new String[] { + "X.java", + "/**\n" + + "* @since\n" + + "* @generated\n" + // should not get a warning for missing description on non-standard tag + "*/\n" + + "public class X {\n" + + "}\n" + }; + reportInvalidJavadoc = CompilerOptions.WARNING; + reportMissingJavadocDescription = CompilerOptions.ALL_STANDARD_TAGS; + runNegativeTest(units, + "----------\n" + + "1. WARNING in X.java (at line 2)\n" + + " * @since\n" + + " ^^^^^\n" + + "Javadoc: Description expected after @since\n" + + "----------\n" + ); + } } #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.java,v retrieving revision 1.13 diff -u -r1.13 JavadocTagConstants.java --- compiler/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.java 4 Oct 2007 13:01:46 -0000 1.13 +++ compiler/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.java 21 Mar 2008 12:19:57 -0000 @@ -52,6 +52,12 @@ public static final int TAG_INHERITDOC_LENGTH = TAG_INHERITDOC.length; public static final int TAG_VALUE_LENGTH = TAG_VALUE.length; public static final int TAG_CATEGORY_LENGTH = TAG_CATEGORY.length; + public static final int TAG_AUTHOR_LENGTH = TAG_AUTHOR.length; + public static final int TAG_SERIAL_LENGTH = TAG_SERIAL.length; + public static final int TAG_SERIAL_DATA_LENGTH = TAG_SERIAL_DATA.length; + public static final int TAG_SERIAL_FIELD_LENGTH = TAG_SERIAL_FIELD.length; + public static final int TAG_SINCE_LENGTH = TAG_SINCE.length; + public static final int TAG_VERSION_LENGTH = TAG_VERSION.length; // tags value @@ -67,6 +73,12 @@ public static final int TAG_INHERITDOC_VALUE = 9; public static final int TAG_VALUE_VALUE = 10; public static final int TAG_CATEGORY_VALUE = 11; + public static final int TAG_AUTHOR_VALUE = 12; + public static final int TAG_SERIAL_VALUE = 13; + public static final int TAG_SERIAL_DATA_VALUE = 14; + public static final int TAG_SERIAL_FIELD_VALUE = 15; + public static final int TAG_SINCE_VALUE = 16; + public static final int TAG_VERSION_VALUE = 17; public static final int TAG_OTHERS_VALUE = 100; // tags expected positions 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.64 diff -u -r1.64 JavadocParser.java --- compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java 4 Oct 2007 13:01:21 -0000 1.64 +++ compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java 21 Mar 2008 12:19:57 -0000 @@ -483,11 +483,16 @@ this.scanner.currentPosition = this.tagSourceEnd+1; // Decide which parse to perform depending on tag name - this.tagValue = NO_TAG_VALUE; + this.tagValue = TAG_OTHERS_VALUE; boolean alreadyParsedTag = false; switch (token) { case TerminalTokens.TokenNameIdentifier : switch (tagName[0]) { + case 'a': + if (length == TAG_AUTHOR_LENGTH && CharOperation.equals(TAG_AUTHOR, tagName)) { + this.tagValue = TAG_AUTHOR_VALUE; + } + break; case 'c': if (length == TAG_CATEGORY_LENGTH && CharOperation.equals(TAG_CATEGORY, tagName)) { this.tagValue = TAG_CATEGORY_VALUE; @@ -570,6 +575,14 @@ valid = parseReference(); } alreadyParsedTag = true; + } else if (length == TAG_SERIAL_LENGTH && CharOperation.equals(TAG_SERIAL, tagName)) { + this.tagValue = TAG_SERIAL_VALUE; + } else if (length == TAG_SERIAL_DATA_LENGTH && CharOperation.equals(TAG_SERIAL_DATA, tagName)) { + this.tagValue = TAG_SERIAL_DATA_VALUE; + } else if (length == TAG_SERIAL_FIELD_LENGTH && CharOperation.equals(TAG_SERIAL_FIELD, tagName)) { + this.tagValue = TAG_SERIAL_FIELD_VALUE; + } else if (length == TAG_SINCE_LENGTH && CharOperation.equals(TAG_SINCE, tagName)) { + this.tagValue = TAG_SINCE_VALUE; } break; case 'v': @@ -598,6 +611,8 @@ } } alreadyParsedTag = true; + } else if (length == TAG_VERSION_LENGTH && CharOperation.equals(TAG_VERSION, tagName)) { + this.tagValue = TAG_VERSION_VALUE; } else { createTag(); } @@ -627,7 +642,7 @@ break; } this.textStart = this.index; - if (! alreadyParsedTag && this.reportProblems && verifyEndLine(this.scanner.currentPosition)) { + if (this.tagValue != TAG_OTHERS_VALUE && ! alreadyParsedTag && this.reportProblems && verifyEndLine(this.scanner.currentPosition)) { this.sourceParser.problemReporter().javadocMissingTagDescription(tagName, this.tagSourceStart, this.tagSourceEnd, this.sourceParser.modifiers); return false; } Index: compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java,v retrieving revision 1.368 diff -u -r1.368 ProblemReporter.java --- compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java 5 Mar 2008 11:56:14 -0000 1.368 +++ compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java 21 Mar 2008 12:19:58 -0000 @@ -1135,7 +1135,7 @@ } break; case IProblem.JavadocMissingTagDescription: - if (! CompilerOptions.ALL_TAGS.equals(this.options.reportMissingJavadocTagDescription)) { + if (! CompilerOptions.ALL_STANDARD_TAGS.equals(this.options.reportMissingJavadocTagDescription)) { return ProblemSeverities.Ignore; } break; Index: model/org/eclipse/jdt/core/JavaCore.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java,v retrieving revision 1.610 diff -u -r1.610 JavaCore.java --- model/org/eclipse/jdt/core/JavaCore.java 17 Mar 2008 14:14:21 -0000 1.610 +++ model/org/eclipse/jdt/core/JavaCore.java 21 Mar 2008 12:19:59 -0000 @@ -1090,12 +1090,14 @@ public static final String COMPILER_PB_INVALID_JAVADOC_TAGS_VISIBILITY = PLUGIN_ID + ".compiler.problem.invalidJavadocTagsVisibility"; //$NON-NLS-1$ /** * Compiler option ID: Reporting missing tag description. - *

When enabled, the compiler will report a warning or an error for any Javadoc missing a required description. + *

When enabled, the compiler will report a warning or an error for any Javadoc tag missing a required description. *

The severity of the problem is controlled with option {@link #COMPILER_PB_INVALID_JAVADOC}. *

This option is NOT dependent from the Report errors in tags option. + *

The initial set of standard tags is defined by the block tags of the Javadoc tags. + * This set may grow in the future. User defined tags are thus not included in the standard tags. *

*
Option id:
"org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription"
- *
Possible values:
{ "return_tag", "all_tags", "no_tag" }
+ *
Possible values:
{ "return_tag", "all_standard_tags", "no_tag" }
*
Default:
"return_tag"
*
* @since 3.4 @@ -2135,7 +2137,12 @@ * @since 3.4 * @category OptionValue */ - public static final String COMPILER_PB_MISSING_JAVADOC_TAG_DESCRIPTION_ALL_TAGS = CompilerOptions.ALL_TAGS; + public static final String COMPILER_PB_MISSING_JAVADOC_TAG_DESCRIPTION_ALL_STANDARD_TAGS = CompilerOptions.ALL_STANDARD_TAGS; + /** + * @deprecated use {@link #COMPILER_PB_MISSING_JAVADOC_TAG_DESCRIPTION_ALL_STANDARD_TAGS} instead + * TODO: remove before 3.4M6 + */ + public static final String COMPILER_PB_MISSING_JAVADOC_TAG_DESCRIPTION_ALL_TAGS = CompilerOptions.ALL_STANDARD_TAGS; // end configurable option values } /** Index: compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java,v retrieving revision 1.200 diff -u -r1.200 CompilerOptions.java --- compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java 5 Mar 2008 07:57:20 -0000 1.200 +++ compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java 21 Mar 2008 12:19:57 -0000 @@ -152,7 +152,7 @@ public static final String PRIVATE = "private"; //$NON-NLS-1$ public static final String RETURN_TAG = "return_tag"; //$NON-NLS-1$ public static final String NO_TAG = "no_tag"; //$NON-NLS-1$ - public static final String ALL_TAGS = "all_tags"; //$NON-NLS-1$ + public static final String ALL_STANDARD_TAGS = "all_standard_tags"; //$NON-NLS-1$ /** * Bit mask for configurable problems (error/warning threshold)