aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAyushman Jain2012-07-19 14:39:03 (EDT)
committerJayaprakash Arthanareeswaran2012-08-10 02:57:22 (EDT)
commit4b2ce36cb1e443f82351b7a276c4a994ddb0c499 (patch)
tree5a86a115f58ebcd188fb8efb763a265dc07334fc
parent46987bf94fa2fc88d9ab6cb36a5870450e66f8d9 (diff)
downloadeclipse.jdt.core-4b2ce36cb1e443f82351b7a276c4a994ddb0c499.zip
eclipse.jdt.core-4b2ce36cb1e443f82351b7a276c4a994ddb0c499.tar.gz
eclipse.jdt.core-4b2ce36cb1e443f82351b7a276c4a994ddb0c499.tar.bz2
Bug 375409 - Add missing Javadoc compile options to batch compiler
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java301
-rw-r--r--org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java182
-rw-r--r--org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/messages.properties42
3 files changed, 515 insertions, 10 deletions
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java
index a4cd63f..8b1573f 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java
@@ -85,7 +85,7 @@ public class BatchCompilerTest extends AbstractRegressionTest {
"}\n";
static {
-// TESTS_NAMES = new String[] { "test315_warn_options_a" };
+// TESTS_NAMES = new String[] { "testBug375409e" };
// TESTS_NUMBERS = new int[] { 306 };
// TESTS_RANGE = new int[] { 298, -1 };
}
@@ -1739,16 +1739,44 @@ public void test012b(){
" intfAnnotation + annotation type used as super interface\n" +
" intfNonInherited + interface non-inherited method compatibility\n" +
" intfRedundant find redundant superinterfaces\n" +
+ " invalidJavadoc all warnings for malformed javadoc tags\n" +
+ " invalidJavadocTag validate javadoc tag arguments\n" +
+ " invalidJavadocTagDep validate deprecated references in javadoc tag args\n" +
+ " invalidJavadocTagNotVisible validate non-visible references in javadoc\n" +
+ " tag args\n" +
+ " invalidJavadocVisibility(<visibility>) specify visibility modifier\n" +
+ " for malformed javadoc tag warnings\n" +
" javadoc invalid javadoc\n" +
" localHiding local variable hiding another variable\n" +
" maskedCatchBlock + hidden catch block\n" +
+ " missingJavadocTags missing Javadoc tags\n" +
+ " missingJavadocTagsOverriding missing Javadoc tags in overriding methods\n" +
+ " missingJavadocTagsMethod missing Javadoc tags for method type parameter\n" +
+ " missingJavadocTagsVisibility(<visibility>) specify visibility modifier\n" +
+ " for missing javadoc tags warnings\n" +
+ " missingJavadocComments missing Javadoc comments\n" +
+ " missingJavadocCommentsOverriding missing Javadoc tags in overriding\n" +
+ " methods\n" +
+ " missingJavadocCommentsVisibility(<visibility>) specify visibility\n" +
+ " modifier for missing javadoc comments warnings\n" +
" nls string literal lacking non-nls tag //$NON-NLS-<n>$\n" +
" noEffectAssign + assignment without effect\n" +
" null potential missing or redundant null check\n" +
- " nullAnnot(<annot. names separated by |>) + annotation based null analysis,\n" +
- " nullable|nonnull|nonnullbydefault annotation types\n" +
- " optionally specified using fully qualified names\n" +
+ " nullAnnot(<annot. names separated by |>) annotation based null analysis,\n" +
+ " nullable|nonnull|nonnullbydefault annotation types\n" +
+ " optionally specified using fully qualified names.\n" +
+ " Enabling this option enables all null-annotation\n" +
+ " related sub-options. These can be individually\n" +
+ " controlled using options listed below.\n" +
+ " nullAnnotConflict conflict between null annotation specified\n" +
+ " and nullness inferred. Is effective only with\n" +
+ " nullAnnot option enabled.\n" +
+ " nullAnnotRedundant redundant specification of null annotation. Is\n" +
+ " effective only with nullAnnot option enabled.\n" +
" nullDereference + missing null check\n" +
+ " nullUncheckedConversion unchecked conversion from non-annotated type\n" +
+ " to @NonNull type. Is effective only with\n" +
+ " nullAnnot option enabled.\n" +
" over-ann missing @Override annotation (superclass)\n" +
" paramAssign assignment to a parameter\n" +
" pkgDefaultMethod + attempt to override package-default method\n" +
@@ -1763,7 +1791,7 @@ public void test012b(){
" super overriding a method without making a super invocation\n" +
" suppress + enable @SuppressWarnings\n" +
" When used with -err:, it can also silent optional\n" +
- " errors and warnings\n" +
+ " errors and warnings\n" +
" switchDefault + switch statement lacking a default case\n" +
" syncOverride missing synchronized in synchr. method override\n" +
" syntheticAccess synthetic access for innerclass\n" +
@@ -1782,12 +1810,22 @@ public void test012b(){
" unusedImport + unused import declaration\n" +
" unusedLabel + unused label\n" +
" unusedLocal + unread local variable\n" +
+ " unusedParam unused parameter\n" +
+ " unusedParamOverriding unused parameter for overriding method\n" +
+ " unusedParamImplementing unused parameter for implementing method\n" +
+ " unusedParamIncludeDoc unused parameter documented in comment tag\n" +
" unusedPrivate + unused private member declaration\n" +
" unusedThrown unused declared thrown exception\n" +
+ " unusedThrownWhenOverriding unused declared thrown exception in \n" +
+ " overriding method\n" +
+ " unusedThrownIncludeDocComment unused declared thrown exception,\n" +
+ " documented in a comment tag\n" +
+ " unusedThrownExemptExceptionThrowable unused declared thrown exception,\n" +
+ " exempt Exception and Throwable\n" +
" unusedTypeArgs + unused type arguments for method and constructor\n" +
" uselessTypeCheck unnecessary cast/instanceof operation\n" +
" varargsCast + varargs argument need explicit cast\n" +
- " warningToken + unsupported or unnecessary @SuppressWarnings\n" +
+ " warningToken + unsupported or unnecessary @SuppressWarnings\n" +
"\n";
String expandedExpectedOutput =
MessageFormat.format(expectedOutput, new String[] {
@@ -13183,4 +13221,255 @@ public void test329_nowarn_options() {
"1 problem (1 warning)",
true);
}
+
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=375409
+public void testBug375409a() {
+ this.runConformTest(
+ new String[] {
+ "p/X.java",
+ "package p;\n" +
+ "public class X {\n" +
+ "/** \n" +
+ "* Description {@see String}, {@category cat}\n" +
+ "* @param a\n" +
+ "*/\n" +
+ "public void foo(int i) {}}\n"
+ },
+ "\"" + OUTPUT_DIR + File.separator + "p" + File.separator + "X.java\""
+ + " -sourcepath \"" + OUTPUT_DIR + "\""
+ + " -1.5"
+ + " -warn:invalidJavadoc -proc:none -d \"" + OUTPUT_DIR + "\"",
+ "",
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/X.java (at line 4)\n" +
+ " * Description {@see String}, {@category cat}\n" +
+ " ^^^\n" +
+ "Javadoc: Unexpected tag\n" +
+ "----------\n" +
+ "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/X.java (at line 4)\n" +
+ " * Description {@see String}, {@category cat}\n" +
+ " ^^^^^^^^\n" +
+ "Javadoc: Unexpected tag\n" +
+ "----------\n" +
+ "3. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/X.java (at line 5)\n" +
+ " * @param a\n" +
+ " ^\n" +
+ "Javadoc: Parameter a is not declared\n" +
+ "----------\n" +
+ "3 problems (3 warnings)",
+ true);
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=375409
+public void testBug375409b() {
+ this.runConformTest(
+ new String[] {
+ "p/X.java",
+ "package p;\n" +
+ "public class X {\n" +
+ "/** \n" +
+ "* Description {@see String}, {@category cat}\n" +
+ "* @param a\n" +
+ "*/\n" +
+ "public void foo(int i) {}}\n"
+ },
+ "\"" + OUTPUT_DIR + File.separator + "p" + File.separator + "X.java\""
+ + " -sourcepath \"" + OUTPUT_DIR + "\""
+ + " -1.5"
+ + " -warn:missingJavadocTags,missingJavadocTagsVisibility(public) -proc:none -d \"" + OUTPUT_DIR + "\"",
+ "",
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/X.java (at line 7)\n" +
+ " public void foo(int i) {}}\n" +
+ " ^\n" +
+ "Javadoc: Missing tag for parameter i\n" +
+ "----------\n" +
+ "1 problem (1 warning)",
+ true);
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=375409
+public void testBug375409c() {
+ this.runConformTest(
+ new String[] {
+ "p/X.java",
+ "package p;\n" +
+ "public class X {\n" +
+ "/** \n" +
+ "* Description {@see String}, {@category cat}\n" +
+ "* @param a\n" +
+ "*/\n" +
+ "public void foo(int i) {}}\n"
+ },
+ "\"" + OUTPUT_DIR + File.separator + "p" + File.separator + "X.java\""
+ + " -sourcepath \"" + OUTPUT_DIR + "\""
+ + " -1.5"
+ + " -warn:missingJavadocComments -proc:none -d \"" + OUTPUT_DIR + "\"",
+ "",
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/X.java (at line 2)\n" +
+ " public class X {\n" +
+ " ^\n" +
+ "Javadoc: Missing comment for public declaration\n" +
+ "----------\n" +
+ "1 problem (1 warning)",
+ true);
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=375409
+public void testBug375409d() {
+ this.runConformTest(
+ new String[] {
+ "p/X.java",
+ "package p;\n" +
+ "public class X {\n" +
+ "/** \n" +
+ "* Description {@see String}, {@category cat}\n" +
+ "* @param a\n" +
+ "*/\n" +
+ "void foo(int i) {}\n" +
+ "/** \n" +
+ "* Description {@see String}, {@category cat}\n" +
+ "* @param a\n" +
+ "*/\n" +
+ "public void foo2(int i2) {}}\n"
+ },
+ "\"" + OUTPUT_DIR + File.separator + "p" + File.separator + "X.java\""
+ + " -sourcepath \"" + OUTPUT_DIR + "\""
+ + " -1.5"
+ + " -warn:missingJavadocTags,missingJavadocTagsVisibility(public) -proc:none -d \"" + OUTPUT_DIR + "\"",
+ "",
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/X.java (at line 12)\n" +
+ " public void foo2(int i2) {}}\n" +
+ " ^^\n" +
+ "Javadoc: Missing tag for parameter i2\n" +
+ "----------\n" +
+ "1 problem (1 warning)",
+ true);
+}
+
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=375409
+// -warn option - regression tests to check option nullAnnotConflict
+public void testBug375409e() {
+ this.runConformTest(
+ new String[] {
+ "p/X.java",
+ "package p;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.*;\n" +
+ "public class X {\n" +
+ " @NonNull Object foo(@Nullable Object o, @NonNull Object o2) {\n" +
+ " return new X().bar();\n" +
+ " }\n" +
+ " @Nullable Object bar() {\n" +
+ " return null;\n" +
+ " }\n" +
+ "}\n" +
+ "@Documented\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@Target({ METHOD, PARAMETER })\n" +
+ "@interface NonNull{\n" +
+ "}\n" +
+ "@Documented\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@Target({ METHOD, PARAMETER })\n" +
+ "@interface Nullable{\n" +
+ "}\n" +
+ "@Documented\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@Target({ PACKAGE, TYPE, METHOD, CONSTRUCTOR })\n" +
+ "@interface NonNullByDefault{\n" +
+ "}"
+ },
+ "\"" + OUTPUT_DIR + File.separator + "p" + File.separator + "X.java\""
+ + " -1.5"
+ + " -warn:+nullAnnot(p.Nullable|p.NonNull|p.NonNullByDefault),+null,-nullAnnotConflict "
+ + "-proc:none -d \"" + OUTPUT_DIR + "\"",
+ "",
+ "",
+ true);
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=375409
+// -warn option - regression tests to check option nullAnnotRedundant
+public void testBug375409f() {
+ this.runConformTest(
+ new String[] {
+ "p/X.java",
+ "package p;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.*;\n" +
+ "@NonNullByDefault public class X {\n" +
+ " @NonNull Object foo() {\n" +
+ " return null;\n" +
+ " }\n" +
+ "}\n" +
+ "@Documented\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@Target({ METHOD, PARAMETER })\n" +
+ "@interface NonNull{\n" +
+ "}\n" +
+ "@Documented\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@Target({ METHOD, PARAMETER })\n" +
+ "@interface Nullable{\n" +
+ "}\n" +
+ "@Documented\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@Target({ PACKAGE, TYPE, METHOD, CONSTRUCTOR })\n" +
+ "@interface NonNullByDefault{\n" +
+ "}"
+ },
+ "\"" + OUTPUT_DIR + File.separator + "p" + File.separator + "X.java\""
+ + " -1.5"
+ + " -warn:+nullAnnot(p.Nullable|p.NonNull|p.NonNullByDefault),+null,-nullAnnotRedundant "
+ + "-proc:none -d \"" + OUTPUT_DIR + "\"",
+ "",
+ "----------\n" +
+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/X.java (at line 6)\n" +
+ " return null;\n" +
+ " ^^^^\n" +
+ "Null type mismatch: required \'@NonNull Object\' but the provided value is null\n" +
+ "----------\n" +
+ "1 problem (1 warning)",
+ true);
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=375409
+// -warn option - regression tests to check option nullUncheckedConversion
+public void testBug375409g() {
+ this.runConformTest(
+ new String[] {
+ "p/X.java",
+ "package p;\n" +
+ "import static java.lang.annotation.ElementType.*;\n" +
+ "import java.lang.annotation.*;\n" +
+ "public class X {\n" +
+ " @NonNull Object foo(@Nullable Object o, @NonNull Object o2) {\n" +
+ " return new X().bar();\n" +
+ " }\n" +
+ " Object bar() {\n" +
+ " return null;\n" +
+ " }\n" +
+ "}\n" +
+ "@Documented\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@Target({ METHOD, PARAMETER })\n" +
+ "@interface NonNull{\n" +
+ "}\n" +
+ "@Documented\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@Target({ METHOD, PARAMETER })\n" +
+ "@interface Nullable{\n" +
+ "}\n" +
+ "@Documented\n" +
+ "@Retention(RetentionPolicy.CLASS)\n" +
+ "@Target({ PACKAGE, TYPE, METHOD, CONSTRUCTOR })\n" +
+ "@interface NonNullByDefault{\n" +
+ "}"
+ },
+ "\"" + OUTPUT_DIR + File.separator + "p" + File.separator + "X.java\""
+ + " -1.5"
+ + " -warn:+nullAnnot(p.Nullable|p.NonNull|p.NonNullByDefault) -warn:+null -warn:-nullUncheckedConversion "
+ + "-proc:none -d \"" + OUTPUT_DIR + "\"",
+ "",
+ "",
+ true);
+}
}
diff --git a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java
index 39190cd..d8c2a1c 100644
--- a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java
+++ b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java
@@ -3467,7 +3467,60 @@ private void handleErrorOrWarningToken(String token, boolean isEnabling, int sev
CompilerOptions.OPTION_IncludeNullInfoFromAsserts,
isEnabling ? CompilerOptions.ENABLED : CompilerOptions.DISABLED);
return;
- }
+ } else if (token.equals("invalidJavadoc")) { //$NON-NLS-1$
+ setSeverity(CompilerOptions.OPTION_ReportInvalidJavadoc, severity, isEnabling);
+ this.options.put(
+ CompilerOptions.OPTION_ReportInvalidJavadocTags,
+ isEnabling ? CompilerOptions.ENABLED : CompilerOptions.DISABLED);
+ this.options.put(
+ CompilerOptions.OPTION_ReportInvalidJavadocTagsDeprecatedRef,
+ isEnabling ? CompilerOptions.ENABLED : CompilerOptions.DISABLED);
+ this.options.put(
+ CompilerOptions.OPTION_ReportInvalidJavadocTagsNotVisibleRef,
+ isEnabling ? CompilerOptions.ENABLED : CompilerOptions.DISABLED);
+ if (isEnabling) {
+ this.options.put(
+ CompilerOptions.OPTION_DocCommentSupport,
+ CompilerOptions.ENABLED);
+ this.options.put(
+ CompilerOptions.OPTION_ReportInvalidJavadocTagsVisibility,
+ CompilerOptions.PRIVATE);
+ }
+ return;
+ } else if (token.equals("invalidJavadocTag")) { //$NON-NLS-1$
+ this.options.put(
+ CompilerOptions.OPTION_ReportInvalidJavadocTags,
+ isEnabling ? CompilerOptions.ENABLED : CompilerOptions.DISABLED);
+ return;
+ } else if (token.equals("invalidJavadocTagDep")) { //$NON-NLS-1$
+ this.options.put(
+ CompilerOptions.OPTION_ReportInvalidJavadocTagsDeprecatedRef,
+ isEnabling ? CompilerOptions.ENABLED : CompilerOptions.DISABLED);
+ return;
+ } else if (token.equals("invalidJavadocTagNotVisible")) { //$NON-NLS-1$
+ this.options.put(
+ CompilerOptions.OPTION_ReportInvalidJavadocTagsNotVisibleRef,
+ isEnabling ? CompilerOptions.ENABLED : CompilerOptions.DISABLED);
+ return;
+ } else if (token.startsWith("invalidJavadocTagVisibility")) { //$NON-NLS-1$
+ int start = token.indexOf('(');
+ int end = token.indexOf(')');
+ String visibility = null;
+ if (isEnabling && start >= 0 && end >= 0 && start < end){
+ visibility = token.substring(start+1, end).trim();
+ }
+ if (visibility != null && visibility.equals(CompilerOptions.PUBLIC)
+ || visibility.equals(CompilerOptions.PRIVATE)
+ || visibility.equals(CompilerOptions.PROTECTED)
+ || visibility.equals(CompilerOptions.DEFAULT)) {
+ this.options.put(
+ CompilerOptions.OPTION_ReportInvalidJavadocTagsVisibility,
+ visibility);
+ return;
+ } else {
+ throw new IllegalArgumentException(this.bind("configure.invalidJavadocTagVisibility", token)); //$NON-NLS-1$
+ }
+ }
break;
case 'j' :
if (token.equals("javadoc")) {//$NON-NLS-1$
@@ -3487,6 +3540,89 @@ private void handleErrorOrWarningToken(String token, boolean isEnabling, int sev
if (token.equals("maskedCatchBlock") || token.equals("maskedCatchBlocks")/*backward compatible*/) { //$NON-NLS-1$ //$NON-NLS-2$
setSeverity(CompilerOptions.OPTION_ReportHiddenCatchBlock, severity, isEnabling);
return;
+ } else if (token.equals("missingJavadocTags")) { //$NON-NLS-1$
+ setSeverity(CompilerOptions.OPTION_ReportMissingJavadocTags, severity, isEnabling);
+ this.options.put(
+ CompilerOptions.OPTION_ReportMissingJavadocTagsOverriding,
+ isEnabling ? CompilerOptions.ENABLED : CompilerOptions.DISABLED);
+ this.options.put(
+ CompilerOptions.OPTION_ReportMissingJavadocTagsMethodTypeParameters,
+ isEnabling ? CompilerOptions.ENABLED : CompilerOptions.DISABLED);
+ if (isEnabling) {
+ this.options.put(
+ CompilerOptions.OPTION_DocCommentSupport,
+ CompilerOptions.ENABLED);
+ this.options.put(
+ CompilerOptions.OPTION_ReportMissingJavadocTagsVisibility,
+ CompilerOptions.PRIVATE);
+ }
+ return;
+ } else if (token.equals("missingJavadocTagsOverriding")) { //$NON-NLS-1$
+ this.options.put(
+ CompilerOptions.OPTION_ReportMissingJavadocTagsOverriding,
+ isEnabling ? CompilerOptions.ENABLED : CompilerOptions.DISABLED);
+ return;
+ } else if (token.equals("missingJavadocTagsMethod")) { //$NON-NLS-1$
+ this.options.put(
+ CompilerOptions.OPTION_ReportMissingJavadocTagsMethodTypeParameters,
+ isEnabling ? CompilerOptions.ENABLED : CompilerOptions.DISABLED);
+ return;
+ } else if (token.startsWith("missingJavadocTagsVisibility")) { //$NON-NLS-1$
+ int start = token.indexOf('(');
+ int end = token.indexOf(')');
+ String visibility = null;
+ if (isEnabling && start >= 0 && end >= 0 && start < end){
+ visibility = token.substring(start+1, end).trim();
+ }
+ if (visibility != null && visibility.equals(CompilerOptions.PUBLIC)
+ || visibility.equals(CompilerOptions.PRIVATE)
+ || visibility.equals(CompilerOptions.PROTECTED)
+ || visibility.equals(CompilerOptions.DEFAULT)) {
+ this.options.put(
+ CompilerOptions.OPTION_ReportMissingJavadocTagsVisibility,
+ visibility);
+ return;
+ } else {
+ throw new IllegalArgumentException(this.bind("configure.missingJavadocTagsVisibility", token)); //$NON-NLS-1$
+ }
+ } else if (token.equals("missingJavadocComments")) { //$NON-NLS-1$
+ setSeverity(CompilerOptions.OPTION_ReportMissingJavadocComments, severity, isEnabling);
+ this.options.put(
+ CompilerOptions.OPTION_ReportMissingJavadocCommentsOverriding,
+ isEnabling ? CompilerOptions.ENABLED : CompilerOptions.DISABLED);
+ if (isEnabling) {
+ this.options.put(
+ CompilerOptions.OPTION_DocCommentSupport,
+ CompilerOptions.ENABLED);
+ this.options.put(
+ CompilerOptions.OPTION_ReportMissingJavadocCommentsVisibility,
+ CompilerOptions.PRIVATE);
+ }
+ return;
+ } else if (token.equals("missingJavadocCommentsOverriding")) { //$NON-NLS-1$
+ setSeverity(CompilerOptions.OPTION_ReportMissingJavadocComments, severity, isEnabling);
+ this.options.put(
+ CompilerOptions.OPTION_ReportMissingJavadocCommentsOverriding,
+ isEnabling ? CompilerOptions.ENABLED : CompilerOptions.DISABLED);
+ return;
+ } else if (token.startsWith("missingJavadocCommentsVisibility")) { //$NON-NLS-1$
+ int start = token.indexOf('(');
+ int end = token.indexOf(')');
+ String visibility = null;
+ if (isEnabling && start >= 0 && end >= 0 && start < end){
+ visibility = token.substring(start+1, end).trim();
+ }
+ if (visibility != null && visibility.equals(CompilerOptions.PUBLIC)
+ || visibility.equals(CompilerOptions.PRIVATE)
+ || visibility.equals(CompilerOptions.PROTECTED)
+ || visibility.equals(CompilerOptions.DEFAULT)) {
+ this.options.put(
+ CompilerOptions.OPTION_ReportMissingJavadocCommentsVisibility,
+ visibility);
+ return;
+ } else {
+ throw new IllegalArgumentException(this.bind("configure.missingJavadocCommentsVisibility", token)); //$NON-NLS-1$
+ }
}
break;
case 'n' :
@@ -3511,6 +3647,12 @@ private void handleErrorOrWarningToken(String token, boolean isEnabling, int sev
setSeverity(CompilerOptions.OPTION_ReportRedundantNullCheck, ProblemSeverities.Ignore, isEnabling);
}
return;
+ }else if (token.equals("nullAnnotConflict")) { //$NON-NLS-1$
+ setSeverity(CompilerOptions.OPTION_ReportNullAnnotationInferenceConflict, severity, isEnabling);
+ return;
+ } else if (token.equals("nullAnnotRedundant")) { //$NON-NLS-1$
+ setSeverity(CompilerOptions.OPTION_ReportRedundantNullAnnotation, severity, isEnabling);
+ return;
} else if (token.startsWith("nullAnnot")) { //$NON-NLS-1$
String annotationNames = Util.EMPTY_STRING;
int start = token.indexOf('(');
@@ -3540,6 +3682,9 @@ private void handleErrorOrWarningToken(String token, boolean isEnabling, int sev
setSeverity(CompilerOptions.OPTION_ReportNullUncheckedConversion, severity, isEnabling);
setSeverity(CompilerOptions.OPTION_ReportRedundantNullAnnotation, severity, isEnabling);
return;
+ } else if (token.equals("nullUncheckedConversion")) { //$NON-NLS-1$
+ setSeverity(CompilerOptions.OPTION_ReportNullUncheckedConversion, severity, isEnabling);
+ return;
}
break;
@@ -3687,6 +3832,21 @@ private void handleErrorOrWarningToken(String token, boolean isEnabling, int sev
} else if (token.equals("unusedThrown")) { //$NON-NLS-1$
setSeverity(CompilerOptions.OPTION_ReportUnusedDeclaredThrownException, severity, isEnabling);
return;
+ } else if (token.equals("unusedThrownWhenOverriding")) { //$NON-NLS-1$
+ this.options.put(
+ CompilerOptions.OPTION_ReportUnusedDeclaredThrownExceptionWhenOverriding,
+ isEnabling ? CompilerOptions.ENABLED : CompilerOptions.DISABLED);
+ return;
+ } else if (token.equals("unusedThrownIncludeDocComment")) { //$NON-NLS-1$
+ this.options.put(
+ CompilerOptions.OPTION_ReportUnusedDeclaredThrownExceptionIncludeDocCommentReference,
+ isEnabling ? CompilerOptions.ENABLED : CompilerOptions.DISABLED);
+ return;
+ } else if (token.equals("unusedThrownExemptExceptionThrowable")) { //$NON-NLS-1$
+ this.options.put(
+ CompilerOptions.OPTION_ReportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable,
+ isEnabling ? CompilerOptions.ENABLED : CompilerOptions.DISABLED);
+ return;
} else if (token.equals("unqualifiedField") || token.equals("unqualified-field-access")) { //$NON-NLS-1$ //$NON-NLS-2$
setSeverity(CompilerOptions.OPTION_ReportUnqualifiedFieldAccess, severity, isEnabling);
return;
@@ -3700,7 +3860,25 @@ private void handleErrorOrWarningToken(String token, boolean isEnabling, int sev
setSeverity(CompilerOptions.OPTION_ReportUnusedTypeArgumentsForMethodInvocation, severity, isEnabling);
setSeverity(CompilerOptions.OPTION_ReportRedundantSpecificationOfTypeArguments, severity, isEnabling);
return;
- } else if (token.equals("unusedTypeArgs")) { //$NON-NLS-1$
+ } else if (token.equals("unusedParam")) { //$NON-NLS-1$
+ setSeverity(CompilerOptions.OPTION_ReportUnusedParameter, severity, isEnabling);
+ return;
+ } else if (token.equals("unusedParamIncludeDoc")) { //$NON-NLS-1$
+ this.options.put(
+ CompilerOptions.OPTION_ReportUnusedParameterIncludeDocCommentReference,
+ isEnabling ? CompilerOptions.ENABLED : CompilerOptions.DISABLED);
+ return;
+ } else if (token.equals("unusedParamOverriding")) { //$NON-NLS-1$
+ this.options.put(
+ CompilerOptions.OPTION_ReportUnusedParameterWhenOverridingConcrete,
+ isEnabling ? CompilerOptions.ENABLED : CompilerOptions.DISABLED);
+ return;
+ } else if (token.equals("unusedParamImplementing")) { //$NON-NLS-1$
+ this.options.put(
+ CompilerOptions.OPTION_ReportUnusedParameterWhenImplementingAbstract,
+ isEnabling ? CompilerOptions.ENABLED : CompilerOptions.DISABLED);
+ return;
+ } else if (token.equals("unusedTypeArgs")) { //$NON-NLS-1$
setSeverity(CompilerOptions.OPTION_ReportUnusedTypeArgumentsForMethodInvocation, severity, isEnabling);
setSeverity(CompilerOptions.OPTION_ReportRedundantSpecificationOfTypeArguments, severity, isEnabling);
return;
diff --git a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/messages.properties b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/messages.properties
index 69ba27b..42c498d 100644
--- a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/messages.properties
+++ b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/messages.properties
@@ -317,16 +317,44 @@ misc.usage.warn = {1} {2}\n\
\ intfAnnotation + annotation type used as super interface\n\
\ intfNonInherited + interface non-inherited method compatibility\n\
\ intfRedundant find redundant superinterfaces\n\
+\ invalidJavadoc all warnings for malformed javadoc tags\n\
+\ invalidJavadocTag validate javadoc tag arguments\n\
+\ invalidJavadocTagDep validate deprecated references in javadoc tag args\n\
+\ invalidJavadocTagNotVisible validate non-visible references in javadoc\n\
+\ tag args\n\
+\ invalidJavadocVisibility(<visibility>) specify visibility modifier\n\
+\ for malformed javadoc tag warnings\n\
\ javadoc invalid javadoc\n\
\ localHiding local variable hiding another variable\n\
\ maskedCatchBlock + hidden catch block\n\
+\ missingJavadocTags missing Javadoc tags\n\
+\ missingJavadocTagsOverriding missing Javadoc tags in overriding methods\n\
+\ missingJavadocTagsMethod missing Javadoc tags for method type parameter\n\
+\ missingJavadocTagsVisibility(<visibility>) specify visibility modifier\n\
+\ for missing javadoc tags warnings\n\
+\ missingJavadocComments missing Javadoc comments\n\
+\ missingJavadocCommentsOverriding missing Javadoc tags in overriding\n\
+\ methods\n\
+\ missingJavadocCommentsVisibility(<visibility>) specify visibility\n\
+\ modifier for missing javadoc comments warnings\n\
\ nls string literal lacking non-nls tag //$NON-NLS-<n>$\n\
\ noEffectAssign + assignment without effect\n\
\ null potential missing or redundant null check\n\
-\ nullAnnot(<annot. names separated by |>) + annotation based null analysis,\n\
+\ nullAnnot(<annot. names separated by |>) annotation based null analysis,\n\
\ nullable|nonnull|nonnullbydefault annotation types\n\
-\ optionally specified using fully qualified names\n\
+\ optionally specified using fully qualified names.\n\
+\ Enabling this option enables all null-annotation\n\
+\ related sub-options. These can be individually\n\
+\ controlled using options listed below.\n\
+\ nullAnnotConflict conflict between null annotation specified\n\
+\ and nullness inferred. Is effective only with\n\
+\ nullAnnot option enabled.\n\
+\ nullAnnotRedundant redundant specification of null annotation. Is\n\
+\ effective only with nullAnnot option enabled.\n\
\ nullDereference + missing null check\n\
+\ nullUncheckedConversion unchecked conversion from non-annotated type\n\
+\ to @NonNull type. Is effective only with\n\
+\ nullAnnot option enabled.\n\
\ over-ann missing @Override annotation (superclass)\n\
\ paramAssign assignment to a parameter\n\
\ pkgDefaultMethod + attempt to override package-default method\n\
@@ -360,8 +388,18 @@ misc.usage.warn = {1} {2}\n\
\ unusedImport + unused import declaration\n\
\ unusedLabel + unused label\n\
\ unusedLocal + unread local variable\n\
+\ unusedParam unused parameter\n\
+\ unusedParamOverriding unused parameter for overriding method\n\
+\ unusedParamImplementing unused parameter for implementing method\n\
+\ unusedParamIncludeDoc unused parameter documented in comment tag\n\
\ unusedPrivate + unused private member declaration\n\
\ unusedThrown unused declared thrown exception\n\
+\ unusedThrownWhenOverriding unused declared thrown exception in \n\
+\ overriding method\n\
+\ unusedThrownIncludeDocComment unused declared thrown exception,\n\
+\ documented in a comment tag\n\
+\ unusedThrownExemptExceptionThrowable unused declared thrown exception,\n\
+\ exempt Exception and Throwable\n\
\ unusedTypeArgs + unused type arguments for method and constructor\n\
\ uselessTypeCheck unnecessary cast/instanceof operation\n\
\ varargsCast + varargs argument need explicit cast\n\