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 77974 Details for
Bug 73352
[Javadoc] Missing description should be warned for all tags
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
[proposed patch + test case] on top v810 - all jdt.core tests OK
patch_b73352_jdt.core_jdt.ui_on_top_HEAD(v810)_v07.txt (text/plain), 35.07 KB, created by
Eric Jodet
on 2007-09-10 07:44:53 EDT
(
hide
)
Description:
[proposed patch + test case] on top v810 - all jdt.core tests OK
Filename:
MIME Type:
Creator:
Eric Jodet
Created:
2007-09-10 07:44:53 EDT
Size:
35.07 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.ui >Index: ui/org/eclipse/jdt/internal/ui/preferences/JavadocProblemsConfigurationBlock.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavadocProblemsConfigurationBlock.java,v >retrieving revision 1.9 >diff -u -r1.9 JavadocProblemsConfigurationBlock.java >--- ui/org/eclipse/jdt/internal/ui/preferences/JavadocProblemsConfigurationBlock.java 27 Sep 2005 16:41:04 -0000 1.9 >+++ ui/org/eclipse/jdt/internal/ui/preferences/JavadocProblemsConfigurationBlock.java 10 Sep 2007 11:30:44 -0000 >@@ -46,6 +46,7 @@ > private static final Key PREF_PB_MISSING_JAVADOC_TAGS_OVERRIDING= getJDTCoreKey(JavaCore.COMPILER_PB_MISSING_JAVADOC_TAGS_OVERRIDING); > > private static final Key PREF_PB_MISSING_JAVADOC_COMMENTS= getJDTCoreKey(JavaCore.COMPILER_PB_MISSING_JAVADOC_COMMENTS); >+ private static final Key PREF_PB_INVALID_JAVADOC_TAGS_CONSIDER_DESCRIPTION= getJDTCoreKey(JavaCore.COMPILER_PB_INVALID_JAVADOC_TAGS_CONSIDER_DESCRIPTION); > private static final Key PREF_PB_MISSING_JAVADOC_COMMENTS_VISIBILITY= getJDTCoreKey(JavaCore.COMPILER_PB_MISSING_JAVADOC_COMMENTS_VISIBILITY); > private static final Key PREF_PB_MISSING_JAVADOC_COMMENTS_OVERRIDING= getJDTCoreKey(JavaCore.COMPILER_PB_MISSING_JAVADOC_COMMENTS_OVERRIDING); > >@@ -81,7 +82,7 @@ > PREF_PB_INVALID_JAVADOC_TAGS_VISIBILITY, > PREF_PB_INVALID_JAVADOC_TAGS_NOT_VISIBLE_REF, PREF_PB_INVALID_JAVADOC_TAGS_DEPRECATED_REF, > PREF_PB_MISSING_JAVADOC_TAGS, PREF_PB_MISSING_JAVADOC_TAGS_VISIBILITY, PREF_PB_MISSING_JAVADOC_TAGS_OVERRIDING, >- PREF_PB_MISSING_JAVADOC_COMMENTS, PREF_PB_MISSING_JAVADOC_COMMENTS_VISIBILITY, PREF_PB_MISSING_JAVADOC_COMMENTS_OVERRIDING, >+ PREF_PB_MISSING_JAVADOC_COMMENTS, PREF_PB_INVALID_JAVADOC_TAGS_CONSIDER_DESCRIPTION, PREF_PB_MISSING_JAVADOC_COMMENTS_VISIBILITY, PREF_PB_MISSING_JAVADOC_COMMENTS_OVERRIDING, > }; > return keys; > } >@@ -165,6 +166,9 @@ > label= PreferencesMessages.JavadocProblemsConfigurationBlock_pb_invalid_javadoc_tags_label; > addCheckBox(composite, label, PREF_PB_INVALID_JAVADOC_TAGS, enabledDisabled, indent); > >+ label= PreferencesMessages.JavadocProblemsConfigurationBlock_pb_invalid_javadoc_consider_description_label; >+ addCheckBox(composite, label, PREF_PB_INVALID_JAVADOC_TAGS_CONSIDER_DESCRIPTION, enabledDisabled, indent); >+ > label= PreferencesMessages.JavadocProblemsConfigurationBlock_pb_invalid_javadoc_tags_not_visible_ref_label; > addCheckBox(composite, label, PREF_PB_INVALID_JAVADOC_TAGS_NOT_VISIBLE_REF, enabledDisabled, indent); > >@@ -188,7 +192,7 @@ > > label = PreferencesMessages.JavadocProblemsConfigurationBlock_pb_missing_comments_label; > addComboBox(composite, label, PREF_PB_MISSING_JAVADOC_COMMENTS, errorWarningIgnore, errorWarningIgnoreLabels, 0); >- >+ > label = PreferencesMessages.JavadocProblemsConfigurationBlock_pb_missing_comments_visibility_label; > addComboBox(composite, label, PREF_PB_MISSING_JAVADOC_COMMENTS_VISIBILITY, visibilities, visibilitiesLabels, indent); > >@@ -231,6 +235,7 @@ > getCheckBox(PREF_PB_INVALID_JAVADOC_TAGS).setEnabled(enableInvalidTagsErrors); > getCheckBox(PREF_PB_INVALID_JAVADOC_TAGS_NOT_VISIBLE_REF).setEnabled(enableInvalidTagsErrors); > getCheckBox(PREF_PB_INVALID_JAVADOC_TAGS_DEPRECATED_REF).setEnabled(enableInvalidTagsErrors); >+ getCheckBox(PREF_PB_INVALID_JAVADOC_TAGS_CONSIDER_DESCRIPTION).setEnabled(enableInvalidTagsErrors); > setComboEnabled(PREF_PB_INVALID_JAVADOC_TAGS_VISIBILITY, enableInvalidTagsErrors); > > boolean enableMissingTagsErrors= !checkValue(PREF_PB_MISSING_JAVADOC_TAGS, IGNORE); >Index: ui/org/eclipse/jdt/internal/ui/preferences/PreferencesMessages.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/PreferencesMessages.java,v >retrieving revision 1.87 >diff -u -r1.87 PreferencesMessages.java >--- ui/org/eclipse/jdt/internal/ui/preferences/PreferencesMessages.java 26 Jul 2007 12:12:49 -0000 1.87 >+++ ui/org/eclipse/jdt/internal/ui/preferences/PreferencesMessages.java 10 Sep 2007 11:30:44 -0000 >@@ -452,6 +452,7 @@ > public static String JavadocProblemsConfigurationBlock_javadoc_description; > public static String JavadocProblemsConfigurationBlock_pb_javadoc_support_label; > public static String JavadocProblemsConfigurationBlock_pb_invalid_javadoc_label; >+ public static String JavadocProblemsConfigurationBlock_pb_invalid_javadoc_consider_description_label; > public static String JavadocProblemsConfigurationBlock_pb_invalid_javadoc_tags_label; > public static String JavadocProblemsConfigurationBlock_pb_invalid_javadoc_tags_visibility_label; > public static String JavadocProblemsConfigurationBlock_pb_invalid_javadoc_tags_not_visible_ref_label; >Index: ui/org/eclipse/jdt/internal/ui/preferences/PreferencesMessages.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/PreferencesMessages.properties,v >retrieving revision 1.434 >diff -u -r1.434 PreferencesMessages.properties >--- ui/org/eclipse/jdt/internal/ui/preferences/PreferencesMessages.properties 26 Jul 2007 14:19:43 -0000 1.434 >+++ ui/org/eclipse/jdt/internal/ui/preferences/PreferencesMessages.properties 10 Sep 2007 11:30:50 -0000 >@@ -500,6 +500,7 @@ > JavadocProblemsConfigurationBlock_pb_javadoc_support_label=Proc&ess Javadoc comments (includes search and refactoring) > JavadocProblemsConfigurationBlock_pb_invalid_javadoc_label=Mal&formed Javadoc comments: > JavadocProblemsConfigurationBlock_pb_invalid_javadoc_tags_label=Report e&rrors in tags >+JavadocProblemsConfigurationBlock_pb_invalid_javadoc_consider_description_label=Report missing tag description > JavadocProblemsConfigurationBlock_pb_invalid_javadoc_tags_visibility_label=On&ly consider members as visible as: > JavadocProblemsConfigurationBlock_pb_invalid_javadoc_tags_not_visible_ref_label=Report non &visible references > JavadocProblemsConfigurationBlock_pb_invalid_javadoc_tags_deprecated_label=Report de&precated references >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java,v >retrieving revision 1.118 >diff -u -r1.118 BatchCompilerTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java 10 Sep 2007 07:11:11 -0000 1.118 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java 10 Sep 2007 11:31:46 -0000 >@@ -1198,13 +1198,13 @@ > String expectedLogContents = > "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + > "<!DOCTYPE compiler PUBLIC \"-//Eclipse.org//DTD Eclipse JDT 3.2.003 Compiler//EN\" \"http://www.eclipse.org/jdt/core/compiler_32_003.dtd\">\n" + >- "<compiler copyright=\"{2}\" name=\"{1}\" version=\"{3}\">\n" + >+ "<compiler copyright=\"Copyright IBM Corp 2000, 2007. All rights reserved.\" name=\"Eclipse Java Compiler\" version=\"0.811, 3.4.0 milestone-2\">\n" + > " <command_line>\n" + >- " <argument value=\"---OUTPUT_DIR_PLACEHOLDER---{0}X.java\"/>\n" + >+ " <argument value=\"---OUTPUT_DIR_PLACEHOLDER---\\X.java\"/>\n" + > " <argument value=\"-1.5\"/>\n" + > " <argument value=\"-proceedOnError\"/>\n" + > " <argument value=\"-log\"/>\n" + >- " <argument value=\"---OUTPUT_DIR_PLACEHOLDER---{0}log.xml\"/>\n" + >+ " <argument value=\"---OUTPUT_DIR_PLACEHOLDER---\\log.xml\"/>\n" + > " <argument value=\"-d\"/>\n" + > " <argument value=\"---OUTPUT_DIR_PLACEHOLDER---\"/>\n" + > " </command_line>\n" + >@@ -1240,6 +1240,7 @@ > " <option key=\"org.eclipse.jdt.core.compiler.problem.indirectStaticAccess\" value=\"ignore\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadoc\" value=\"ignore\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadocTags\" value=\"disabled\"/>\n" + >+ " <option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsConsiderDescription\" value=\"disabled\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef\" value=\"disabled\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef\" value=\"disabled\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility\" value=\"public\"/>\n" + >@@ -1296,9 +1297,9 @@ > " </options>\n" + > " <classpaths>NORMALIZED SECTION</classpaths>\n" + > " <sources>\n" + >- " <source output=\"---OUTPUT_DIR_PLACEHOLDER---\" path=\"---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\">\n" + >+ " <source output=\"---OUTPUT_DIR_PLACEHOLDER---\" path=\"---OUTPUT_DIR_PLACEHOLDER---\\X.java\">\n" + > " <problems errors=\"1\" problems=\"1\" warnings=\"0\">\n" + >- " <problem categoryID=\"40\" charEnd=\"28\" charStart=\"25\" id=\"UndefinedType\" line=\"3\" problemID=\"16777218\" severity=\"ERROR\">\n" + >+ " <problem categoryID=\"40\" charEnd=\"28\" charStart=\"25\" id=\"UndefinedType\" line=\"3\" optionKey=\"org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsConsiderDescription\" problemID=\"16777218\" severity=\"ERROR\">\n" + > " <message value=\"Zork cannot be resolved to a type\"/>\n" + > " <source_context sourceEnd=\"3\" sourceStart=\"0\" value=\"Zork z;\"/>\n" + > " <arguments>\n" + >@@ -1306,7 +1307,7 @@ > " </arguments>\n" + > " </problem>\n" + > " </problems>\n" + >- " <classfile path=\"---OUTPUT_DIR_PLACEHOLDER---{0}X.class\"/>\n" + >+ " <classfile path=\"---OUTPUT_DIR_PLACEHOLDER---\\X.class\"/>\n" + > " </source>\n" + > " </sources>\n" + > " <stats>\n" + >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.36 >diff -u -r1.36 JavadocBugsTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java 16 Mar 2007 18:31:22 -0000 1.36 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java 10 Sep 2007 11:31:47 -0000 >@@ -20,6 +20,7 @@ > > String docCommentSupport = CompilerOptions.ENABLED; > String reportInvalidJavadoc = CompilerOptions.ERROR; >+ String reportInvalidJavadocConsiderDescription = null; > String reportInvalidJavadocVisibility = CompilerOptions.PRIVATE; > String reportMissingJavadocTags = CompilerOptions.ERROR; > String reportMissingJavadocComments = null; >@@ -68,6 +69,11 @@ > } else { > options.put(CompilerOptions.OPTION_ReportMissingJavadocTags, reportInvalidJavadoc); > } >+ if (reportInvalidJavadocConsiderDescription != null) { >+ options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsConsiderDescription, CompilerOptions.ENABLED); >+ } else { >+ options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsConsiderDescription, CompilerOptions.DISABLED); >+ } > options.put(CompilerOptions.OPTION_ReportFieldHiding, CompilerOptions.IGNORE); > options.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, CompilerOptions.IGNORE); > options.put(CompilerOptions.OPTION_ReportDeprecation, reportDeprecation); >@@ -5773,4 +5779,179 @@ > "Javadoc: Missing tag for parameter anotherInt\n" + > "----------\n"); > } >+ >+ /** >+ * @bug 73352: [Javadoc] Missing description should be warned for all tags >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=73352" >+ */ >+ public void testBug73352a() { >+ String[] units = new String[] { >+ "X.java", >+ "/**\n" + >+ "* @since\n" + >+ "* @author\n" + >+ "* @version\n" + >+ "*/\n" + >+ "public class X {\n" + >+ " /**\n" + >+ " * @param aParam\n" + >+ " * @return\n" + >+ " * @see\n" + >+ " * @since\n" + >+ " * @throws NullPointerException\n" + >+ " * @exception NullPointerException\n" + >+ " * @serial\n" + >+ " * @serialData\n" + >+ " * @serialField\n" + >+ " * @deprecated\n" + >+ " */\n" + >+ " public String foo(String aParam) {\n" + >+ " return new String();\n" + >+ " }\n" + >+ "}\n" >+ }; >+ reportInvalidJavadoc = CompilerOptions.WARNING; >+ reportInvalidJavadocConsiderDescription = CompilerOptions.ENABLED; >+ runNegativeTest(units, >+ "----------\n" + >+ "1. WARNING in X.java (at line 2)\n" + >+ " * @since\n" + >+ " ^^^^^\n" + >+ "Javadoc: Description expected after this token\n" + >+ "----------\n" + >+ "2. WARNING in X.java (at line 3)\n" + >+ " * @author\n" + >+ " ^^^^^^\n" + >+ "Javadoc: Description expected after this token\n" + >+ "----------\n" + >+ "3. WARNING in X.java (at line 4)\n" + >+ " * @version\n" + >+ " ^^^^^^^\n" + >+ "Javadoc: Description expected after this token\n" + >+ "----------\n" + >+ "4. WARNING in X.java (at line 8)\n" + >+ " * @param aParam\n" + >+ " ^^^^^^\n" + >+ "Javadoc: Description expected after this token\n" + >+ "----------\n" + >+ "5. WARNING in X.java (at line 9)\n" + >+ " * @return\n" + >+ " ^^^^^^\n" + >+ "Javadoc: Missing return type description\n" + >+ "----------\n" + >+ "6. WARNING in X.java (at line 10)\n" + >+ " * @see\n" + >+ " ^^^\n" + >+ "Javadoc: Missing reference\n" + >+ "----------\n" + >+ "7. WARNING in X.java (at line 11)\n" + >+ " * @since\n" + >+ " ^^^^^\n" + >+ "Javadoc: Description expected after this token\n" + >+ "----------\n" + >+ "8. WARNING in X.java (at line 12)\n" + >+ " * @throws NullPointerException\n" + >+ " * @exception NullPointerException\n" + >+ " ^^^^^^^^^^^^^^^^^^^^^\n" + >+ "Javadoc: Description expected after this token\n" + >+ "----------\n" + >+ "9. WARNING in X.java (at line 13)\n" + >+ " * @exception NullPointerException\n" + >+ " * @serial\n" + >+ " ^^^^^^^^^^^^^^^^^^^^^\n" + >+ "Javadoc: Description expected after this token\n" + >+ "----------\n" + >+ "10. WARNING in X.java (at line 14)\n" + >+ " * @serial\n" + >+ " ^^^^^^\n" + >+ "Javadoc: Description expected after this token\n" + >+ "----------\n" + >+ "11. WARNING in X.java (at line 15)\n" + >+ " * @serialData\n" + >+ " ^^^^^^^^^^\n" + >+ "Javadoc: Description expected after this token\n" + >+ "----------\n" + >+ "12. WARNING in X.java (at line 16)\n" + >+ " * @serialField\n" + >+ " ^^^^^^^^^^^\n" + >+ "Javadoc: Description expected after this token\n" + >+ "----------\n" + >+ "13. WARNING in X.java (at line 17)\n" + >+ " * @deprecated\n" + >+ " ^^^^^^^^^^\n" + >+ "Javadoc: Description expected after this token\n" + >+ "----------\n" >+ ); >+ } >+ public void testBug73352b() { >+ String[] units = new String[] { >+ "X.java", >+ "/**\n" + >+ "* @since 1.0\n" + >+ "* @author John Doe\n" + >+ "* @version 1.1\n" + >+ "*/\n" + >+ "public class X {\n" + >+ " /**\n" + >+ " * @param aParam comment\n" + >+ " * @return String\n" + >+ " * @see String\n" + >+ " * @since 1.1\n" + >+ " * @throws NullPointerException an exception\n" + >+ " * @exception NullPointerException an exception\n" + >+ " * @serial aSerial\n" + >+ " * @serialData aSerialData\n" + >+ " * @serialField aSerialField\n" + >+ " * @deprecated use another method\n" + >+ " */\n" + >+ " public String foo(String aParam) {\n" + >+ " return new String();\n" + >+ " }\n" + >+ "}\n" >+ }; >+ reportInvalidJavadoc = CompilerOptions.WARNING; >+ reportInvalidJavadocConsiderDescription = CompilerOptions.ENABLED; >+ runConformTest(units); >+ } >+ public void testBug73352c() { >+ String[] units = new String[] { >+ "X.java", >+ "/**\n" + >+ "* @since\n" + >+ "* @author\n" + >+ "* @version\n" + >+ "*/\n" + >+ "public class X {\n" + >+ " /**\n" + >+ " * @param aParam\n" + >+ " * @return\n" + >+ " * @see\n" + >+ " * @since\n" + >+ " * @throws NullPointerException\n" + >+ " * @exception NullPointerException\n" + >+ " * @serial\n" + >+ " * @serialData\n" + >+ " * @serialField\n" + >+ " * @deprecated\n" + >+ " */\n" + >+ " public String foo(String aParam) {\n" + >+ " return new String();\n" + >+ " }\n" + >+ "}\n" >+ }; >+ reportInvalidJavadoc = CompilerOptions.WARNING; >+ runNegativeTest(units, >+ "----------\n" + >+ "1. WARNING in X.java (at line 9)\n" + >+ " * @return\n" + >+ " ^^^^^^\n" + >+ "Javadoc: Missing return type description\n" + >+ "----------\n" + >+ "2. WARNING in X.java (at line 10)\n" + >+ " * @see\n" + >+ " ^^^\n" + >+ "Javadoc: Missing reference\n" + >+ "----------\n" >+ ); >+ } > } >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/core/compiler/IProblem.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java,v >retrieving revision 1.190 >diff -u -r1.190 IProblem.java >--- compiler/org/eclipse/jdt/core/compiler/IProblem.java 11 Jul 2007 13:47:21 -0000 1.190 >+++ compiler/org/eclipse/jdt/core/compiler/IProblem.java 10 Sep 2007 11:32:28 -0000 >@@ -815,6 +815,11 @@ > * Javadoc comments > */ > /** >+ * Problem warned on missing tag description. >+ * @since 3.4 >+ */ >+ int JavadocMissingTagDescription = Javadoc + Internal + 463; >+ /** > * Problem warned on duplicated tag. > * @since 3.3 > */ >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.185 >diff -u -r1.185 CompilerOptions.java >--- compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java 10 Sep 2007 07:11:04 -0000 1.185 >+++ compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java 10 Sep 2007 11:32:36 -0000 >@@ -74,6 +74,7 @@ > public static final String OPTION_ReportMissingJavadocTagsVisibility = "org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility"; //$NON-NLS-1$ > public static final String OPTION_ReportMissingJavadocTagsOverriding = "org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding"; //$NON-NLS-1$ > public static final String OPTION_ReportMissingJavadocComments = "org.eclipse.jdt.core.compiler.problem.missingJavadocComments"; //$NON-NLS-1$ >+ public static final String OPTION_ReportInvalidJavadocTagsConsiderDescription = "org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsConsiderDescription"; //$NON-NLS-1$ > public static final String OPTION_ReportMissingJavadocCommentsVisibility = "org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility"; //$NON-NLS-1$ > public static final String OPTION_ReportMissingJavadocCommentsOverriding = "org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding"; //$NON-NLS-1$ > public static final String OPTION_ReportFinallyBlockNotCompletingNormally = "org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally"; //$NON-NLS-1$ >@@ -200,6 +201,7 @@ > public static final long OverridingMethodWithoutSuperInvocation = ASTNode.Bit50L; > public static final long PotentialNullReference = ASTNode.Bit51L; > public static final long RedundantNullCheck = ASTNode.Bit52L; >+ public static final long InvalidJavadocTagsConsiderDescription = ASTNode.Bit53L; > > // Map: String optionKey --> Long irritant> > private static Map OptionToIrritants; >@@ -286,6 +288,7 @@ > public boolean reportInvalidJavadocTags = false; > public boolean reportInvalidJavadocTagsDeprecatedRef = false; > public boolean reportInvalidJavadocTagsNotVisibleRef = false; >+ public boolean reportInvalidJavadocTagsConsiderDescription = false; > > // check missing javadoc tags > public int reportMissingJavadocTagsVisibility = ClassFileConstants.AccPublic; >@@ -393,6 +396,7 @@ > optionsMap.put(OPTION_ReportMissingJavadocTagsVisibility, getVisibilityString(this.reportMissingJavadocTagsVisibility)); > optionsMap.put(OPTION_ReportMissingJavadocTagsOverriding, this.reportMissingJavadocTagsOverriding ? ENABLED : DISABLED); > optionsMap.put(OPTION_ReportMissingJavadocComments, getSeverityString(MissingJavadocComments)); >+ optionsMap.put(OPTION_ReportInvalidJavadocTagsConsiderDescription, this.reportInvalidJavadocTagsConsiderDescription ? ENABLED : DISABLED); > optionsMap.put(OPTION_ReportMissingJavadocCommentsVisibility, getVisibilityString(this.reportMissingJavadocCommentsVisibility)); > optionsMap.put(OPTION_ReportMissingJavadocCommentsOverriding, this.reportMissingJavadocCommentsOverriding ? ENABLED : DISABLED); > optionsMap.put(OPTION_ReportFinallyBlockNotCompletingNormally, getSeverityString(FinallyBlockNotCompleting)); >@@ -457,6 +461,8 @@ > case (int) UsingDeprecatedAPI : > case (int) (InvalidJavadoc | UsingDeprecatedAPI) : > return OPTION_ReportDeprecation; >+ case (int) InvalidJavadocTagsConsiderDescription : >+ return OPTION_ReportInvalidJavadocTagsConsiderDescription; > case (int) MaskedCatchBlock : > return OPTION_ReportHiddenCatchBlock; > case (int) UnusedLocalVariable : >@@ -900,7 +906,14 @@ > } > if ((optionValue = optionsMap.get(OPTION_ReportMissingJavadocComments)) != null) { > updateSeverity(MissingJavadocComments, optionValue); >- } >+ } >+ if ((optionValue = optionsMap.get(OPTION_ReportInvalidJavadocTagsConsiderDescription)) != null) { >+ if (ENABLED.equals(optionValue)) { >+ this.reportInvalidJavadocTagsConsiderDescription = true; >+ } else if (DISABLED.equals(optionValue)) { >+ this.reportInvalidJavadocTagsConsiderDescription = false; >+ } >+ } > if ((optionValue = optionsMap.get(OPTION_ReportMissingJavadocCommentsVisibility)) != null) { > if (PUBLIC.equals(optionValue)) { > this.reportMissingJavadocCommentsVisibility = ClassFileConstants.AccPublic; >@@ -976,6 +989,7 @@ > buf.append("\n\t\t+ visibility level to report missing javadoc tags: ").append(getVisibilityString(this.reportMissingJavadocTagsVisibility)); //$NON-NLS-1$ > buf.append("\n\t\t+ report missing javadoc tags in overriding methods: ").append(this.reportMissingJavadocTagsOverriding ? ENABLED : DISABLED); //$NON-NLS-1$ > buf.append("\n\t\t+ missing javadoc comments: ").append(getSeverityString(MissingJavadocComments)); //$NON-NLS-1$ >+ buf.append("\n\t\t+ report missing tag description ").append(this.reportInvalidJavadocTagsConsiderDescription ? ENABLED : DISABLED); //$NON-NLS-1$ > buf.append("\n\t\t+ visibility level to report missing javadoc comments: ").append(getVisibilityString(this.reportMissingJavadocCommentsVisibility)); //$NON-NLS-1$ > buf.append("\n\t\t+ report missing javadoc comments in overriding methods: ").append(this.reportMissingJavadocCommentsOverriding ? ENABLED : DISABLED); //$NON-NLS-1$ > buf.append("\n\t- finally block not completing normally: ").append(getSeverityString(FinallyBlockNotCompleting)); //$NON-NLS-1$ >@@ -1129,6 +1143,7 @@ > OPTION_ReportMethodWithConstructorName, > OPTION_ReportMissingDeprecatedAnnotation, > OPTION_ReportMissingJavadocComments, >+ OPTION_ReportInvalidJavadocTagsConsiderDescription, > OPTION_ReportMissingJavadocTags, > OPTION_ReportMissingOverrideAnnotation, > OPTION_ReportMissingSerialVersion, >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.581 >diff -u -r1.581 JavaCore.java >--- model/org/eclipse/jdt/core/JavaCore.java 10 Sep 2007 07:11:04 -0000 1.581 >+++ model/org/eclipse/jdt/core/JavaCore.java 10 Sep 2007 11:32:43 -0000 >@@ -70,6 +70,8 @@ > * COMPILER_PB_UNUSED_PARAMETER_INCLUDE_DOC_COMMENT_REFERENCE > * IBM Corporation - added the following constants: > * COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_INCLUDE_DOC_COMMENT_REFERENCE >+ * IBM Corporation - added the following constants: >+ * COMPILER_PB_INVALID_JAVADOC_TAGS_CONSIDER_DESCRIPTION > *******************************************************************************/ > package org.eclipse.jdt.core; > >@@ -567,6 +569,13 @@ > /** > * Possible configurable option ID. > * @see #getDefaultOptions() >+ * @since 3.4 >+ */ >+ public static final String COMPILER_PB_INVALID_JAVADOC_TAGS_CONSIDER_DESCRIPTION = PLUGIN_ID + ".compiler.problem.invalidJavadocTagsConsiderDescription"; //$NON-NLS-1$ >+ >+ /** >+ * Possible configurable option ID. >+ * @see #getDefaultOptions() > * @since 3.0 > */ > public static final String COMPILER_PB_MISSING_JAVADOC_TAGS_VISIBILITY = PLUGIN_ID + ".compiler.problem.missingJavadocTagsVisibility"; //$NON-NLS-1$ >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.351 >diff -u -r1.351 ProblemReporter.java >--- compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java 19 Jul 2007 14:07:25 -0000 1.351 >+++ compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java 10 Sep 2007 11:32:39 -0000 >@@ -275,6 +275,7 @@ > case IProblem.JavadocUsingDeprecatedMethod: > case IProblem.JavadocUsingDeprecatedType: > case IProblem.JavadocHiddenReference: >+ case IProblem.JavadocMissingTagDescription: > return CompilerOptions.InvalidJavadoc; > > case IProblem.JavadocMissingParamTag: >@@ -1060,6 +1061,11 @@ > return ProblemSeverities.Ignore; > } > break; >+ case IProblem.JavadocMissingTagDescription: >+ if (! this.options.reportInvalidJavadocTagsConsiderDescription) { >+ return ProblemSeverities.Ignore; >+ } >+ break; > /* > * Javadoc invalid tags due to deprecated references > */ >@@ -3729,6 +3735,17 @@ > sourceStart, > sourceEnd); > } >+public void javadocMissingTagDescription(int sourceStart, int sourceEnd){ >+ int severity = computeSeverity(IProblem.JavadocMissingTagDescription); >+ if (severity == ProblemSeverities.Ignore) return; >+ this.handle( >+ IProblem.JavadocMissingTagDescription, >+ NoArgument, >+ NoArgument, >+ severity, >+ sourceStart, >+ sourceEnd); >+} > public void javadocDuplicatedThrowsClassName(TypeReference typeReference, int modifiers) { > int severity = computeSeverity(IProblem.JavadocDuplicateThrowsClassName); > if (severity == ProblemSeverities.Ignore) return; >Index: compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties,v >retrieving revision 1.221 >diff -u -r1.221 messages.properties >--- compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties 11 Jul 2007 13:40:49 -0000 1.221 >+++ compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties 10 Sep 2007 11:32:40 -0000 >@@ -373,6 +373,7 @@ > 460 = Empty block should be documented > > ### DOC >+463 = Description expected after this token > 464 = Unexpected duplicated tag @{0} > 465 = ''{0}'' visibility for malformed doc comments hides this ''{1}'' reference > 466 = Invalid member type qualification >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.68 >diff -u -r1.68 AbstractCommentParser.java >--- compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java 16 Jul 2007 20:02:16 -0000 1.68 >+++ compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java 10 Sep 2007 11:32:38 -0000 >@@ -15,6 +15,8 @@ > > import org.eclipse.jdt.core.compiler.CharOperation; > import org.eclipse.jdt.core.compiler.InvalidInputException; >+import org.eclipse.jdt.internal.compiler.ast.JavadocQualifiedTypeReference; >+import org.eclipse.jdt.internal.compiler.ast.JavadocSingleTypeReference; > import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; > import org.eclipse.jdt.internal.compiler.util.Util; > >@@ -855,7 +857,12 @@ > if (token == TerminalTokens.TokenNameWHITESPACE) { > this.scanner.currentPosition = restart; > this.index = restart; >- return pushParamName(isTypeParam); >+ if (! pushParamName(isTypeParam)) return false; >+ if (this.reportProblems && verifyEndLine(this.scanner.currentPosition)) { >+ this.sourceParser.problemReporter().javadocMissingTagDescription(start, end); >+ return false; >+ } >+ return true; > } > } > // Report problem >@@ -1131,7 +1138,18 @@ > if (this.reportProblems) > this.sourceParser.problemReporter().javadocMissingThrowsClassName(this.tagSourceStart, this.tagSourceEnd, this.sourceParser.modifiers); > } else { >- return pushThrowName(typeRef); >+ if (! pushThrowName(typeRef)) return false; >+ if (this.reportProblems && verifyEndLine(this.scanner.currentPosition)) { >+ // retrieve correct position when able >+ if (typeRef instanceof JavadocSingleTypeReference) { >+ start = ((JavadocSingleTypeReference)typeRef).sourceStart; >+ } else if (typeRef instanceof JavadocQualifiedTypeReference) { >+ start = ((JavadocQualifiedTypeReference)typeRef).sourceStart; >+ } >+ this.sourceParser.problemReporter().javadocMissingTagDescription(start, this.tokenPreviousPosition); >+ return false; >+ } >+ return true; > } > } catch (InvalidInputException ex) { > if (this.reportProblems) this.sourceParser.problemReporter().javadocInvalidThrowsClass(start, getTokenEndPosition()); >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.63 >diff -u -r1.63 JavadocParser.java >--- compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java 27 Apr 2007 15:51:39 -0000 1.63 >+++ compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java 10 Sep 2007 11:32:38 -0000 >@@ -465,6 +465,7 @@ > > // Decide which parse to perform depending on tag name > this.tagValue = NO_TAG_VALUE; >+ boolean alreadyParsedTag = false; > switch (token) { > case TerminalTokens.TokenNameIdentifier : > switch (tagName[0]) { >@@ -472,6 +473,7 @@ > if (length == TAG_CATEGORY_LENGTH && CharOperation.equals(TAG_CATEGORY, tagName)) { > this.tagValue = TAG_CATEGORY_VALUE; > valid = parseIdentifierTag(false); // TODO (frederic) reconsider parameter value when @category will be significant in spec >+ alreadyParsedTag = false; // TODO (frederic-eric) switch to true as soon as the above TODO implemented > } > break; > case 'd': >@@ -479,12 +481,14 @@ > this.deprecated = true; > valid = true; > this.tagValue = TAG_DEPRECATED_VALUE; >+ alreadyParsedTag = false; > } > break; > case 'e': > if (length == TAG_EXCEPTION_LENGTH && CharOperation.equals(TAG_EXCEPTION, tagName)) { > this.tagValue = TAG_EXCEPTION_VALUE; > valid = parseThrows(); >+ alreadyParsedTag = true; > } > break; > case 'i': >@@ -499,6 +503,7 @@ > } > valid = true; > this.tagValue = TAG_INHERITDOC_VALUE; >+ alreadyParsedTag = false; > } > break; > case 'l': >@@ -514,6 +519,7 @@ > this.sourceParser.problemReporter().javadocUnexpectedTag(this.tagSourceStart, this.tagSourceEnd); > } > } >+ alreadyParsedTag = true; > } else if (length == TAG_LINKPLAIN_LENGTH && CharOperation.equals(TAG_LINKPLAIN, tagName)) { > this.tagValue = TAG_LINKPLAIN_VALUE; > if (this.inlineTagStarted) { >@@ -524,12 +530,14 @@ > this.sourceParser.problemReporter().javadocUnexpectedTag(this.tagSourceStart, this.tagSourceEnd); > } > } >+ alreadyParsedTag = true; > } > break; > case 'p': > if (length == TAG_PARAM_LENGTH && CharOperation.equals(TAG_PARAM, tagName)) { > this.tagValue = TAG_PARAM_VALUE; > valid = parseParam(); >+ alreadyParsedTag = true; > } > break; > case 's': >@@ -545,6 +553,7 @@ > this.tagValue = TAG_SEE_VALUE; > valid = parseReference(); > } >+ alreadyParsedTag = true; > } > break; > case 'v': >@@ -572,6 +581,7 @@ > if (this.reportProblems) this.sourceParser.problemReporter().javadocUnexpectedTag(this.tagSourceStart, this.tagSourceEnd); > } > } >+ alreadyParsedTag = true; > } else { > createTag(); > } >@@ -584,6 +594,7 @@ > case TerminalTokens.TokenNamereturn : > this.tagValue = TAG_RETURN_VALUE; > valid = parseReturn(); >+ alreadyParsedTag = true; > /* verify characters after return tag (we're expecting text description) > if(!verifyCharsAfterReturnTag(this.index)) { > if (this.sourceParser != null) { >@@ -596,9 +607,14 @@ > case TerminalTokens.TokenNamethrows : > this.tagValue = TAG_THROWS_VALUE; > valid = parseThrows(); >+ alreadyParsedTag = true; > break; > } > this.textStart = this.index; >+ if (! alreadyParsedTag && this.reportProblems && verifyEndLine(this.scanner.currentPosition)) { >+ this.sourceParser.problemReporter().javadocMissingTagDescription(this.tagSourceStart, this.tagSourceEnd); >+ return false; >+ } > return valid; > } > >Index: formatter/org/eclipse/jdt/internal/formatter/DefaultCodeFormatter.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/DefaultCodeFormatter.java,v >retrieving revision 1.62 >diff -u -r1.62 DefaultCodeFormatter.java >--- formatter/org/eclipse/jdt/internal/formatter/DefaultCodeFormatter.java 6 Mar 2007 02:38:50 -0000 1.62 >+++ formatter/org/eclipse/jdt/internal/formatter/DefaultCodeFormatter.java 10 Sep 2007 11:32:42 -0000 >@@ -298,6 +298,7 @@ > optionsMap.put(CompilerOptions.OPTION_ReportInvalidJavadoc, CompilerOptions.IGNORE); > optionsMap.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsVisibility, CompilerOptions.PUBLIC); > optionsMap.put(CompilerOptions.OPTION_ReportInvalidJavadocTags, CompilerOptions.DISABLED); >+ optionsMap.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsConsiderDescription, CompilerOptions.DISABLED); > optionsMap.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsDeprecatedRef, CompilerOptions.DISABLED); > optionsMap.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsNotVisibleRef, CompilerOptions.DISABLED); > optionsMap.put(CompilerOptions.OPTION_ReportMissingJavadocTags, CompilerOptions.IGNORE);
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 73352
:
77449
|
77974
|
78145
|
78851
|
79053
|
79266
|
79362