### 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.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 12 Sep 2007 06:12:43 -0000 @@ -20,6 +20,7 @@ String docCommentSupport = CompilerOptions.ENABLED; String reportInvalidJavadoc = CompilerOptions.ERROR; + String reportInvalidJavadocConsiderDescription = CompilerOptions.RETURN_TAG; 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, this.reportInvalidJavadocConsiderDescription); + } else { + options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsConsiderDescription, CompilerOptions.RETURN_TAG); + } options.put(CompilerOptions.OPTION_ReportFieldHiding, CompilerOptions.IGNORE); options.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, CompilerOptions.IGNORE); options.put(CompilerOptions.OPTION_ReportDeprecation, reportDeprecation); @@ -5773,4 +5779,211 @@ "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.ALL_TAGS; + 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.ALL_TAGS; + 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; + reportInvalidJavadocConsiderDescription = CompilerOptions.RETURN_TAG; + 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" + ); + } + + public void testBug73352d() { + 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.NO_TAG; + runConformTest(units); + } } 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 12 Sep 2007 06:12:16 -0000 @@ -1198,13 +1198,13 @@ String expectedLogContents = "\n" + "\n" + - "\n" + + "\n" + " \n" + - " \n" + + " \n" + " \n" + " \n" + " \n" + - " \n" + + " \n" + " \n" + " \n" + " \n" + @@ -1240,6 +1240,7 @@ "