### Eclipse Workspace Patch 1.0
#P org.eclipse.jdt.core.tests.compiler
Index: src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestOptions.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestOptions.java,v
retrieving revision 1.13
diff -u -r1.13 JavadocTestOptions.java
--- src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestOptions.java 29 Mar 2006 03:50:22 -0000 1.13
+++ src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestOptions.java 23 Jun 2006 07:47:49 -0000
@@ -44,8 +44,8 @@
private final int DEFAULT_VISIBILITY = 2;
private final int PRIVATE_VISIBILITY = 3;
- private static String JavadocWithInvalidReferences = " /**\n" +
- " * @see X.X_dep\n" +
+ private static String INVALID_CLASS_JAVADOC_REF = " /**\n" +
+ " * @see X_dep\n" +
" * @see X.X_priv\n" +
" * @see X.Unknown\n" +
" * @see X#X(int)\n" +
@@ -59,7 +59,7 @@
" * @see X#foo_dep(String)\n" +
" * @see X#unknown()\n" +
" */\n";
- private static String JavadocWithInvalidReferencesForMethod = " /**\n" +
+ private static String INVALID_METHOD_JAVADOC_REF = " /**\n" +
" * @param str\n" +
" * @param str\n" +
" * @param xxx\n" +
@@ -67,7 +67,7 @@
" * @throws IllegalArgumentException\n" +
" * @throws java.io.IOException\n" +
" * @throws Unknown\n" +
- " * @see X.X_dep\n" +
+ " * @see X_dep\n" +
" * @see X.X_priv\n" +
" * @see X.Unknown\n" +
" * @see X#X(int)\n" +
@@ -81,10 +81,14 @@
" * @see X#foo_dep(String)\n" +
" * @see X#unknown()\n" +
" */\n";
- private static String refClassForInvalidJavadoc =
+ private static String DEP_CLASS =
+ "/** @deprecated */\n" +
+ "public class X_dep {}\n";
+ private static String REF_CLASS =
"public class X {\n" +
- " /** @deprecated */\n" +
- " class X_dep{}\n" +
+// Deprecated class must be a top level to avoid visibility issue
+// " /** @deprecated */\n" +
+// " class X_dep{}\n" +
" private class X_priv{}\n" +
" /** @deprecated */\n" +
" int x_dep;\n" +
@@ -96,71 +100,79 @@
" void foo_dep() {}\n" +
" private void foo_priv() {}\n" +
" }\n";
- private static String[] InvalidReferencesClassJavadocComments = {
+ private static String[] CLASSES_INVALID_COMMENT = {
"X.java",
- refClassForInvalidJavadoc,
+ REF_CLASS,
+ "X_dep.java",
+ DEP_CLASS,
"Y.java",
"public class Y {\n" +
- JavadocWithInvalidReferences +
+ INVALID_CLASS_JAVADOC_REF +
" public class X_pub {}\n" +
- JavadocWithInvalidReferences +
+ INVALID_CLASS_JAVADOC_REF +
" protected class X_prot {}\n" +
- JavadocWithInvalidReferences +
+ INVALID_CLASS_JAVADOC_REF +
" class X_pack {}\n" +
- JavadocWithInvalidReferences +
+ INVALID_CLASS_JAVADOC_REF +
" private class X_priv {}\n" +
"}\n" +
"\n"
};
- private static String[] InvalidReferencesFieldJavadocComments = {
+ private static String[] FIELDS_INVALID_COMMENT = {
"X.java",
- refClassForInvalidJavadoc,
+ REF_CLASS,
+ "X_dep.java",
+ DEP_CLASS,
"Y.java",
"public class Y {\n" +
- JavadocWithInvalidReferences +
+ INVALID_CLASS_JAVADOC_REF +
" public int x_pub;\n" +
- JavadocWithInvalidReferences +
+ INVALID_CLASS_JAVADOC_REF +
" protected int x_prot;\n" +
- JavadocWithInvalidReferences +
+ INVALID_CLASS_JAVADOC_REF +
" int x_pack;\n" +
- JavadocWithInvalidReferences+
+ INVALID_CLASS_JAVADOC_REF+
" private int x_priv;\n" +
"}\n" +
"\n"
};
- private static String[] InvalidReferencesMethodJavadocComments = {
+ private static String[] METHODS_INVALID_COMMENT = {
"X.java",
- refClassForInvalidJavadoc,
+ REF_CLASS,
+ "X_dep.java",
+ DEP_CLASS,
"Y.java",
"public class Y {\n" +
- JavadocWithInvalidReferencesForMethod +
+ INVALID_METHOD_JAVADOC_REF +
" public void foo_pub(String str) throws IllegalArgumentException {}\n" +
- JavadocWithInvalidReferencesForMethod +
+ INVALID_METHOD_JAVADOC_REF +
" protected void foo_pro(String str) throws IllegalArgumentException {}\n" +
- JavadocWithInvalidReferencesForMethod +
+ INVALID_METHOD_JAVADOC_REF +
" void foo_pack(String str) throws IllegalArgumentException {}\n" +
- JavadocWithInvalidReferencesForMethod +
+ INVALID_METHOD_JAVADOC_REF +
" private void foo_priv(String str) throws IllegalArgumentException {}\n" +
"}\n" +
"\n"
};
- private static String[] InvalidReferencesConstructorJavadocComments = {
+ private static String[] CONSTRUCTORS_INVALID_COMMENT = {
"X.java",
- refClassForInvalidJavadoc,
+ REF_CLASS,
+ "X_dep.java",
+ DEP_CLASS,
"Y.java",
"public class Y {\n" +
- JavadocWithInvalidReferencesForMethod +
+ INVALID_METHOD_JAVADOC_REF +
" public Y(int str) {}\n" +
- JavadocWithInvalidReferencesForMethod +
+ INVALID_METHOD_JAVADOC_REF +
" protected Y(long str) {}\n" +
- JavadocWithInvalidReferencesForMethod +
+ INVALID_METHOD_JAVADOC_REF +
" Y(float str) {}\n" +
- JavadocWithInvalidReferencesForMethod +
+ INVALID_METHOD_JAVADOC_REF +
" private Y(double str) {}\n" +
"}\n" +
"\n"
};
- private static String[] MissingTags = {
+ private static String[] MISSING_TAGS = {
"X.java",
"public class X {\n" +
" // public\n" +
@@ -216,7 +228,7 @@
" private int privateMethod(long l) { return 0;}\n" +
"}\n"
};
- private static String[] MissingComments = {
+ private static String[] MISSING_COMMENTS = {
"X.java",
"/** */\n" +
"public class X {\n" +
@@ -254,11 +266,11 @@
"}\n"
};
- private static String[] resultForInvalidTagsClassOrField = {
+ private static String[] CLASSES_ERRORS = {
"1. ERROR in Y.java (at line 3)\n" +
- " * @see X.X_dep\n" +
- " ^^^^^^^\n" +
- "Javadoc: The type X.X_dep is deprecated\n" +
+ " * @see X_dep\n" +
+ " ^^^^^\n" +
+ "Javadoc: The type X_dep is deprecated\n" +
"----------\n" +
"2. ERROR in Y.java (at line 4)\n" +
" * @see X.X_priv\n" +
@@ -321,9 +333,9 @@
"Javadoc: The method unknown() is undefined for the type X\n" +
"----------\n",
"14. ERROR in Y.java (at line 19)\n" +
- " * @see X.X_dep\n" +
- " ^^^^^^^\n" +
- "Javadoc: The type X.X_dep is deprecated\n" +
+ " * @see X_dep\n" +
+ " ^^^^^\n" +
+ "Javadoc: The type X_dep is deprecated\n" +
"----------\n" +
"15. ERROR in Y.java (at line 20)\n" +
" * @see X.X_priv\n" +
@@ -386,9 +398,9 @@
"Javadoc: The method unknown() is undefined for the type X\n" +
"----------\n",
"27. ERROR in Y.java (at line 35)\n" +
- " * @see X.X_dep\n" +
- " ^^^^^^^\n" +
- "Javadoc: The type X.X_dep is deprecated\n" +
+ " * @see X_dep\n" +
+ " ^^^^^\n" +
+ "Javadoc: The type X_dep is deprecated\n" +
"----------\n" +
"28. ERROR in Y.java (at line 36)\n" +
" * @see X.X_priv\n" +
@@ -451,9 +463,9 @@
"Javadoc: The method unknown() is undefined for the type X\n" +
"----------\n",
"40. ERROR in Y.java (at line 51)\n" +
- " * @see X.X_dep\n" +
- " ^^^^^^^\n" +
- "Javadoc: The type X.X_dep is deprecated\n" +
+ " * @see X_dep\n" +
+ " ^^^^^\n" +
+ "Javadoc: The type X_dep is deprecated\n" +
"----------\n" +
"41. ERROR in Y.java (at line 52)\n" +
" * @see X.X_priv\n" +
@@ -517,7 +529,7 @@
"----------\n"
};
- private static String[] resultForInvalidTagsMethodOrConstructor = {
+ private static String[] METHODS_ERRORS = {
"1. ERROR in Y.java (at line 4)\n" +
" * @param str\n" +
" ^^^\n" +
@@ -539,9 +551,9 @@
"Javadoc: Unknown cannot be resolved to a type\n" +
"----------\n" +
"5. ERROR in Y.java (at line 10)\n" +
- " * @see X.X_dep\n" +
- " ^^^^^^^\n" +
- "Javadoc: The type X.X_dep is deprecated\n" +
+ " * @see X_dep\n" +
+ " ^^^^^\n" +
+ "Javadoc: The type X_dep is deprecated\n" +
"----------\n" +
"6. ERROR in Y.java (at line 11)\n" +
" * @see X.X_priv\n" +
@@ -624,9 +636,9 @@
"Javadoc: Unknown cannot be resolved to a type\n" +
"----------\n" +
"22. ERROR in Y.java (at line 33)\n" +
- " * @see X.X_dep\n" +
- " ^^^^^^^\n" +
- "Javadoc: The type X.X_dep is deprecated\n" +
+ " * @see X_dep\n" +
+ " ^^^^^\n" +
+ "Javadoc: The type X_dep is deprecated\n" +
"----------\n" +
"23. ERROR in Y.java (at line 34)\n" +
" * @see X.X_priv\n" +
@@ -709,9 +721,9 @@
"Javadoc: Unknown cannot be resolved to a type\n" +
"----------\n" +
"39. ERROR in Y.java (at line 56)\n" +
- " * @see X.X_dep\n" +
- " ^^^^^^^\n" +
- "Javadoc: The type X.X_dep is deprecated\n" +
+ " * @see X_dep\n" +
+ " ^^^^^\n" +
+ "Javadoc: The type X_dep is deprecated\n" +
"----------\n" +
"40. ERROR in Y.java (at line 57)\n" +
" * @see X.X_priv\n" +
@@ -794,9 +806,9 @@
"Javadoc: Unknown cannot be resolved to a type\n" +
"----------\n" +
"56. ERROR in Y.java (at line 79)\n" +
- " * @see X.X_dep\n" +
- " ^^^^^^^\n" +
- "Javadoc: The type X.X_dep is deprecated\n" +
+ " * @see X_dep\n" +
+ " ^^^^^\n" +
+ "Javadoc: The type X_dep is deprecated\n" +
"----------\n" +
"57. ERROR in Y.java (at line 80)\n" +
" * @see X.X_priv\n" +
@@ -864,13 +876,13 @@
if (reportInvalidJavadocTagsDeprecatedRef == null && reportInvalidJavadocTagsNotVisibleRef == null) {
String result = "----------\n";
for (int i=0; i<=visibility; i++) {
- result += resultForInvalidTagsClassOrField[i];
+ result += CLASSES_ERRORS[i];
}
return result;
}
StringBuffer result = new StringBuffer("----------\n");
for (int i=0, count=1; i<= visibility; i++) {
- StringTokenizer tokenizer = new StringTokenizer(resultForInvalidTagsClassOrField[i], "\n");
+ StringTokenizer tokenizer = new StringTokenizer(CLASSES_ERRORS[i], "\n");
while (tokenizer.hasMoreTokens()) {
StringBuffer error = new StringBuffer();
boolean add = true;
@@ -886,7 +898,7 @@
add = line.indexOf("is deprecated") == -1;
}
if (add && CompilerOptions.DISABLED.equals(reportInvalidJavadocTagsNotVisibleRef)) {
- add = line.indexOf("is not visible") == -1;
+ add = line.indexOf("is not visible") == -1 && line.indexOf("in generated documentation") == -1;
}
default:
error.append(line);
@@ -906,13 +918,13 @@
if (reportInvalidJavadocTagsDeprecatedRef == null && reportInvalidJavadocTagsNotVisibleRef == null) {
String result = "----------\n";
for (int i=0; i<=visibility; i++) {
- result += resultForInvalidTagsMethodOrConstructor[i];
+ result += METHODS_ERRORS[i];
}
return result;
}
StringBuffer result = new StringBuffer("----------\n");
for (int i=0, count=1; i<= visibility; i++) {
- StringTokenizer tokenizer = new StringTokenizer(resultForInvalidTagsMethodOrConstructor[i], "\n");
+ StringTokenizer tokenizer = new StringTokenizer(METHODS_ERRORS[i], "\n");
while (tokenizer.hasMoreTokens()) {
StringBuffer error = new StringBuffer();
boolean add = true;
@@ -928,7 +940,7 @@
add = line.indexOf("is deprecated") == -1;
}
if (add && CompilerOptions.DISABLED.equals(reportInvalidJavadocTagsNotVisibleRef)) {
- add = line.indexOf("is not visible") == -1;
+ add = line.indexOf("is not visible") == -1 && line.indexOf("in generated documentation") == -1;
}
default:
error.append(line);
@@ -1302,19 +1314,19 @@
*/
public void testInvalidTagsClassNoSupport() {
docCommentSupport = CompilerOptions.DISABLED;
- runConformTest(InvalidReferencesClassJavadocComments);
+ runConformTest(CLASSES_INVALID_COMMENT);
}
public void testInvalidTagsFieldNoSupport() {
docCommentSupport = CompilerOptions.DISABLED;
- runConformTest(InvalidReferencesFieldJavadocComments);
+ runConformTest(FIELDS_INVALID_COMMENT);
}
public void testInvalidTagsMethodNoSupport() {
docCommentSupport = CompilerOptions.DISABLED;
- runConformTest(InvalidReferencesMethodJavadocComments);
+ runConformTest(METHODS_INVALID_COMMENT);
}
public void testInvalidTagsConstructorNoSupport() {
docCommentSupport = CompilerOptions.DISABLED;
- runConformTest(InvalidReferencesConstructorJavadocComments);
+ runConformTest(CONSTRUCTORS_INVALID_COMMENT);
}
/*
@@ -1322,38 +1334,38 @@
*/
// Test default invalid javadoc (means "ignore" with tags"disabled" and visibility "public")
public void testInvalidTagsClassDefaults() {
- runConformTest(InvalidReferencesClassJavadocComments);
+ runConformTest(CLASSES_INVALID_COMMENT);
}
public void testInvalidTagsFieldDefaults() {
- runConformTest(InvalidReferencesFieldJavadocComments);
+ runConformTest(FIELDS_INVALID_COMMENT);
}
public void testInvalidTagsMethodDefaults() {
- runConformTest(InvalidReferencesMethodJavadocComments);
+ runConformTest(METHODS_INVALID_COMMENT);
}
public void testInvalidTagsConstructorDefaults() {
- runConformTest(InvalidReferencesConstructorJavadocComments);
+ runConformTest(CONSTRUCTORS_INVALID_COMMENT);
}
// Test invalid javadoc "error" + tags "disabled" and visibility "public"
public void testInvalidTagsClassErrorNotags() {
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTags = CompilerOptions.DISABLED;
- runConformTest(InvalidReferencesClassJavadocComments);
+ runConformTest(CLASSES_INVALID_COMMENT);
}
public void testInvalidTagsFieldErrorNotags() {
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTags = CompilerOptions.DISABLED;
- runConformTest(InvalidReferencesFieldJavadocComments);
+ runConformTest(FIELDS_INVALID_COMMENT);
}
public void testInvalidTagsMethodErrorNotags() {
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTags = CompilerOptions.DISABLED;
- runConformTest(InvalidReferencesMethodJavadocComments);
+ runConformTest(METHODS_INVALID_COMMENT);
}
public void testInvalidTagsConstructorErrorNotags() {
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTags = CompilerOptions.DISABLED;
- runConformTest(InvalidReferencesConstructorJavadocComments);
+ runConformTest(CONSTRUCTORS_INVALID_COMMENT);
}
// Test invalid javadoc "error" + tags "enabled" and visibility "public"
@@ -1361,25 +1373,25 @@
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTags = CompilerOptions.ENABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(InvalidReferencesClassJavadocComments, resultForInvalidTagsClassOrField(PUBLIC_VISIBILITY));
+ runNegativeTest(CLASSES_INVALID_COMMENT, resultForInvalidTagsClassOrField(PUBLIC_VISIBILITY));
}
public void testInvalidTagsFieldErrorTagsPublic() {
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTags = CompilerOptions.ENABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(InvalidReferencesFieldJavadocComments, resultForInvalidTagsClassOrField(PUBLIC_VISIBILITY));
+ runNegativeTest(FIELDS_INVALID_COMMENT, resultForInvalidTagsClassOrField(PUBLIC_VISIBILITY));
}
public void testInvalidTagsMethodErrorTagsPublic() {
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTags = CompilerOptions.ENABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(InvalidReferencesMethodJavadocComments, resultForInvalidTagsMethodOrConstructor(PUBLIC_VISIBILITY));
+ runNegativeTest(METHODS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PUBLIC_VISIBILITY));
}
public void testInvalidTagsConstructorErrorTagsPublic() {
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTags = CompilerOptions.ENABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(InvalidReferencesConstructorJavadocComments, resultForInvalidTagsMethodOrConstructor(PUBLIC_VISIBILITY));
+ runNegativeTest(CONSTRUCTORS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PUBLIC_VISIBILITY));
}
// Test invalid javadoc "error" + tags "enabled" and visibility "protected"
@@ -1387,25 +1399,25 @@
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTags = CompilerOptions.ENABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.PROTECTED;
- runNegativeTest(InvalidReferencesClassJavadocComments, resultForInvalidTagsClassOrField(PROTECTED_VISIBILITY));
+ runNegativeTest(CLASSES_INVALID_COMMENT, resultForInvalidTagsClassOrField(PROTECTED_VISIBILITY));
}
public void testInvalidTagsFieldErrorTagsProtected() {
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTags = CompilerOptions.ENABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.PROTECTED;
- runNegativeTest(InvalidReferencesFieldJavadocComments, resultForInvalidTagsClassOrField(PROTECTED_VISIBILITY));
+ runNegativeTest(FIELDS_INVALID_COMMENT, resultForInvalidTagsClassOrField(PROTECTED_VISIBILITY));
}
public void testInvalidTagsMethodErrorTagsProtected() {
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTags = CompilerOptions.ENABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.PROTECTED;
- runNegativeTest(InvalidReferencesMethodJavadocComments, resultForInvalidTagsMethodOrConstructor(PROTECTED_VISIBILITY));
+ runNegativeTest(METHODS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PROTECTED_VISIBILITY));
}
public void testInvalidTagsConstructorErrorTagsProtected() {
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTags = CompilerOptions.ENABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.PROTECTED;
- runNegativeTest(InvalidReferencesConstructorJavadocComments, resultForInvalidTagsMethodOrConstructor(PROTECTED_VISIBILITY));
+ runNegativeTest(CONSTRUCTORS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PROTECTED_VISIBILITY));
}
// Test invalid javadoc "error" + tags "enabled" and visibility "default"
@@ -1413,43 +1425,43 @@
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTags = CompilerOptions.ENABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.DEFAULT;
- runNegativeTest(InvalidReferencesClassJavadocComments, resultForInvalidTagsClassOrField(DEFAULT_VISIBILITY));
+ runNegativeTest(CLASSES_INVALID_COMMENT, resultForInvalidTagsClassOrField(DEFAULT_VISIBILITY));
}
public void testInvalidTagsFieldErrorTagsPackage() {
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTags = CompilerOptions.ENABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.DEFAULT;
- runNegativeTest(InvalidReferencesFieldJavadocComments, resultForInvalidTagsClassOrField(DEFAULT_VISIBILITY));
+ runNegativeTest(FIELDS_INVALID_COMMENT, resultForInvalidTagsClassOrField(DEFAULT_VISIBILITY));
}
public void testInvalidTagsMethodErrorTagsPackage() {
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTags = CompilerOptions.ENABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.DEFAULT;
- runNegativeTest(InvalidReferencesMethodJavadocComments, resultForInvalidTagsMethodOrConstructor(DEFAULT_VISIBILITY));
+ runNegativeTest(METHODS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(DEFAULT_VISIBILITY));
}
public void testInvalidTagsConstructorErrorTagsPackage() {
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTags = CompilerOptions.ENABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.DEFAULT;
- runNegativeTest(InvalidReferencesConstructorJavadocComments, resultForInvalidTagsMethodOrConstructor(DEFAULT_VISIBILITY));
+ runNegativeTest(CONSTRUCTORS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(DEFAULT_VISIBILITY));
}
// Test invalid javadoc "error" + tags "enabled" and visibility "private"
public void testInvalidTagsClassErrorTagsPrivate() {
reportInvalidJavadoc = CompilerOptions.ERROR;
- runNegativeTest(InvalidReferencesClassJavadocComments, resultForInvalidTagsClassOrField(PRIVATE_VISIBILITY));
+ runNegativeTest(CLASSES_INVALID_COMMENT, resultForInvalidTagsClassOrField(PRIVATE_VISIBILITY));
}
public void testInvalidTagsFieldErrorTagsPrivate() {
reportInvalidJavadoc = CompilerOptions.ERROR;
- runNegativeTest(InvalidReferencesFieldJavadocComments, resultForInvalidTagsClassOrField(PRIVATE_VISIBILITY));
+ runNegativeTest(FIELDS_INVALID_COMMENT, resultForInvalidTagsClassOrField(PRIVATE_VISIBILITY));
}
public void testInvalidTagsMethodErrorTagsPrivate() {
reportInvalidJavadoc = CompilerOptions.ERROR;
- runNegativeTest(InvalidReferencesMethodJavadocComments, resultForInvalidTagsMethodOrConstructor(PRIVATE_VISIBILITY));
+ runNegativeTest(METHODS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PRIVATE_VISIBILITY));
}
public void testInvalidTagsConstructorErrorTagsPrivate() {
reportInvalidJavadoc = CompilerOptions.ERROR;
- runNegativeTest(InvalidReferencesConstructorJavadocComments, resultForInvalidTagsMethodOrConstructor(PRIVATE_VISIBILITY));
+ runNegativeTest(CONSTRUCTORS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PRIVATE_VISIBILITY));
}
// Test invalid javadoc "error" + tags "enabled" but invalid deprecated references "disabled" and visibility "public"
@@ -1458,28 +1470,28 @@
reportInvalidJavadocTags = CompilerOptions.ENABLED;
reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(InvalidReferencesClassJavadocComments, resultForInvalidTagsClassOrField(PUBLIC_VISIBILITY));
+ runNegativeTest(CLASSES_INVALID_COMMENT, resultForInvalidTagsClassOrField(PUBLIC_VISIBILITY));
}
public void testInvalidTagsDeprecatedRefFieldErrorTagsPublic() {
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTags = CompilerOptions.ENABLED;
reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(InvalidReferencesFieldJavadocComments, resultForInvalidTagsClassOrField(PUBLIC_VISIBILITY));
+ runNegativeTest(FIELDS_INVALID_COMMENT, resultForInvalidTagsClassOrField(PUBLIC_VISIBILITY));
}
public void testInvalidTagsDeprecatedRefMethodErrorTagsPublic() {
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTags = CompilerOptions.ENABLED;
reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(InvalidReferencesMethodJavadocComments, resultForInvalidTagsMethodOrConstructor(PUBLIC_VISIBILITY));
+ runNegativeTest(METHODS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PUBLIC_VISIBILITY));
}
public void testInvalidTagsDeprecatedRefConstructorErrorTagsPublic() {
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTags = CompilerOptions.ENABLED;
reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(InvalidReferencesConstructorJavadocComments, resultForInvalidTagsMethodOrConstructor(PUBLIC_VISIBILITY));
+ runNegativeTest(CONSTRUCTORS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PUBLIC_VISIBILITY));
}
// Test invalid javadoc "error" + tags "enabled" but invalid deprecated references "disabled" visibility "protected"
@@ -1488,28 +1500,28 @@
reportInvalidJavadocTags = CompilerOptions.ENABLED;
reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.PROTECTED;
- runNegativeTest(InvalidReferencesClassJavadocComments, resultForInvalidTagsClassOrField(PROTECTED_VISIBILITY));
+ runNegativeTest(CLASSES_INVALID_COMMENT, resultForInvalidTagsClassOrField(PROTECTED_VISIBILITY));
}
public void testInvalidTagsDeprecatedRefFieldErrorTagsProtected() {
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTags = CompilerOptions.ENABLED;
reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.PROTECTED;
- runNegativeTest(InvalidReferencesFieldJavadocComments, resultForInvalidTagsClassOrField(PROTECTED_VISIBILITY));
+ runNegativeTest(FIELDS_INVALID_COMMENT, resultForInvalidTagsClassOrField(PROTECTED_VISIBILITY));
}
public void testInvalidTagsDeprecatedRefMethodErrorTagsProtected() {
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTags = CompilerOptions.ENABLED;
reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.PROTECTED;
- runNegativeTest(InvalidReferencesMethodJavadocComments, resultForInvalidTagsMethodOrConstructor(PROTECTED_VISIBILITY));
+ runNegativeTest(METHODS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PROTECTED_VISIBILITY));
}
public void testInvalidTagsDeprecatedRefConstructorErrorTagsProtected() {
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTags = CompilerOptions.ENABLED;
reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.PROTECTED;
- runNegativeTest(InvalidReferencesConstructorJavadocComments, resultForInvalidTagsMethodOrConstructor(PROTECTED_VISIBILITY));
+ runNegativeTest(CONSTRUCTORS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PROTECTED_VISIBILITY));
}
// Test invalid javadoc "error" + tags "enabled" but invalid deprecated references "disabled" and visibility "default"
@@ -1518,50 +1530,50 @@
reportInvalidJavadocTags = CompilerOptions.ENABLED;
reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.DEFAULT;
- runNegativeTest(InvalidReferencesClassJavadocComments, resultForInvalidTagsClassOrField(DEFAULT_VISIBILITY));
+ runNegativeTest(CLASSES_INVALID_COMMENT, resultForInvalidTagsClassOrField(DEFAULT_VISIBILITY));
}
public void testInvalidTagsDeprecatedRefFieldErrorTagsPackage() {
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTags = CompilerOptions.ENABLED;
reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.DEFAULT;
- runNegativeTest(InvalidReferencesFieldJavadocComments, resultForInvalidTagsClassOrField(DEFAULT_VISIBILITY));
+ runNegativeTest(FIELDS_INVALID_COMMENT, resultForInvalidTagsClassOrField(DEFAULT_VISIBILITY));
}
public void testInvalidTagsDeprecatedRefMethodErrorTagsPackage() {
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTags = CompilerOptions.ENABLED;
reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.DEFAULT;
- runNegativeTest(InvalidReferencesMethodJavadocComments, resultForInvalidTagsMethodOrConstructor(DEFAULT_VISIBILITY));
+ runNegativeTest(METHODS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(DEFAULT_VISIBILITY));
}
public void testInvalidTagsDeprecatedRefConstructorErrorTagsPackage() {
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTags = CompilerOptions.ENABLED;
reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.DEFAULT;
- runNegativeTest(InvalidReferencesConstructorJavadocComments, resultForInvalidTagsMethodOrConstructor(DEFAULT_VISIBILITY));
+ runNegativeTest(CONSTRUCTORS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(DEFAULT_VISIBILITY));
}
// Test invalid javadoc "error" + tags "enabled" but invalid deprecated references "disabled" and visibility "private"
public void testInvalidTagsDeprecatedRefClassErrorTagsPrivate() {
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
- runNegativeTest(InvalidReferencesClassJavadocComments, resultForInvalidTagsClassOrField(PRIVATE_VISIBILITY));
+ runNegativeTest(CLASSES_INVALID_COMMENT, resultForInvalidTagsClassOrField(PRIVATE_VISIBILITY));
}
public void testInvalidTagsDeprecatedRefFieldErrorTagsPrivate() {
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
- runNegativeTest(InvalidReferencesFieldJavadocComments, resultForInvalidTagsClassOrField(PRIVATE_VISIBILITY));
+ runNegativeTest(FIELDS_INVALID_COMMENT, resultForInvalidTagsClassOrField(PRIVATE_VISIBILITY));
}
public void testInvalidTagsDeprecatedRefMethodErrorTagsPrivate() {
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
- runNegativeTest(InvalidReferencesMethodJavadocComments, resultForInvalidTagsMethodOrConstructor(PRIVATE_VISIBILITY));
+ runNegativeTest(METHODS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PRIVATE_VISIBILITY));
}
public void testInvalidTagsDeprecatedRefConstructorErrorTagsPrivate() {
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
- runNegativeTest(InvalidReferencesConstructorJavadocComments, resultForInvalidTagsMethodOrConstructor(PRIVATE_VISIBILITY));
+ runNegativeTest(CONSTRUCTORS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PRIVATE_VISIBILITY));
}
// Test invalid javadoc "error" + tags "enabled" but invalid not visible references "disabled" and visibility "public"
@@ -1570,28 +1582,28 @@
reportInvalidJavadocTags = CompilerOptions.ENABLED;
reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(InvalidReferencesClassJavadocComments, resultForInvalidTagsClassOrField(PUBLIC_VISIBILITY));
+ runNegativeTest(CLASSES_INVALID_COMMENT, resultForInvalidTagsClassOrField(PUBLIC_VISIBILITY));
}
public void testInvalidTagsNotVisibleRefFieldErrorTagsPublic() {
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTags = CompilerOptions.ENABLED;
reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(InvalidReferencesFieldJavadocComments, resultForInvalidTagsClassOrField(PUBLIC_VISIBILITY));
+ runNegativeTest(FIELDS_INVALID_COMMENT, resultForInvalidTagsClassOrField(PUBLIC_VISIBILITY));
}
public void testInvalidTagsNotVisibleRefMethodErrorTagsPublic() {
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTags = CompilerOptions.ENABLED;
reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(InvalidReferencesMethodJavadocComments, resultForInvalidTagsMethodOrConstructor(PUBLIC_VISIBILITY));
+ runNegativeTest(METHODS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PUBLIC_VISIBILITY));
}
public void testInvalidTagsNotVisibleRefConstructorErrorTagsPublic() {
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTags = CompilerOptions.ENABLED;
reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(InvalidReferencesConstructorJavadocComments, resultForInvalidTagsMethodOrConstructor(PUBLIC_VISIBILITY));
+ runNegativeTest(CONSTRUCTORS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PUBLIC_VISIBILITY));
}
// Test invalid javadoc "error" + tags "enabled" but invalid not visible references "disabled" visibility "protected"
@@ -1600,28 +1612,28 @@
reportInvalidJavadocTags = CompilerOptions.ENABLED;
reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.PROTECTED;
- runNegativeTest(InvalidReferencesClassJavadocComments, resultForInvalidTagsClassOrField(PROTECTED_VISIBILITY));
+ runNegativeTest(CLASSES_INVALID_COMMENT, resultForInvalidTagsClassOrField(PROTECTED_VISIBILITY));
}
public void testInvalidTagsNotVisibleRefFieldErrorTagsProtected() {
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTags = CompilerOptions.ENABLED;
reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.PROTECTED;
- runNegativeTest(InvalidReferencesFieldJavadocComments, resultForInvalidTagsClassOrField(PROTECTED_VISIBILITY));
+ runNegativeTest(FIELDS_INVALID_COMMENT, resultForInvalidTagsClassOrField(PROTECTED_VISIBILITY));
}
public void testInvalidTagsNotVisibleRefMethodErrorTagsProtected() {
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTags = CompilerOptions.ENABLED;
reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.PROTECTED;
- runNegativeTest(InvalidReferencesMethodJavadocComments, resultForInvalidTagsMethodOrConstructor(PROTECTED_VISIBILITY));
+ runNegativeTest(METHODS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PROTECTED_VISIBILITY));
}
public void testInvalidTagsNotVisibleRefConstructorErrorTagsProtected() {
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTags = CompilerOptions.ENABLED;
reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.PROTECTED;
- runNegativeTest(InvalidReferencesConstructorJavadocComments, resultForInvalidTagsMethodOrConstructor(PROTECTED_VISIBILITY));
+ runNegativeTest(CONSTRUCTORS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PROTECTED_VISIBILITY));
}
// Test invalid javadoc "error" + tags "enabled" but invalid not visible references "disabled" and visibility "default"
@@ -1630,50 +1642,50 @@
reportInvalidJavadocTags = CompilerOptions.ENABLED;
reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.DEFAULT;
- runNegativeTest(InvalidReferencesClassJavadocComments, resultForInvalidTagsClassOrField(DEFAULT_VISIBILITY));
+ runNegativeTest(CLASSES_INVALID_COMMENT, resultForInvalidTagsClassOrField(DEFAULT_VISIBILITY));
}
public void testInvalidTagsNotVisibleRefFieldErrorTagsPackage() {
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTags = CompilerOptions.ENABLED;
reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.DEFAULT;
- runNegativeTest(InvalidReferencesFieldJavadocComments, resultForInvalidTagsClassOrField(DEFAULT_VISIBILITY));
+ runNegativeTest(FIELDS_INVALID_COMMENT, resultForInvalidTagsClassOrField(DEFAULT_VISIBILITY));
}
public void testInvalidTagsNotVisibleRefMethodErrorTagsPackage() {
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTags = CompilerOptions.ENABLED;
reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.DEFAULT;
- runNegativeTest(InvalidReferencesMethodJavadocComments, resultForInvalidTagsMethodOrConstructor(DEFAULT_VISIBILITY));
+ runNegativeTest(METHODS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(DEFAULT_VISIBILITY));
}
public void testInvalidTagsNotVisibleRefConstructorErrorTagsPackage() {
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTags = CompilerOptions.ENABLED;
reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.DEFAULT;
- runNegativeTest(InvalidReferencesConstructorJavadocComments, resultForInvalidTagsMethodOrConstructor(DEFAULT_VISIBILITY));
+ runNegativeTest(CONSTRUCTORS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(DEFAULT_VISIBILITY));
}
// Test invalid javadoc "error" + tags "enabled" but invalid not visible references "disabled" and visibility "private"
public void testInvalidTagsNotVisibleRefClassErrorTagsPrivate() {
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
- runNegativeTest(InvalidReferencesClassJavadocComments, resultForInvalidTagsClassOrField(PRIVATE_VISIBILITY));
+ runNegativeTest(CLASSES_INVALID_COMMENT, resultForInvalidTagsClassOrField(PRIVATE_VISIBILITY));
}
public void testInvalidTagsNotVisibleRefFieldErrorTagsPrivate() {
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
- runNegativeTest(InvalidReferencesFieldJavadocComments, resultForInvalidTagsClassOrField(PRIVATE_VISIBILITY));
+ runNegativeTest(FIELDS_INVALID_COMMENT, resultForInvalidTagsClassOrField(PRIVATE_VISIBILITY));
}
public void testInvalidTagsNotVisibleRefMethodErrorTagsPrivate() {
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
- runNegativeTest(InvalidReferencesMethodJavadocComments, resultForInvalidTagsMethodOrConstructor(PRIVATE_VISIBILITY));
+ runNegativeTest(METHODS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PRIVATE_VISIBILITY));
}
public void testInvalidTagsNotVisibleRefConstructorErrorTagsPrivate() {
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
- runNegativeTest(InvalidReferencesConstructorJavadocComments, resultForInvalidTagsMethodOrConstructor(PRIVATE_VISIBILITY));
+ runNegativeTest(CONSTRUCTORS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PRIVATE_VISIBILITY));
}
// Test invalid javadoc "error" + tags "enabled" but invalid deprecated or not visible references "disabled" and visibility "public"
@@ -1683,7 +1695,7 @@
reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(InvalidReferencesClassJavadocComments, resultForInvalidTagsClassOrField(PUBLIC_VISIBILITY));
+ runNegativeTest(CLASSES_INVALID_COMMENT, resultForInvalidTagsClassOrField(PUBLIC_VISIBILITY));
}
public void testInvalidTagsDeprecatedAndNotVisibleRefFieldErrorTagsPublic() {
reportInvalidJavadoc = CompilerOptions.ERROR;
@@ -1691,7 +1703,7 @@
reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(InvalidReferencesFieldJavadocComments, resultForInvalidTagsClassOrField(PUBLIC_VISIBILITY));
+ runNegativeTest(FIELDS_INVALID_COMMENT, resultForInvalidTagsClassOrField(PUBLIC_VISIBILITY));
}
public void testInvalidTagsDeprecatedAndNotVisibleRefMethodErrorTagsPublic() {
reportInvalidJavadoc = CompilerOptions.ERROR;
@@ -1699,7 +1711,7 @@
reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(InvalidReferencesMethodJavadocComments, resultForInvalidTagsMethodOrConstructor(PUBLIC_VISIBILITY));
+ runNegativeTest(METHODS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PUBLIC_VISIBILITY));
}
public void testInvalidTagsDeprecatedAndNotVisibleRefConstructorErrorTagsPublic() {
reportInvalidJavadoc = CompilerOptions.ERROR;
@@ -1707,7 +1719,7 @@
reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.PUBLIC;
- runNegativeTest(InvalidReferencesConstructorJavadocComments, resultForInvalidTagsMethodOrConstructor(PUBLIC_VISIBILITY));
+ runNegativeTest(CONSTRUCTORS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PUBLIC_VISIBILITY));
}
// Test invalid javadoc "error" + tags "enabled" but invalid deprecated or not visible references "disabled" visibility "protected"
@@ -1717,7 +1729,7 @@
reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.PROTECTED;
- runNegativeTest(InvalidReferencesClassJavadocComments, resultForInvalidTagsClassOrField(PROTECTED_VISIBILITY));
+ runNegativeTest(CLASSES_INVALID_COMMENT, resultForInvalidTagsClassOrField(PROTECTED_VISIBILITY));
}
public void testInvalidTagsDeprecatedAndNotVisibleRefFieldErrorTagsProtected() {
reportInvalidJavadoc = CompilerOptions.ERROR;
@@ -1725,7 +1737,7 @@
reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.PROTECTED;
- runNegativeTest(InvalidReferencesFieldJavadocComments, resultForInvalidTagsClassOrField(PROTECTED_VISIBILITY));
+ runNegativeTest(FIELDS_INVALID_COMMENT, resultForInvalidTagsClassOrField(PROTECTED_VISIBILITY));
}
public void testInvalidTagsDeprecatedAndNotVisibleRefMethodErrorTagsProtected() {
reportInvalidJavadoc = CompilerOptions.ERROR;
@@ -1733,7 +1745,7 @@
reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.PROTECTED;
- runNegativeTest(InvalidReferencesMethodJavadocComments, resultForInvalidTagsMethodOrConstructor(PROTECTED_VISIBILITY));
+ runNegativeTest(METHODS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PROTECTED_VISIBILITY));
}
public void testInvalidTagsDeprecatedAndNotVisibleRefConstructorErrorTagsProtected() {
reportInvalidJavadoc = CompilerOptions.ERROR;
@@ -1741,7 +1753,7 @@
reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.PROTECTED;
- runNegativeTest(InvalidReferencesConstructorJavadocComments, resultForInvalidTagsMethodOrConstructor(PROTECTED_VISIBILITY));
+ runNegativeTest(CONSTRUCTORS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PROTECTED_VISIBILITY));
}
// Test invalid javadoc "error" + tags "enabled" but invalid deprecated or not visible references "disabled" and visibility "default"
@@ -1751,7 +1763,7 @@
reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.DEFAULT;
- runNegativeTest(InvalidReferencesClassJavadocComments, resultForInvalidTagsClassOrField(DEFAULT_VISIBILITY));
+ runNegativeTest(CLASSES_INVALID_COMMENT, resultForInvalidTagsClassOrField(DEFAULT_VISIBILITY));
}
public void testInvalidTagsDeprecatedAndNotVisibleRefFieldErrorTagsPackage() {
reportInvalidJavadoc = CompilerOptions.ERROR;
@@ -1759,7 +1771,7 @@
reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.DEFAULT;
- runNegativeTest(InvalidReferencesFieldJavadocComments, resultForInvalidTagsClassOrField(DEFAULT_VISIBILITY));
+ runNegativeTest(FIELDS_INVALID_COMMENT, resultForInvalidTagsClassOrField(DEFAULT_VISIBILITY));
}
public void testInvalidTagsDeprecatedAndNotVisibleRefMethodErrorTagsPackage() {
reportInvalidJavadoc = CompilerOptions.ERROR;
@@ -1767,7 +1779,7 @@
reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.DEFAULT;
- runNegativeTest(InvalidReferencesMethodJavadocComments, resultForInvalidTagsMethodOrConstructor(DEFAULT_VISIBILITY));
+ runNegativeTest(METHODS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(DEFAULT_VISIBILITY));
}
public void testInvalidTagsDeprecatedAndNotVisibleRefConstructorErrorTagsPackage() {
reportInvalidJavadoc = CompilerOptions.ERROR;
@@ -1775,7 +1787,7 @@
reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.DEFAULT;
- runNegativeTest(InvalidReferencesConstructorJavadocComments, resultForInvalidTagsMethodOrConstructor(DEFAULT_VISIBILITY));
+ runNegativeTest(CONSTRUCTORS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(DEFAULT_VISIBILITY));
}
// Test invalid javadoc "error" + tags "enabled" but invalid deprecated or not visible references "disabled" and visibility "private"
@@ -1783,25 +1795,25 @@
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
- runNegativeTest(InvalidReferencesClassJavadocComments, resultForInvalidTagsClassOrField(PRIVATE_VISIBILITY));
+ runNegativeTest(CLASSES_INVALID_COMMENT, resultForInvalidTagsClassOrField(PRIVATE_VISIBILITY));
}
public void testInvalidTagsDeprecatedAndNotVisibleRefFieldErrorTagsPrivate() {
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
- runNegativeTest(InvalidReferencesFieldJavadocComments, resultForInvalidTagsClassOrField(PRIVATE_VISIBILITY));
+ runNegativeTest(FIELDS_INVALID_COMMENT, resultForInvalidTagsClassOrField(PRIVATE_VISIBILITY));
}
public void testInvalidTagsDeprecatedAndNotVisibleRefMethodErrorTagsPrivate() {
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
- runNegativeTest(InvalidReferencesMethodJavadocComments, resultForInvalidTagsMethodOrConstructor(PRIVATE_VISIBILITY));
+ runNegativeTest(METHODS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PRIVATE_VISIBILITY));
}
public void testInvalidTagsDeprecatedAndNotVisibleRefConstructorErrorTagsPrivate() {
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTagsDeprecatedRef = CompilerOptions.DISABLED;
reportInvalidJavadocTagsNotVisibleRef = CompilerOptions.DISABLED;
- runNegativeTest(InvalidReferencesConstructorJavadocComments, resultForInvalidTagsMethodOrConstructor(PRIVATE_VISIBILITY));
+ runNegativeTest(CONSTRUCTORS_INVALID_COMMENT, resultForInvalidTagsMethodOrConstructor(PRIVATE_VISIBILITY));
}
/*
@@ -1809,7 +1821,7 @@
*/
// Test default missing javadoc tags (means "ignore" with visibility "public" and overriding="enabled")
public void testMissingTagsDefaults() {
- runConformTest(MissingTags);
+ runConformTest(MISSING_TAGS);
}
// Test missing javadoc tags "error" + "public" visibility + "enabled" overriding
@@ -1817,7 +1829,7 @@
reportMissingJavadocTags = CompilerOptions.ERROR;
reportMissingJavadocTagsVisibility = CompilerOptions.PUBLIC;
reportMissingJavadocTagsOverriding = CompilerOptions.ENABLED;
- runNegativeTest(MissingTags, resultForMissingTags(PUBLIC_VISIBILITY));
+ runNegativeTest(MISSING_TAGS, resultForMissingTags(PUBLIC_VISIBILITY));
}
// Test missing javadoc tags "error" + "public" visibility + "disabled" overriding
@@ -1825,7 +1837,7 @@
reportMissingJavadocTags = CompilerOptions.ERROR;
reportMissingJavadocTagsVisibility = CompilerOptions.PUBLIC;
reportMissingJavadocTagsOverriding = CompilerOptions.DISABLED;
- runNegativeTest(MissingTags, resultForMissingTags(PUBLIC_VISIBILITY));
+ runNegativeTest(MISSING_TAGS, resultForMissingTags(PUBLIC_VISIBILITY));
}
// Test missing javadoc tags "error" + "protected" visibility + "enabled" overriding
@@ -1833,7 +1845,7 @@
reportMissingJavadocTags = CompilerOptions.ERROR;
reportMissingJavadocTagsVisibility = CompilerOptions.PROTECTED;
reportMissingJavadocTagsOverriding = CompilerOptions.ENABLED;
- runNegativeTest(MissingTags, resultForMissingTags(PROTECTED_VISIBILITY));
+ runNegativeTest(MISSING_TAGS, resultForMissingTags(PROTECTED_VISIBILITY));
}
// Test missing javadoc tags "error" + "protected" visibility + "disabled" overriding
@@ -1841,7 +1853,7 @@
reportMissingJavadocTags = CompilerOptions.ERROR;
reportMissingJavadocTagsVisibility = CompilerOptions.PROTECTED;
reportMissingJavadocTagsOverriding = CompilerOptions.DISABLED;
- runNegativeTest(MissingTags, resultForMissingTags(PROTECTED_VISIBILITY));
+ runNegativeTest(MISSING_TAGS, resultForMissingTags(PROTECTED_VISIBILITY));
}
// Test missing javadoc tags "error" + "default" visibility + "enabled" overriding
@@ -1849,7 +1861,7 @@
reportMissingJavadocTags = CompilerOptions.ERROR;
reportMissingJavadocTagsVisibility = CompilerOptions.DEFAULT;
reportMissingJavadocTagsOverriding = CompilerOptions.ENABLED;
- runNegativeTest(MissingTags, resultForMissingTags(DEFAULT_VISIBILITY));
+ runNegativeTest(MISSING_TAGS, resultForMissingTags(DEFAULT_VISIBILITY));
}
// Test missing javadoc tags "error" + "default" visibility + "disabled" overriding
@@ -1857,7 +1869,7 @@
reportMissingJavadocTags = CompilerOptions.ERROR;
reportMissingJavadocTagsVisibility = CompilerOptions.DEFAULT;
reportMissingJavadocTagsOverriding = CompilerOptions.DISABLED;
- runNegativeTest(MissingTags, resultForMissingTags(DEFAULT_VISIBILITY));
+ runNegativeTest(MISSING_TAGS, resultForMissingTags(DEFAULT_VISIBILITY));
}
// Test missing javadoc tags "error" + "private" visibility + "enabled" overriding
@@ -1865,7 +1877,7 @@
reportMissingJavadocTags = CompilerOptions.ERROR;
reportMissingJavadocTagsVisibility = CompilerOptions.PRIVATE;
reportMissingJavadocTagsOverriding = CompilerOptions.ENABLED;
- runNegativeTest(MissingTags, resultForMissingTags(PRIVATE_VISIBILITY));
+ runNegativeTest(MISSING_TAGS, resultForMissingTags(PRIVATE_VISIBILITY));
}
// Test missing javadoc tags "error" + "private" visibility + "disabled" overriding
@@ -1873,7 +1885,7 @@
reportMissingJavadocTags = CompilerOptions.ERROR;
reportMissingJavadocTagsVisibility = CompilerOptions.PRIVATE;
reportMissingJavadocTagsOverriding = CompilerOptions.DISABLED;
- runNegativeTest(MissingTags, resultForMissingTags(PRIVATE_VISIBILITY));
+ runNegativeTest(MISSING_TAGS, resultForMissingTags(PRIVATE_VISIBILITY));
}
/*
@@ -1881,7 +1893,7 @@
*/
// Test default missing javadoc comments (means "ignore" with visibility "public" and overriding="enabled")
public void testMissingCommentsDefaults() {
- runConformTest(MissingComments);
+ runConformTest(MISSING_COMMENTS);
}
// Test missing javadoc comments "error" + "public" visibility + "enabled" overriding
@@ -1889,7 +1901,7 @@
reportMissingJavadocComments = CompilerOptions.ERROR;
reportMissingJavadocCommentsVisibility = CompilerOptions.PUBLIC;
reportMissingJavadocCommentsOverriding = CompilerOptions.ENABLED;
- runNegativeTest(MissingComments, resultForMissingComments(PUBLIC_VISIBILITY));
+ runNegativeTest(MISSING_COMMENTS, resultForMissingComments(PUBLIC_VISIBILITY));
}
// Test missing javadoc comments "error" + "public" visibility + "disabled" overriding
@@ -1897,7 +1909,7 @@
reportMissingJavadocComments = CompilerOptions.ERROR;
reportMissingJavadocCommentsVisibility = CompilerOptions.PUBLIC;
reportMissingJavadocCommentsOverriding = CompilerOptions.DISABLED;
- runNegativeTest(MissingComments, resultForMissingComments(PUBLIC_VISIBILITY));
+ runNegativeTest(MISSING_COMMENTS, resultForMissingComments(PUBLIC_VISIBILITY));
}
// Test missing javadoc comments "error" + "protected" visibility + "enabled" overriding
@@ -1905,7 +1917,7 @@
reportMissingJavadocComments = CompilerOptions.ERROR;
reportMissingJavadocCommentsVisibility = CompilerOptions.PROTECTED;
reportMissingJavadocCommentsOverriding = CompilerOptions.ENABLED;
- runNegativeTest(MissingComments, resultForMissingComments(PROTECTED_VISIBILITY));
+ runNegativeTest(MISSING_COMMENTS, resultForMissingComments(PROTECTED_VISIBILITY));
}
// Test missing javadoc comments "error" + "protected" visibility + "disabled" overriding
@@ -1913,7 +1925,7 @@
reportMissingJavadocComments = CompilerOptions.ERROR;
reportMissingJavadocCommentsVisibility = CompilerOptions.PROTECTED;
reportMissingJavadocCommentsOverriding = CompilerOptions.DISABLED;
- runNegativeTest(MissingComments, resultForMissingComments(PROTECTED_VISIBILITY));
+ runNegativeTest(MISSING_COMMENTS, resultForMissingComments(PROTECTED_VISIBILITY));
}
// Test missing javadoc comments "error" + "default" visibility + "enabled" overriding
@@ -1921,7 +1933,7 @@
reportMissingJavadocComments = CompilerOptions.ERROR;
reportMissingJavadocCommentsVisibility = CompilerOptions.DEFAULT;
reportMissingJavadocCommentsOverriding = CompilerOptions.ENABLED;
- runNegativeTest(MissingComments, resultForMissingComments(DEFAULT_VISIBILITY));
+ runNegativeTest(MISSING_COMMENTS, resultForMissingComments(DEFAULT_VISIBILITY));
}
// Test missing javadoc comments "error" + "default" visibility + "disabled" overriding
@@ -1929,7 +1941,7 @@
reportMissingJavadocComments = CompilerOptions.ERROR;
reportMissingJavadocCommentsVisibility = CompilerOptions.DEFAULT;
reportMissingJavadocCommentsOverriding = CompilerOptions.DISABLED;
- runNegativeTest(MissingComments, resultForMissingComments(DEFAULT_VISIBILITY));
+ runNegativeTest(MISSING_COMMENTS, resultForMissingComments(DEFAULT_VISIBILITY));
}
// Test missing javadoc comments "error" + "private" visibility + "enabled" overriding
@@ -1937,7 +1949,7 @@
reportMissingJavadocComments = CompilerOptions.ERROR;
reportMissingJavadocCommentsVisibility = CompilerOptions.PRIVATE;
reportMissingJavadocCommentsOverriding = CompilerOptions.ENABLED;
- runNegativeTest(MissingComments, resultForMissingComments(PRIVATE_VISIBILITY));
+ runNegativeTest(MISSING_COMMENTS, resultForMissingComments(PRIVATE_VISIBILITY));
}
// Test missing javadoc comments "error" + "private" visibility + "disabled" overriding
@@ -1945,7 +1957,7 @@
reportMissingJavadocComments = CompilerOptions.ERROR;
reportMissingJavadocCommentsVisibility = CompilerOptions.PRIVATE;
reportMissingJavadocCommentsOverriding = CompilerOptions.DISABLED;
- runNegativeTest(MissingComments, resultForMissingComments(PRIVATE_VISIBILITY));
+ runNegativeTest(MISSING_COMMENTS, resultForMissingComments(PRIVATE_VISIBILITY));
}
/*
@@ -1954,28 +1966,28 @@
public void testInvalidTagsClassWithMissingTagsOption() {
reportMissingJavadocTags = CompilerOptions.ERROR;
reportMissingJavadocTagsVisibility = CompilerOptions.PRIVATE;
- runConformTest(InvalidReferencesClassJavadocComments);
+ runConformTest(CLASSES_INVALID_COMMENT);
}
public void testInvalidTagsFieldWithMissingTagsOption() {
reportMissingJavadocTags = CompilerOptions.ERROR;
reportMissingJavadocTagsVisibility = CompilerOptions.PRIVATE;
- runConformTest(InvalidReferencesFieldJavadocComments);
+ runConformTest(FIELDS_INVALID_COMMENT);
}
public void testInvalidTagsMethodWithMissingTagsOption() {
reportMissingJavadocTags = CompilerOptions.ERROR;
reportMissingJavadocTagsVisibility = CompilerOptions.PRIVATE;
- runConformTest(InvalidReferencesMethodJavadocComments);
+ runConformTest(METHODS_INVALID_COMMENT);
}
public void testInvalidTagsConstructorWithMissingTagsOption() {
reportMissingJavadocTags = CompilerOptions.ERROR;
reportMissingJavadocTagsVisibility = CompilerOptions.PRIVATE;
- runConformTest(InvalidReferencesConstructorJavadocComments);
+ runConformTest(CONSTRUCTORS_INVALID_COMMENT);
}
public void testMissingTagsWithInvalidTagsOption() {
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTags = CompilerOptions.ENABLED;
reportInvalidJavadocTagsVisibility = CompilerOptions.PRIVATE;
- runConformTest(MissingTags);
+ runConformTest(MISSING_TAGS);
}
/**
@@ -1987,24 +1999,24 @@
this.docCommentSupport = CompilerOptions.DISABLED;
reportInvalidJavadoc = CompilerOptions.ERROR;
reportInvalidJavadocTags = CompilerOptions.ERROR;
- runConformTest(InvalidReferencesClassJavadocComments);
- runConformTest(InvalidReferencesFieldJavadocComments);
- runConformTest(InvalidReferencesMethodJavadocComments);
- runConformTest(InvalidReferencesConstructorJavadocComments);
+ runConformTest(CLASSES_INVALID_COMMENT);
+ runConformTest(FIELDS_INVALID_COMMENT);
+ runConformTest(METHODS_INVALID_COMMENT);
+ runConformTest(CONSTRUCTORS_INVALID_COMMENT);
}
// Test missing javadoc comments "error" with javadoc comment support disabled
public void testMissingCommentsJavadocSupportDisabled() {
this.docCommentSupport = CompilerOptions.DISABLED;
reportMissingJavadocComments = CompilerOptions.ERROR;
- runConformReferenceTest(MissingComments);
+ runConformReferenceTest(MISSING_COMMENTS);
}
// Test missing javadoc tags "error" with javadoc comment support disabled
public void testMissingTagsJavadocSupportDisabled() {
this.docCommentSupport = CompilerOptions.DISABLED;
reportMissingJavadocTags = CompilerOptions.ERROR;
- runConformReferenceTest(MissingTags);
+ runConformReferenceTest(MISSING_TAGS);
}
}
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.22
diff -u -r1.22 JavadocBugsTest.java
--- src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java 29 Mar 2006 03:50:22 -0000 1.22
+++ src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java 23 Jun 2006 07:47:43 -0000
@@ -20,6 +20,7 @@
String docCommentSupport = CompilerOptions.ENABLED;
String reportInvalidJavadoc = CompilerOptions.ERROR;
+ String reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
String reportMissingJavadocTags = CompilerOptions.ERROR;
String reportMissingJavadocComments = null;
String reportDeprecation = CompilerOptions.ERROR;
@@ -36,7 +37,7 @@
// Use this static initializer to specify subset for tests
// All specified tests which does not belong to the class are skipped...
static {
-// TESTS_PREFIX = "testBug83127";
+// TESTS_PREFIX = "testBug96237";
// TESTS_NAMES = new String[] { "testBug68017javadocWarning2" };
// TESTS_NUMBERS = new int[] { 129241 };
// TESTS_RANGE = new int[] { 21, 50 };
@@ -49,6 +50,9 @@
Map options = super.getCompilerOptions();
options.put(CompilerOptions.OPTION_DocCommentSupport, docCommentSupport);
options.put(CompilerOptions.OPTION_ReportInvalidJavadoc, reportInvalidJavadoc);
+ if (!CompilerOptions.IGNORE.equals(reportInvalidJavadoc)) {
+ options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsVisibility, this.reportInvalidJavadocVisibility);
+ }
if (this.reportJavadocDeprecation != null) {
options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsDeprecatedRef, reportJavadocDeprecation);
}
@@ -77,6 +81,7 @@
super.setUp();
docCommentSupport = CompilerOptions.ENABLED;
reportInvalidJavadoc = CompilerOptions.ERROR;
+ reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
reportMissingJavadocTags = CompilerOptions.IGNORE;
reportMissingJavadocComments = CompilerOptions.IGNORE;
reportDeprecation = CompilerOptions.ERROR;
@@ -220,45 +225,45 @@
public void testBug45592() {
runConformTest(
new String[] {
- "a/Y.java",
- "package a;\n" +
- "\n" +
- "/** */\n" +
- "public class Y {\n" +
- " protected boolean bar(Object obj) {\n" +
- " return obj == null;\n" +
- " }\n" +
- "}\n",
- "test/X.java",
- "package test;\n" +
- "public class X {\n" +
- " public static Boolean valueOf(boolean bool) {\n" +
- " if (bool) {\n" +
- " return Boolean.TRUE;\n" +
- " } else {\n" +
- " return Boolean.FALSE;\n" +
- " }\n" +
- " }\n" +
- "}\n",
- "test/YY.java",
- "package test;\n" +
- "\n" +
- "import a.Y;\n" +
- "\n" +
- "/** */\n" +
- "public class YY extends Y {\n" +
- " /**\n" +
- " * Returns a Boolean.\n" +
- " * @param key\n" +
- " * @return A Boolean telling whether the key is null or not.\n" +
- " * @see #bar(Object)\n" +
- " */\n" +
- " protected Boolean foo(Object key) {\n" +
- " return X.valueOf(bar(key));\n" +
- " }\n" +
- "}\n"
- }
- );
+ "a/Y.java",
+ "package a;\n" +
+ "\n" +
+ "/** */\n" +
+ "public class Y {\n" +
+ " protected boolean bar(Object obj) {\n" +
+ " return obj == null;\n" +
+ " }\n" +
+ "}\n",
+ "test/X.java",
+ "package test;\n" +
+ "public class X {\n" +
+ " public static Boolean valueOf(boolean bool) {\n" +
+ " if (bool) {\n" +
+ " return Boolean.TRUE;\n" +
+ " } else {\n" +
+ " return Boolean.FALSE;\n" +
+ " }\n" +
+ " }\n" +
+ "}\n",
+ "test/YY.java",
+ "package test;\n" +
+ "\n" +
+ "import a.Y;\n" +
+ "\n" +
+ "/** */\n" +
+ "public class YY extends Y {\n" +
+ " /**\n" +
+ " * Returns a Boolean.\n" +
+ " * @param key\n" +
+ " * @return A Boolean telling whether the key is null or not.\n" +
+ " * @see #bar(Object)\n" +
+ " */\n" +
+ " protected Boolean foo(Object key) {\n" +
+ " return X.valueOf(bar(key));\n" +
+ " }\n" +
+ "}\n"
+ }
+ );
}
/**
@@ -690,12 +695,7 @@
"}\n"
},
"----------\n" +
- "1. WARNING in X.java (at line 2)\n" +
- " public class X extends RuntimeException {\n" +
- " ^\n" +
- "The serializable class X does not declare a static final serialVersionUID field of type long\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
+ "1. ERROR in X.java (at line 5)\n" +
" public X(String message) {\n" +
" ^^^^^^^\n" +
"Javadoc: Missing tag for parameter message\n" +
@@ -2420,6 +2420,196 @@
}
/**
+ * Bug 68726: [Javadoc] Target attribute in @see link triggers warning
+ * @see 68726
+ */
+ public void testBug68726conform1() {
+ runConformTest(
+ new String[] {
+ "X.java",
+ "public class X {\n" +
+ " /**\n" +
+ " * @see Object Eclipse\n" +
+ " */\n" +
+ " void foo1() {}\n" +
+ " /**@see Object Eclipse*/\n" +
+ " void foo2() {}\n" +
+ "}\n"
+ }
+ );
+ }
+ public void testBug68726conform2() {
+ runConformTest(
+ new String[] {
+ "X.java",
+ "/**\n" +
+ " * @see IBM Home Page\n" +
+ " * @see \n" +
+ " * IBM Home Page\n" +
+ " * @see \n" +
+ " * IBM Home Page\n" +
+ " * \n" +
+ " * @see \n" +
+ " *\n" +
+ " * IBM\n" +
+ " *\n" +
+ " * Home Page\n" +
+ " *\n" +
+ " *\n" +
+ " * \n" +
+ " * @see Object\n" +
+ " */\n" +
+ "public class X {\n" +
+ "}\n"
+ }
+ );
+ }
+ public void testBug68726negative1() {
+ runNegativeTest(
+ new String[] {
+ "X.java",
+ "public class X {\n" +
+ " /**\n" +
+ " * Invalid URL link references\n" +
+ " *\n" +
+ " * @see \n" +
+ " * @see \n" +
+ " * @see invalid\n" +
+ " * @see invalid<\n" +
+ " * @see invalid\n" +
+ " * @see invalidinvalid no text allowed after the href\n" +
+ " */\n" +
+ " void foo() {}\n" +
+ "}\n"
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " * @see \n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Malformed link reference\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 11)\n" +
+ " * @see \n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Malformed link reference\n" +
+ "----------\n" +
+ "8. ERROR in X.java (at line 12)\n" +
+ " * @see invalid\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Malformed link reference\n" +
+ "----------\n" +
+ "9. ERROR in X.java (at line 13)\n" +
+ " * @see invalid<\n" +
+ " ^\n" +
+ "Javadoc: Malformed link reference\n" +
+ "----------\n" +
+ "10. ERROR in X.java (at line 14)\n" +
+ " * @see invalid\n" +
+ " ^^\n" +
+ "Javadoc: Malformed link reference\n" +
+ "----------\n" +
+ "11. ERROR in X.java (at line 15)\n" +
+ " * @see invalidinvalid no text allowed after the href\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Unexpected text\n" +
+ "----------\n"
+ );
+ }
+ public void testBug68726negative2() {
+ runNegativeTest(
+ new String[] {
+ "X.java",
+ "/**\n" +
+ " * @see IBM Home Page\n" +
+ " * @see \n" +
+ " * IBM Home Page\n" +
+ " * @see \n" +
+ " * IBM Home Page<\n" +
+ " * /a>\n" +
+ " * @see \n" +
+ " *\n" +
+ " * IBM\n" +
+ " *\n" +
+ " * Home Page\n" +
+ " *\n" +
+ " *\n" +
+ " * \n" +
+ " * @see Unknown\n" +
+ " */\n" +
+ "public class X {\n" +
+ "}\n"
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " * @see IBM Home Page\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Malformed link reference\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " * @see \n" +
+ " * IBM Home Page\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Malformed link reference\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 6)\n" +
+ " * IBM Home Page<\n" +
+ " ^\n" +
+ "Javadoc: Malformed link reference\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 8)\n" +
+ " * @see \n" +
+ " *\n" +
+ " * IBM\n" +
+ " *\n" +
+ " * Home Page\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Malformed link reference\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 16)\n" +
+ " * @see Unknown\n" +
+ " ^^^^^^^\n" +
+ "Javadoc: Unknown cannot be resolved to a type\n" +
+ "----------\n"
+ );
+ }
+
+ /**
* Bug 69272: [Javadoc] Invalid malformed reference (missing separator)
* @see 69272
*/
@@ -2709,196 +2899,6 @@
}
/**
- * Bug 68726: [Javadoc] Target attribute in @see link triggers warning
- * @see 68726
- */
- public void testBug68726conform1() {
- runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " * @see Object Eclipse\n" +
- " */\n" +
- " void foo1() {}\n" +
- " /**@see Object Eclipse*/\n" +
- " void foo2() {}\n" +
- "}\n"
- }
- );
- }
- public void testBug68726conform2() {
- runConformTest(
- new String[] {
- "X.java",
- "/**\n" +
- " * @see IBM Home Page\n" +
- " * @see \n" +
- " * IBM Home Page\n" +
- " * @see \n" +
- " * IBM Home Page\n" +
- " * \n" +
- " * @see \n" +
- " *\n" +
- " * IBM\n" +
- " *\n" +
- " * Home Page\n" +
- " *\n" +
- " *\n" +
- " * \n" +
- " * @see Object\n" +
- " */\n" +
- "public class X {\n" +
- "}\n"
- }
- );
- }
- public void testBug68726negative1() {
- runNegativeTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " * Invalid URL link references\n" +
- " *\n" +
- " * @see \n" +
- " * @see \n" +
- " * @see invalid\n" +
- " * @see invalid<\n" +
- " * @see invalid\n" +
- " * @see invalidinvalid no text allowed after the href\n" +
- " */\n" +
- " void foo() {}\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " * @see \n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Malformed link reference\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 11)\n" +
- " * @see \n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Malformed link reference\n" +
- "----------\n" +
- "8. ERROR in X.java (at line 12)\n" +
- " * @see invalid\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Malformed link reference\n" +
- "----------\n" +
- "9. ERROR in X.java (at line 13)\n" +
- " * @see invalid<\n" +
- " ^\n" +
- "Javadoc: Malformed link reference\n" +
- "----------\n" +
- "10. ERROR in X.java (at line 14)\n" +
- " * @see invalid\n" +
- " ^^\n" +
- "Javadoc: Malformed link reference\n" +
- "----------\n" +
- "11. ERROR in X.java (at line 15)\n" +
- " * @see invalidinvalid no text allowed after the href\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Unexpected text\n" +
- "----------\n"
- );
- }
- public void testBug68726negative2() {
- runNegativeTest(
- new String[] {
- "X.java",
- "/**\n" +
- " * @see IBM Home Page\n" +
- " * @see \n" +
- " * IBM Home Page\n" +
- " * @see \n" +
- " * IBM Home Page<\n" +
- " * /a>\n" +
- " * @see \n" +
- " *\n" +
- " * IBM\n" +
- " *\n" +
- " * Home Page\n" +
- " *\n" +
- " *\n" +
- " * \n" +
- " * @see Unknown\n" +
- " */\n" +
- "public class X {\n" +
- "}\n"
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " * @see IBM Home Page\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Malformed link reference\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " * @see \n" +
- " * IBM Home Page\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Malformed link reference\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 6)\n" +
- " * IBM Home Page<\n" +
- " ^\n" +
- "Javadoc: Malformed link reference\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 8)\n" +
- " * @see \n" +
- " *\n" +
- " * IBM\n" +
- " *\n" +
- " * Home Page\n" +
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
- "Javadoc: Malformed link reference\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 16)\n" +
- " * @see Unknown\n" +
- " ^^^^^^^\n" +
- "Javadoc: Unknown cannot be resolved to a type\n" +
- "----------\n"
- );
- }
-
- /**
* Bug 70892: [1.5][Javadoc] Compiler should parse reference for inline tag @value
* @see 70892
* These two tests should pass whatever the source level...
@@ -3567,30 +3567,7 @@
/**
* Bug 77602: [javadoc] "Only consider members as visible as" is does not work for syntax error
*/
- public void testBug77602public() {
- Map options = getCompilerOptions();
- options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsVisibility, CompilerOptions.PUBLIC);
- runConformTest(
- new String[] {
- "X.java",
- "public class X {\n" +
- " /**\n" +
- " * @see\n" +
- " * @see UnknownClass\n" +
- " */\n" +
- " protected void foo() {\n" +
- " }\n" +
- "}\n"
- },
- "",
- null,
- true,
- null,
- options,
- null
- );
- }
- public void testBug77602private() {
+ public void testBug77602() {
runNegativeTest(
new String[] {
"X.java",
@@ -3616,6 +3593,22 @@
"----------\n"
);
}
+ public void testBug77602_Public() {
+ this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
+ runConformTest(
+ new String[] {
+ "X.java",
+ "public class X {\n" +
+ " /**\n" +
+ " * @see\n" +
+ " * @see UnknownClass\n" +
+ " */\n" +
+ " protected void foo() {\n" +
+ " }\n" +
+ "}\n"
+ }
+ );
+ }
/**
* Bug 78091: [1.5][javadoc] Compiler should accept new 1.5 syntax for @param
@@ -3751,7 +3744,7 @@
" class C { \n" +
" /**\n" +
" * Link {@link #B(Exception)} OK\n" +
- " * Link {@link #C(String)} OK\n" +
+ " * Link {@link #B.C(String)} OK\n" +
" * Link {@link #foo()} OK\n" +
" * Link {@link #bar()} OK\n" +
" */\n" +
Index: src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_4.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_4.java,v
retrieving revision 1.24
diff -u -r1.24 JavadocTest_1_4.java
--- src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_4.java 21 Jun 2006 08:41:18 -0000 1.24
+++ src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_4.java 23 Jun 2006 07:47:52 -0000
@@ -20,6 +20,7 @@
String docCommentSupport = CompilerOptions.ENABLED;
String reportInvalidJavadoc = CompilerOptions.ERROR;
+ String reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
String reportMissingJavadocTags = CompilerOptions.ERROR;
String reportMissingJavadocComments = null;
String reportMissingJavadocCommentsVisibility = null;
@@ -50,6 +51,9 @@
Map options = super.getCompilerOptions();
options.put(CompilerOptions.OPTION_DocCommentSupport, this.docCommentSupport);
options.put(CompilerOptions.OPTION_ReportInvalidJavadoc, reportInvalidJavadoc);
+ if (!CompilerOptions.IGNORE.equals(reportInvalidJavadoc)) {
+ options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsVisibility, this.reportInvalidJavadocVisibility);
+ }
if (reportMissingJavadocComments != null)
options.put(CompilerOptions.OPTION_ReportMissingJavadocComments, reportMissingJavadocComments);
else
@@ -72,9 +76,10 @@
protected void setUp() throws Exception {
super.setUp();
this.docCommentSupport = CompilerOptions.ENABLED;
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportMissingJavadocTags = CompilerOptions.ERROR;
- reportMissingJavadocComments = CompilerOptions.IGNORE;
+ this.reportInvalidJavadoc = CompilerOptions.ERROR;
+ this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
+ this.reportMissingJavadocTags = CompilerOptions.ERROR;
+ this.reportMissingJavadocComments = CompilerOptions.IGNORE;
}
/**
@@ -2817,6 +2822,506 @@
}
/**
+ * Bug 96237: [javadoc] Inner types must be qualified
+ * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=96237"
+ */
+ public void testBug96237_Public01() {
+ this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
+ runConformTest(
+ new String[] {
+ "comment6/Valid.java",
+ "package comment6;\n" +
+ "public class Valid {\n" +
+ " /**\n" +
+ " * @see Valid.Inner\n" +
+ " */\n" +
+ " public class Inner { }\n" +
+ "}\n" +
+ "/**\n" +
+ " * See also {@link Valid.Inner}\n" +
+ " */\n" +
+ "class Sub2 extends Valid { }"
+ }
+ );
+ }
+ public void testBug96237_Public02() {
+ this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
+ runNegativeTest(
+ new String[] {
+ "comment6/Invalid.java",
+ "package comment6;\n" +
+ "public class Invalid {\n" +
+ " /**\n" +
+ " * @see Inner\n" +
+ " */\n" +
+ " public class Inner { }\n" +
+ "}\n" +
+ "/**\n" +
+ " * See also {@link Inner} \n" +
+ " */\n" +
+ "class Sub1 extends Invalid { }\n"
+ },
+// comment6\Invalid.java:6: warning - Tag @see: reference not found: Inner
+ "----------\n" +
+ "1. ERROR in comment6\\Invalid.java (at line 4)\r\n" +
+ " * @see Inner\r\n" +
+ " ^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n"
+ );
+ }
+ public void testBug96237_Public03() {
+ this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
+ runNegativeTest(
+ new String[] {
+ "comment6a/def/Test.java",
+ "package comment6a.def;\n" +
+ "public class Test {\n" +
+ " /**\n" +
+ " * @see Inner\n" +
+ " */\n" +
+ " public class Inner { }\n" +
+ "}\n",
+ "comment6a/test/Invalid.java",
+ "package comment6a.test;\n" +
+ "import comment6a.def.Test;\n" +
+ "/**\n" +
+ " * See also {@link Inner}\n" +
+ " */\n" +
+ "public class Invalid extends Test { \n" +
+ "}",
+ "comment6a/test/Invalid2.java",
+ "package comment6a.test;\n" +
+ "import comment6a.def.Test;\n" +
+ "/**\n" +
+ " * @see Test.Inner\n" +
+ " */\n" +
+ "public class Invalid2 extends Test { \n" +
+ "}"
+ },
+// comment6a\def\Test.java:6: warning - Tag @see: reference not found: Inner
+// comment6a\test\Invalid.java:8: warning - Tag @link: reference not found: Inner
+// comment6a\test\Invalid2.java:8: warning - Tag @see: reference not found: Test.Inner
+ "----------\n" +
+ "1. ERROR in comment6a\\def\\Test.java (at line 4)\n" +
+ " * @see Inner\n" +
+ " ^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in comment6a\\test\\Invalid.java (at line 4)\n" +
+ " * See also {@link Inner}\n" +
+ " ^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in comment6a\\test\\Invalid2.java (at line 4)\n" +
+ " * @see Test.Inner\n" +
+ " ^^^^^^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n"
+ );
+ }
+ public void testBug96237_Public04() {
+ this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
+ runNegativeTest(
+ new String[] {
+ "comment6b/Invalid.java",
+ "package comment6b;\n" +
+ "\n" +
+ "/**\n" +
+ " * @see Inner\n" +
+ " */\n" +
+ "public class Invalid implements Test { \n" +
+ "}",
+ "comment6b/Test.java",
+ "package comment6b;\n" +
+ "public interface Test {\n" +
+ " /**\n" +
+ " * @see Inner\n" +
+ " */\n" +
+ " public class Inner { }\n" +
+ "}\n",
+ "comment6b/Valid.java",
+ "package comment6b;\n" +
+ "\n" +
+ "/**\n" +
+ " * @see Test.Inner\n" +
+ " */\n" +
+ "public class Valid implements Test { \n" +
+ "}"
+ },
+// comment6b\Test.java:6: warning - Tag @see: reference not found: Inner
+// comment6b\Invalid.java:6: warning - Tag @see: reference not found: Inner
+ "----------\n" +
+ "1. ERROR in comment6b\\Invalid.java (at line 4)\n" +
+ " * @see Inner\n" +
+ " ^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in comment6b\\Test.java (at line 4)\n" +
+ " * @see Inner\n" +
+ " ^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n"
+ );
+ }
+ public void testBug96237_Public05() {
+ this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
+ runNegativeTest(
+ new String[] {
+ "test/a/Test.java",
+ "package test.a;\n" +
+ "/**\n" +
+ " * @see Inner\n" +
+ " * @see Test.Inner\n" +
+ " */\n" +
+ "public class Test {\n" +
+ " class Inner {}\n" +
+ "}\n"
+ },
+// test\a\Test.java:6: warning - Tag @see: reference not found: Inner
+// test\a\Test.java:6: warning - Tag @see: reference not found: Test.Inner
+ "----------\n" +
+ "1. ERROR in test\\a\\Test.java (at line 3)\n" +
+ " * @see Inner\n" +
+ " ^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n" +
+ "2. ERROR in test\\a\\Test.java (at line 4)\n" +
+ " * @see Test.Inner\n" +
+ " ^^^^^^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n"
+ );
+ }
+ public void testBug96237_Public06() {
+ this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
+ runNegativeTest(
+ new String[] {
+ "test/b/Test.java",
+ "package test.b;\n" +
+ "/** \n" +
+ " * @see Inner.Level2\n" +
+ " * @see Test.Inner.Level2\n" +
+ " */\n" +
+ "public class Test {\n" +
+ " /** \n" +
+ " * @see Level2\n" +
+ " * @see Test.Inner.Level2\n" +
+ " */\n" +
+ " public class Inner {\n" +
+ " class Level2 {}\n" +
+ " }\n" +
+ "}\n"
+ },
+// test\b\Test.java:6: warning - Tag @see: reference not found: Inner.Level2
+// test\b\Test.java:6: warning - Tag @see: reference not found: Test.Inner.Level2
+// test\b\Test.java:11: warning - Tag @see: reference not found: Level2
+// test\b\Test.java:11: warning - Tag @see: reference not found: Test.Inner.Level2
+ "----------\n" +
+ "1. ERROR in test\\b\\Test.java (at line 3)\n" +
+ " * @see Inner.Level2\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n" +
+ "2. ERROR in test\\b\\Test.java (at line 4)\n" +
+ " * @see Test.Inner.Level2\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n" +
+ "3. ERROR in test\\b\\Test.java (at line 8)\n" +
+ " * @see Level2\n" +
+ " ^^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n" +
+ "4. ERROR in test\\b\\Test.java (at line 9)\n" +
+ " * @see Test.Inner.Level2\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n"
+ );
+ }
+ public void testBug96237_Public07() {
+ this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
+ runNegativeTest(
+ new String[] {
+ "test/c/Test.java",
+ "package test.c;\n" +
+ "/**\n" +
+ " * @see Inner.Level2.Level3\n" +
+ " * @see Test.Inner.Level2.Level3\n" +
+ " */\n" +
+ "public class Test {\n" +
+ " public class Inner {\n" +
+ " /**\n" +
+ " * @see Level3\n" +
+ " * @see Level2.Level3\n" +
+ " * @see Inner.Level2.Level3\n" +
+ " * @see Test.Inner.Level2.Level3\n" +
+ " */\n" +
+ " public class Level2 {\n" +
+ " class Level3 {\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ "}\n"
+ },
+// test\c\Test.java:6: warning - Tag @see: reference not found: Inner.Level2.Level3
+// test\c\Test.java:6: warning - Tag @see: reference not found: Test.Inner.Level2.Level3
+// test\c\Test.java:14: warning - Tag @see: reference not found: Level3
+// test\c\Test.java:14: warning - Tag @see: reference not found: Level2.Level3
+// test\c\Test.java:14: warning - Tag @see: reference not found: Inner.Level2.Level3
+// test\c\Test.java:14: warning - Tag @see: reference not found: Test.Inner.Level2.Level3
+ "----------\n" +
+ "1. ERROR in test\\c\\Test.java (at line 3)\n" +
+ " * @see Inner.Level2.Level3\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n" +
+ "2. ERROR in test\\c\\Test.java (at line 4)\n" +
+ " * @see Test.Inner.Level2.Level3\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n" +
+ "3. ERROR in test\\c\\Test.java (at line 9)\n" +
+ " * @see Level3\n" +
+ " ^^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n" +
+ "4. ERROR in test\\c\\Test.java (at line 10)\n" +
+ " * @see Level2.Level3\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n" +
+ "5. ERROR in test\\c\\Test.java (at line 11)\n" +
+ " * @see Inner.Level2.Level3\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n" +
+ "6. ERROR in test\\c\\Test.java (at line 12)\n" +
+ " * @see Test.Inner.Level2.Level3\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n"
+ );
+ }
+ public void testBug96237_Private01() {
+ this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
+ runConformTest(
+ new String[] {
+ "comment6/Valid.java",
+ "package comment6;\n" +
+ "public class Valid {\n" +
+ " /**\n" +
+ " * @see Valid.Inner\n" +
+ " */\n" +
+ " public class Inner { }\n" +
+ "}\n" +
+ "/**\n" +
+ " * See also {@link Valid.Inner}\n" +
+ " */\n" +
+ "class Sub2 extends Valid { }"
+ }
+ );
+ }
+ public void testBug96237_Private02() {
+ this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
+ runNegativeTest(
+ new String[] {
+ "comment6/Invalid.java",
+ "package comment6;\n" +
+ "public class Invalid {\n" +
+ " /**\n" +
+ " * @see Inner\n" +
+ " */\n" +
+ " public class Inner { }\n" +
+ "}\n" +
+ "/**\n" +
+ " * See also {@link Inner} \n" +
+ " */\n" +
+ "class Sub1 extends Invalid { }\n"
+ },
+// comment6\Invalid.java:6: warning - Tag @see: reference not found: Inner
+// comment6\Invalid.java:11: warning - Tag @link: reference not found: Inner
+ "----------\n" +
+ "1. ERROR in comment6\\Invalid.java (at line 4)\n" +
+ " * @see Inner\n" +
+ " ^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n" +
+ "2. ERROR in comment6\\Invalid.java (at line 9)\n" +
+ " * See also {@link Inner} \n" +
+ " ^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n"
+ );
+ }
+ public void testBug96237_Private03() {
+ this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
+ runNegativeTest(
+ new String[] {
+ "comment6a/def/Test.java",
+ "package comment6a.def;\n" +
+ "public class Test {\n" +
+ " /**\n" +
+ " * @see Inner\n" +
+ " */\n" +
+ " public class Inner { }\n" +
+ "}\n",
+ "comment6a/test/Invalid.java",
+ "package comment6a.test;\n" +
+ "import comment6a.def.Test;\n" +
+ "/**\n" +
+ " * See also {@link Inner}\n" +
+ " */\n" +
+ "public class Invalid extends Test { \n" +
+ "}",
+ "comment6a/test/Invalid2.java",
+ "package comment6a.test;\n" +
+ "import comment6a.def.Test;\n" +
+ "/**\n" +
+ " * @see Test.Inner\n" +
+ " */\n" +
+ "public class Invalid2 extends Test { \n" +
+ "}"
+ },
+// comment6a\def\Test.java:6: warning - Tag @see: reference not found: Inner
+// comment6a\test\Invalid.java:8: warning - Tag @link: reference not found: Inner
+// comment6a\test\Invalid2.java:8: warning - Tag @see: reference not found: Test.Inner
+ "----------\n" +
+ "1. ERROR in comment6a\\def\\Test.java (at line 4)\n" +
+ " * @see Inner\n" +
+ " ^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in comment6a\\test\\Invalid.java (at line 4)\n" +
+ " * See also {@link Inner}\n" +
+ " ^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in comment6a\\test\\Invalid2.java (at line 4)\n" +
+ " * @see Test.Inner\n" +
+ " ^^^^^^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n"
+ );
+ }
+ public void testBug96237_Private04() {
+ this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
+ runNegativeTest(
+ new String[] {
+ "comment6b/Invalid.java",
+ "package comment6b;\n" +
+ "\n" +
+ "/**\n" +
+ " * @see Inner\n" +
+ " */\n" +
+ "public class Invalid implements Test { \n" +
+ "}",
+ "comment6b/Test.java",
+ "package comment6b;\n" +
+ "public interface Test {\n" +
+ " /**\n" +
+ " * @see Inner\n" +
+ " */\n" +
+ " public class Inner { }\n" +
+ "}\n",
+ "comment6b/Valid.java",
+ "package comment6b;\n" +
+ "\n" +
+ "/**\n" +
+ " * @see Test.Inner\n" +
+ " */\n" +
+ "public class Valid implements Test { \n" +
+ "}"
+ },
+// comment6b\Invalid.java:6: warning - Tag @see: reference not found: Inner
+// comment6b\Test.java:6: warning - Tag @see: reference not found: Inner
+ "----------\n" +
+ "1. ERROR in comment6b\\Invalid.java (at line 4)\n" +
+ " * @see Inner\n" +
+ " ^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in comment6b\\Test.java (at line 4)\n" +
+ " * @see Inner\n" +
+ " ^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n"
+ );
+ }
+ public void testBug96237_Private05() {
+ this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
+ runConformTest(
+ new String[] {
+ "test/a/Test.java",
+ "package test.a;\n" +
+ "/**\n" +
+ " * @see Inner\n" +
+ " * @see Test.Inner\n" +
+ " */\n" +
+ "public class Test {\n" +
+ " class Inner {}\n" +
+ "}\n"
+ }
+ );
+ }
+ public void testBug96237_Private06() {
+ this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
+ runConformTest(
+ new String[] {
+ "test/b/Test.java",
+ "package test.b;\n" +
+ "/** \n" +
+ " * @see Inner.Level2\n" +
+ " * @see Test.Inner.Level2\n" +
+ " */\n" +
+ "public class Test {\n" +
+ " /** \n" +
+ " * @see Level2\n" +
+ " * @see Test.Inner.Level2\n" +
+ " */\n" +
+ " public class Inner {\n" +
+ " class Level2 {}\n" +
+ " }\n" +
+ "}\n"
+ }
+ );
+ }
+ public void testBug96237_Private07() {
+ this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
+ runConformTest(
+ new String[] {
+ "test/c/Test.java",
+ "package test.c;\n" +
+ "/**\n" +
+ " * @see Inner.Level2.Level3\n" +
+ " * @see Test.Inner.Level2.Level3\n" +
+ " */\n" +
+ "public class Test {\n" +
+ " public class Inner {\n" +
+ " /**\n" +
+ " * @see Level3\n" +
+ " * @see Level2.Level3\n" +
+ " * @see Inner.Level2.Level3\n" +
+ " * @see Test.Inner.Level2.Level3\n" +
+ " */\n" +
+ " public class Level2 {\n" +
+ " class Level3 {\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ "}\n"
+ }
+ );
+ }
+
+ /**
* Bug 101283: [1.5][javadoc] Javadoc validation raises missing implementation in compiler
* @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=101283"
*/
@@ -3013,6 +3518,343 @@
}
/**
+ * Bug 103304: [Javadoc] Wrong reference proposal for inner classes.
+ * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=103304"
+ */
+ public void testBug103304a() {
+ runNegativeTest(
+ new String[] {
+ "boden/IAFAState.java",
+ "package boden;\n" +
+ "public interface IAFAState {\n" +
+ " public class ValidationException extends Exception {\n" +
+ " public ValidationException(String variableName, IAFAState subformula) {\n" +
+ " super(\"Variable \'\"+variableName+\"\' may be unbound in \'\"+subformula+\"\'\");\n" +
+ " }\n" +
+ " public void method() {}\n" +
+ " }\n" +
+ " /**\n" +
+ " * Validates a formula for consistent bindings. Bindings are consistent, when at each point in time,\n" +
+ " * the set of povided variables can be guaranteed to be a superset of the set of required variables.\n" +
+ " * @throws ValidationException Thrown if a variable is unbound. \n" +
+ " * @see ValidationException#IAFAState.ValidationException(String, IAFAState)\n" +
+ " * @see IAFAState.ValidationException#method()\n" +
+ " * @see ValidationException\n" +
+ " * {@link ValidationException}\n" +
+ " */\n" +
+ " public void validate() throws ValidationException;\n" +
+ "}\n",
+ "boden/TestValid.java",
+ "package boden;\n" +
+ "import boden.IAFAState.ValidationException;\n" +
+ "/**\n" +
+ " * @see ValidationException\n" +
+ " * @see IAFAState.ValidationException\n" +
+ " */\n" +
+ "public class TestValid {\n" +
+ " /** \n" +
+ " * @see ValidationException#IAFAState.ValidationException(String, IAFAState)\n" +
+ " */\n" +
+ " IAFAState.ValidationException valid1;\n" +
+ " /**\n" +
+ " * @see IAFAState.ValidationException#IAFAState.ValidationException(String, IAFAState)\n" +
+ " */\n" +
+ " IAFAState.ValidationException valid2;\n" +
+ "}\n"
+ },
+// boden\TestValid.java:8: warning - Tag @see: reference not found: ValidationException
+// boden\TestValid.java:12: warning - Tag @see: reference not found: ValidationException#IAFAState.ValidationException(String, IAFAState)
+ "----------\n" +
+ "1. ERROR in boden\\TestValid.java (at line 4)\r\n" +
+ " * @see ValidationException\r\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n"
+ );
+ }
+ public void testBug103304b() {
+ runNegativeTest(
+ new String[] {
+ "boden/IAFAState.java",
+ "package boden;\n" +
+ "public interface IAFAState {\n" +
+ " public class ValidationException extends Exception {\n" +
+ " public ValidationException(String variableName, IAFAState subformula) {\n" +
+ " super(\"Variable \'\"+variableName+\"\' may be unbound in \'\"+subformula+\"\'\");\n" +
+ " }\n" +
+ " public void method() {}\n" +
+ " }\n" +
+ "}\n",
+ "boden/TestInvalid1.java",
+ "package boden;\n" +
+ "import boden.IAFAState.ValidationException;\n" +
+ "public class TestInvalid1 {\n" +
+ " /** \n" +
+ " * @see ValidationException#ValidationException(String, IAFAState)\n" +
+ " */ \n" +
+ " IAFAState.ValidationException invalid;\n" +
+ "}\n",
+ "boden/TestInvalid2.java",
+ "package boden;\n" +
+ "import boden.IAFAState.ValidationException;\n" +
+ "public class TestInvalid2 {\n" +
+ " /**\n" +
+ " * @see IAFAState.ValidationException#ValidationException(String, IAFAState)\n" +
+ " */\n" +
+ " IAFAState.ValidationException invalid;\n" +
+ "}\n",
+ "boden/TestInvalid3.java",
+ "package boden;\n" +
+ "import boden.IAFAState.ValidationException;\n" +
+ "public class TestInvalid3 {\n" +
+ " /**\n" +
+ " * @see IAFAState.ValidationException#IAFA.State.ValidationException(String, IAFAState)\n" +
+ " */\n" +
+ " IAFAState.ValidationException invalid;\n" +
+ "}\n",
+ "boden/TestInvalid4.java",
+ "package boden;\n" +
+ "import boden.IAFAState.ValidationException;\n" +
+ "public class TestInvalid4 {\n" +
+ " /**\n" +
+ " * @see IAFAState.ValidationException#IAFAState .ValidationException(String, IAFAState)\n" +
+ " */\n" +
+ " IAFAState.ValidationException invalid;\n" +
+ "}\n"
+ },
+// boden\TestInvalid1.java:7: warning - Tag @see: reference not found: ValidationException#ValidationException(String, IAFAState)
+// boden\TestInvalid2.java:6: warning - Tag @see: can't find ValidationException(String, IAFAState) in boden.IAFAState.ValidationException
+// boden\TestInvalid3.java:6: warning - Tag @see: can't find IAFA.State.ValidationException(String, IAFAState) in boden.IAFAState.ValidationException
+// boden\TestInvalid4.java:6: warning - Tag @see: can't find IAFAState in boden.IAFAState.ValidationException
+ "----------\n" +
+ "1. ERROR in boden\\TestInvalid1.java (at line 5)\n" +
+ " * @see ValidationException#ValidationException(String, IAFAState)\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Invalid qualification for member type constructor\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in boden\\TestInvalid2.java (at line 5)\n" +
+ " * @see IAFAState.ValidationException#ValidationException(String, IAFAState)\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Invalid qualification for member type constructor\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in boden\\TestInvalid3.java (at line 5)\n" +
+ " * @see IAFAState.ValidationException#IAFA.State.ValidationException(String, IAFAState)\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Invalid qualification for member type constructor\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in boden\\TestInvalid4.java (at line 5)\n" +
+ " * @see IAFAState.ValidationException#IAFAState .ValidationException(String, IAFAState)\n" +
+ " ^^^^^^^^^\n" +
+ "Javadoc: IAFAState cannot be resolved or is not a field\n" +
+ "----------\n"
+ );
+ }
+ public void testBug103304c() {
+ runNegativeTest(
+ new String[] {
+ "test/Test.java",
+ "package test;\n" +
+ "public interface Test {\n" +
+ " public class Level0 {\n" +
+ " public Level0() {}\n" +
+ " }\n" +
+ " public interface Member {\n" +
+ " public class Level1 {\n" +
+ " public Level1() {}\n" +
+ " }\n" +
+ " }\n" +
+ "}\n",
+ "test/C.java",
+ "package test;\n" +
+ "public class C {\n" +
+ " /**\n" +
+ " * @see Test.Level0#Test.Level0()\n" +
+ " */\n" +
+ " Test.Level0 valid = new Test.Level0();\n" +
+ " /**\n" +
+ " * @see Test.Level0#Level0()\n" +
+ " */\n" +
+ " Test.Level0 invalid = new Test.Level0();\n" +
+ "}\n"
+ },
+// test\C.java:10: warning - Tag @see: can't find Level0() in test.Test.Level0
+ "----------\n" +
+ "1. ERROR in test\\C.java (at line 8)\n" +
+ " * @see Test.Level0#Level0()\n" +
+ " ^^^^^^^^\n" +
+ "Javadoc: Invalid qualification for member type constructor\n" +
+ "----------\n"
+ );
+ }
+ public void testBug103304d() {
+ runNegativeTest(
+ new String[] {
+ "test/Test.java",
+ "package test;\n" +
+ "public interface Test {\n" +
+ " public class Level0 {\n" +
+ " public Level0() {}\n" +
+ " }\n" +
+ " public interface Member {\n" +
+ " public class Level1 {\n" +
+ " public Level1() {}\n" +
+ " }\n" +
+ " }\n" +
+ "}\n",
+ "test/C2.java",
+ "package test;\n" +
+ "public class C2 {\n" +
+ " /**\n" +
+ " * @see Test.Member.Level1#Test.Member.Level1()\n" +
+ " */\n" +
+ " Test.Member.Level1 valid = new Test.Member.Level1();\n" +
+ " /**\n" +
+ " * @see Test.Member.Level1#Level1()\n" +
+ " */\n" +
+ " Test.Member.Level1 invalid = new Test.Member.Level1();\n" +
+ " /**\n" +
+ " * @see Test.Member.Level1#Test.Level1()\n" +
+ " */\n" +
+ " Test.Member.Level1 wrong = new Test.Member.Level1();\n" +
+ "}\n"
+ },
+// test\C2.java:10: warning - Tag @see: can't find Level1() in test.Test.Member.Level1
+// test\C2.java:14: warning - Tag @see: can't find Test.Level1() in test.Test.Member.Level1
+ "----------\n" +
+ "1. ERROR in test\\C2.java (at line 8)\n" +
+ " * @see Test.Member.Level1#Level1()\n" +
+ " ^^^^^^^^\n" +
+ "Javadoc: Invalid qualification for member type constructor\n" +
+ "----------\n" +
+ "2. ERROR in test\\C2.java (at line 12)\n" +
+ " * @see Test.Member.Level1#Test.Level1()\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Javadoc: Invalid qualification for member type constructor\n" +
+ "----------\n"
+ );
+ }
+ public void testBug103304e() {
+ runConformTest(
+ new String[] {
+ "implicit/Valid.java",
+ "package implicit;\n" +
+ "public interface Valid {\n" +
+ " public class Level0 {\n" +
+ " /**\n" +
+ " * @see #Valid.Level0() Valid\n" +
+ " */\n" +
+ " public Level0() {}\n" +
+ " /**\n" +
+ " * @see #Valid.Level0(String) Valid\n" +
+ " */\n" +
+ " public Level0(String str) {}\n" +
+ " }\n" +
+ " public interface Member {\n" +
+ " public class Level1 {\n" +
+ " /**\n" +
+ " * @see #Valid.Member.Level1() Valid\n" +
+ " */\n" +
+ " public Level1() {}\n" +
+ " /**\n" +
+ " * @see #Valid.Member.Level1(int) Valid\n" +
+ " */\n" +
+ " public Level1(int x) {}\n" +
+ " }\n" +
+ " }\n" +
+ "}\n"
+ }
+ );
+ }
+ public void testBug103304f() {
+ runNegativeTest(
+ new String[] {
+ "implicit/Invalid.java",
+ "package implicit;\n" +
+ "public interface Invalid {\n" +
+ " public class Level0 {\n" +
+ " /**\n" +
+ " * @see #Level0() Invalid\n" +
+ " */\n" +
+ " public Level0() {}\n" +
+ " /**\n" +
+ " * @see #Level0(String) Invalid\n" +
+ " */\n" +
+ " public Level0(String str) {}\n" +
+ " }\n" +
+ " public interface Member {\n" +
+ " public class Level1 {\n" +
+ " /**\n" +
+ " * @see #Level1() Invalid\n" +
+ " * @see #Member.Level1() Invalid\n" +
+ " * @see #Invalid.Level1() Invalid\n" +
+ " */\n" +
+ " public Level1() {}\n" +
+ " /**\n" +
+ " * @see #Level1(int) Invalid\n" +
+ " * @see #Invalid.Level1(int) Invalid\n" +
+ " * @see #Member.Level1(int) Invalid\n" +
+ " */\n" +
+ " public Level1(int x) {}\n" +
+ " }\n" +
+ " }\n" +
+ "}\n"
+ },
+// implicit\Invalid.java:7: warning - Tag @see: can't find Level0() in implicit.Invalid.Level0
+// implicit\Invalid.java:11: warning - Tag @see: can't find Level0(String) in implicit.Invalid.Level0
+// implicit\Invalid.java:20: warning - Tag @see: can't find Level1() in implicit.Invalid.Member.Level1
+// implicit\Invalid.java:20: warning - Tag @see: can't find Member.Level1() in implicit.Invalid.Member.Level1
+// implicit\Invalid.java:20: warning - Tag @see: can't find Invalid.Level1() in implicit.Invalid.Member.Level1
+// implicit\Invalid.java:26: warning - Tag @see: can't find Level1(int) in implicit.Invalid.Member.Level1
+// implicit\Invalid.java:26: warning - Tag @see: can't find Invalid.Level1(int) in implicit.Invalid.Member.Level1
+// implicit\Invalid.java:26: warning - Tag @see: can't find Member.Level1(int) in implicit.Invalid.Member.Level1
+ "----------\n" +
+ "1. ERROR in implicit\\Invalid.java (at line 5)\n" +
+ " * @see #Level0() Invalid\n" +
+ " ^^^^^^^^\n" +
+ "Javadoc: Invalid qualification for member type constructor\n" +
+ "----------\n" +
+ "2. ERROR in implicit\\Invalid.java (at line 9)\n" +
+ " * @see #Level0(String) Invalid\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Javadoc: Invalid qualification for member type constructor\n" +
+ "----------\n" +
+ "3. ERROR in implicit\\Invalid.java (at line 16)\n" +
+ " * @see #Level1() Invalid\n" +
+ " ^^^^^^^^\n" +
+ "Javadoc: Invalid qualification for member type constructor\n" +
+ "----------\n" +
+ "4. ERROR in implicit\\Invalid.java (at line 17)\n" +
+ " * @see #Member.Level1() Invalid\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Invalid qualification for member type constructor\n" +
+ "----------\n" +
+ "5. ERROR in implicit\\Invalid.java (at line 18)\n" +
+ " * @see #Invalid.Level1() Invalid\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Invalid qualification for member type constructor\n" +
+ "----------\n" +
+ "6. ERROR in implicit\\Invalid.java (at line 22)\n" +
+ " * @see #Level1(int) Invalid\n" +
+ " ^^^^^^^^^^^\n" +
+ "Javadoc: Invalid qualification for member type constructor\n" +
+ "----------\n" +
+ "7. ERROR in implicit\\Invalid.java (at line 23)\n" +
+ " * @see #Invalid.Level1(int) Invalid\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Invalid qualification for member type constructor\n" +
+ "----------\n" +
+ "8. ERROR in implicit\\Invalid.java (at line 24)\n" +
+ " * @see #Member.Level1(int) Invalid\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Invalid qualification for member type constructor\n" +
+ "----------\n"
+ );
+ }
+
+ /**
* Bug 112346: [javadoc] {@inheritedDoc} should be inactive for non-overridden method
* @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=112346"
*/
Index: src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForMethod.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForMethod.java,v
retrieving revision 1.21
diff -u -r1.21 JavadocTestForMethod.java
--- src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForMethod.java 9 Jun 2006 10:20:55 -0000 1.21
+++ src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForMethod.java 23 Jun 2006 07:47:48 -0000
@@ -2018,18 +2018,21 @@
this.runConformReferenceTest(
new String[] {
"test/X.java",
- "package test;\n"
- + "import test.copy.*;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Valid external classes references \n"
- + " *\n"
- + " * @see VisibilityPublic Valid ref: visible class through import => no warning on import\n"
- + " * @see VisibilityPublic.VpPublic Valid ref: visible inner class in visible class \n"
- + " */\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" });
+ "package test;\n" +
+ "import test.copy.*;\n" +
+ "public class X {\n" +
+ " /**\n" +
+ " * Valid external classes references \n" +
+ " *\n" +
+ " * @see VisibilityPublic Valid ref: visible class through import => no warning on import\n" +
+ // Inner classes are not visible in generated documentation
+ //" * @see VisibilityPublic.VpPublic Valid ref: visible inner class in visible class \n" +
+ " */\n" +
+ " public void s_foo() {\n" +
+ " }\n" +
+ "}\n"
+ }
+ );
}
public void test093() {
@@ -2077,17 +2080,20 @@
this.runConformReferenceTest(
new String[] {
"test/X.java",
- "package test;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Valid external classes references \n"
- + " *\n"
- + " * @see test.copy.VisibilityPublic Valid ref: visible class through import => no warning on import\n"
- + " * @see test.copy.VisibilityPublic.VpPublic Valid ref: visible inner class in visible class \n"
- + " */\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" });
+ "package test;\n" +
+ "public class X {\n" +
+ " /**\n" +
+ " * Valid external classes references \n" +
+ " *\n" +
+ " * @see test.copy.VisibilityPublic Valid ref: visible class through import => no warning on import\n" +
+ // Inner classes are not visible in generated documentation
+ //" * @see test.copy.VisibilityPublic.VpPublic Valid ref: visible inner class in visible class \n" +
+ " */\n" +
+ " public void s_foo() {\n" +
+ " }\n" +
+ "}\n"
+ }
+ );
}
public void test095() {
Index: src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest.java,v
retrieving revision 1.37
diff -u -r1.37 JavadocTest.java
--- src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest.java 30 Mar 2006 15:26:50 -0000 1.37
+++ src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest.java 23 Jun 2006 07:47:43 -0000
@@ -100,6 +100,7 @@
options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsDeprecatedRef, CompilerOptions.ENABLED);
options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsNotVisibleRef, CompilerOptions.ENABLED);
options.put(CompilerOptions.OPTION_ReportMissingJavadocTagsVisibility, CompilerOptions.PRIVATE);
+ options.put(CompilerOptions.OPTION_ReportMissingSerialVersion, CompilerOptions.IGNORE);
return options;
}
@@ -120,154 +121,154 @@
referencedClasses =
new String[] {
"test/AbstractVisibility.java",
- "package test;\n"
- + "public abstract class AbstractVisibility {\n"
- + " private class AvcPrivate {\n"
- + " private int avf_private = 10;\n"
- + " public int avf_public = avf_private;\n"
- + " private int avm_private() {\n"
- + " avf_private = (new AvcPrivate()).avf_private;\n"
- + " return avf_private;\n"
- + " }\n"
- + " public int avm_public() {\n"
- + " return avm_private();\n"
- + " }\n"
- + " }\n"
- + " public class AvcPublic {\n"
- + " private int avf_private = 10;\n"
- + " public int avf_public = avf_private;\n"
- + " private int avm_private() {\n"
- + " avf_private = (new AvcPrivate()).avf_private;\n"
- + " return avf_private;\n"
- + " }\n"
- + " public int avm_public() {\n"
- + " return avm_private();\n"
- + " }\n"
- + " }\n"
- + " private int avf_private = 100;\n"
- + " public int avf_public = avf_private;\n"
- + " \n"
- + " private int avm_private() {\n"
- + " avf_private = (new AvcPrivate()).avf_private;\n"
- + " return avf_private;\n"
- + " }\n"
- + " public int avm_public() {\n"
- + " return avm_private();\n"
- + " }\n"
- + "}\n",
+ "package test;\n" +
+ "public abstract class AbstractVisibility {\n" +
+ " private class AvcPrivate {\n" +
+ " private int avf_private = 10;\n" +
+ " public int avf_public = avf_private;\n" +
+ " private int avm_private() {\n" +
+ " avf_private = (new AvcPrivate()).avf_private;\n" +
+ " return avf_private;\n" +
+ " }\n" +
+ " public int avm_public() {\n" +
+ " return avm_private();\n" +
+ " }\n" +
+ " }\n" +
+ " public class AvcPublic {\n" +
+ " private int avf_private = 10;\n" +
+ " public int avf_public = avf_private;\n" +
+ " private int avm_private() {\n" +
+ " avf_private = (new AvcPrivate()).avf_private;\n" +
+ " return avf_private;\n" +
+ " }\n" +
+ " public int avm_public() {\n" +
+ " return avm_private();\n" +
+ " }\n" +
+ " }\n" +
+ " private int avf_private = 100;\n" +
+ " public int avf_public = avf_private;\n" +
+ " \n" +
+ " private int avm_private() {\n" +
+ " avf_private = (new AvcPrivate()).avf_private;\n" +
+ " return avf_private;\n" +
+ " }\n" +
+ " public int avm_public() {\n" +
+ " return avm_private();\n" +
+ " }\n" +
+ "}\n",
"test/Visibility.java",
- "package test;\n"
- + "public class Visibility extends AbstractVisibility {\n"
- + " private class VcPrivate {\n"
- + " private int vf_private = 10;\n"
- + " public int vf_public = vf_private;\n"
- + " private int vm_private() {\n"
- + " vf_private = (new VcPrivate()).vf_private;\n"
- + " avf_private = vf_private;\n"
- + " return vf_private+avf_private;\n"
- + " }\n"
- + " public int vm_public() {\n"
- + " return vm_private();\n"
- + " }\n"
- + " };\n"
- + " public class VcPublic {\n"
- + " private int vf_private = 10;\n"
- + " public int vf_public = vf_private;\n"
- + " private int vm_private() {\n"
- + " vf_private = (new VcPrivate()).vf_private;\n"
- + " avf_private = vf_private;\n"
- + " return vf_private+avf_private;\n"
- + " }\n"
- + " public int vm_public() {\n"
- + " return vm_private();\n"
- + " }\n"
- + " };\n"
- + " private int vf_private = 100;\n"
- + " private int avf_private = 100;\n"
- + " public int vf_public = vf_private;\n"
- + " public int avf_public = vf_private;\n"
- + " \n"
- + " private int vm_private() {\n"
- + " vf_private = (new VcPrivate()).vf_private;\n"
- + " avf_private = vf_private;\n"
- + " return vf_private+avf_private;\n"
- + " }\n"
- + " public int vm_public() {\n"
- + " return vm_private();\n"
- + " }\n"
- + "}\n",
+ "package test;\n" +
+ "public class Visibility extends AbstractVisibility {\n" +
+ " private class VcPrivate {\n" +
+ " private int vf_private = 10;\n" +
+ " public int vf_public = vf_private;\n" +
+ " private int vm_private() {\n" +
+ " vf_private = (new VcPrivate()).vf_private;\n" +
+ " avf_private = vf_private;\n" +
+ " return vf_private+avf_private;\n" +
+ " }\n" +
+ " public int vm_public() {\n" +
+ " return vm_private();\n" +
+ " }\n" +
+ " };\n" +
+ " public class VcPublic {\n" +
+ " private int vf_private = 10;\n" +
+ " public int vf_public = vf_private;\n" +
+ " private int vm_private() {\n" +
+ " vf_private = (new VcPrivate()).vf_private;\n" +
+ " avf_private = vf_private;\n" +
+ " return vf_private+avf_private;\n" +
+ " }\n" +
+ " public int vm_public() {\n" +
+ " return vm_private();\n" +
+ " }\n" +
+ " };\n" +
+ " private int vf_private = 100;\n" +
+ " private int avf_private = 100;\n" +
+ " public int vf_public = vf_private;\n" +
+ " public int avf_public = vf_private;\n" +
+ " \n" +
+ " private int vm_private() {\n" +
+ " vf_private = (new VcPrivate()).vf_private;\n" +
+ " avf_private = vf_private;\n" +
+ " return vf_private+avf_private;\n" +
+ " }\n" +
+ " public int vm_public() {\n" +
+ " return vm_private();\n" +
+ " }\n" +
+ "}\n",
"test/copy/VisibilityPackage.java",
- "package test.copy;\n"
- + "class VisibilityPackage {\n"
- + " private class VpPrivate {\n"
- + " private int vf_private = 10;\n"
- + " public int vf_public = vf_private;\n"
- + " private int vm_private() {\n"
- + " vf_private = (new VpPrivate()).vf_private;\n"
- + " return vf_private;\n"
- + " }\n"
- + " public int vm_public() {\n"
- + " return vm_private();\n"
- + " }\n"
- + " }\n"
- + " public class VpPublic {\n"
- + " private int vf_private = 10;\n"
- + " public int vf_public = vf_private;\n"
- + " private int vm_private() {\n"
- + " vf_private = (new VpPrivate()).vf_private;\n"
- + " return vf_private;\n"
- + " }\n"
- + " public int vm_public() {\n"
- + " return vm_private();\n"
- + " }\n"
- + " }\n"
- + " private int vf_private = 100;\n"
- + " public int vf_public = vf_private;\n"
- + " \n"
- + " private int vm_private() {\n"
- + " vf_private = (new VpPrivate()).vf_private;\n"
- + " return vf_private;\n"
- + " }\n"
- + " public int vm_public() {\n"
- + " return vm_private();\n"
- + " }\n"
- + "}\n",
+ "package test.copy;\n" +
+ "class VisibilityPackage {\n" +
+ " private class VpPrivate {\n" +
+ " private int vf_private = 10;\n" +
+ " public int vf_public = vf_private;\n" +
+ " private int vm_private() {\n" +
+ " vf_private = (new VpPrivate()).vf_private;\n" +
+ " return vf_private;\n" +
+ " }\n" +
+ " public int vm_public() {\n" +
+ " return vm_private();\n" +
+ " }\n" +
+ " }\n" +
+ " public class VpPublic {\n" +
+ " private int vf_private = 10;\n" +
+ " public int vf_public = vf_private;\n" +
+ " private int vm_private() {\n" +
+ " vf_private = (new VpPrivate()).vf_private;\n" +
+ " return vf_private;\n" +
+ " }\n" +
+ " public int vm_public() {\n" +
+ " return vm_private();\n" +
+ " }\n" +
+ " }\n" +
+ " private int vf_private = 100;\n" +
+ " public int vf_public = vf_private;\n" +
+ " \n" +
+ " private int vm_private() {\n" +
+ " vf_private = (new VpPrivate()).vf_private;\n" +
+ " return vf_private;\n" +
+ " }\n" +
+ " public int vm_public() {\n" +
+ " return vm_private();\n" +
+ " }\n" +
+ "}\n",
"test/copy/VisibilityPublic.java",
- "package test.copy;\n"
- + "public class VisibilityPublic {\n"
- + " private class VpPrivate {\n"
- + " private int vf_private = 10;\n"
- + " public int vf_public = vf_private;\n"
- + " private int vm_private() {\n"
- + " vf_private = (new VpPrivate()).vf_private;\n"
- + " return vf_private;\n"
- + " }\n"
- + " public int vm_public() {\n"
- + " return vm_private();\n"
- + " }\n"
- + " }\n"
- + " public class VpPublic {\n"
- + " private int vf_private = 10;\n"
- + " public int vf_public = vf_private;\n"
- + " private int vm_private() {\n"
- + " vf_private = (new VpPrivate()).vf_private;\n"
- + " return vf_private;\n"
- + " }\n"
- + " public int vm_public() {\n"
- + " return vm_private();\n"
- + " }\n"
- + " }\n"
- + " private int vf_private = 100;\n"
- + " public int vf_public = vf_private;\n"
- + " \n"
- + " private int vm_private() {\n"
- + " vf_private = (new VpPrivate()).vf_private;\n"
- + " return vf_private;\n"
- + " }\n"
- + " public int vm_public() {\n"
- + " return vm_private();\n"
- + " }\n"
- + "}\n" };
+ "package test.copy;\n" +
+ "public class VisibilityPublic {\n" +
+ " private class VpPrivate {\n" +
+ " private int vf_private = 10;\n" +
+ " public int vf_public = vf_private;\n" +
+ " private int vm_private() {\n" +
+ " vf_private = (new VpPrivate()).vf_private;\n" +
+ " return vf_private;\n" +
+ " }\n" +
+ " public int vm_public() {\n" +
+ " return vm_private();\n" +
+ " }\n" +
+ " }\n" +
+ " public class VpPublic {\n" +
+ " private int vf_private = 10;\n" +
+ " public int vf_public = vf_private;\n" +
+ " private int vm_private() {\n" +
+ " vf_private = (new VpPrivate()).vf_private;\n" +
+ " return vf_private;\n" +
+ " }\n" +
+ " public int vm_public() {\n" +
+ " return vm_private();\n" +
+ " }\n" +
+ " }\n" +
+ " private int vf_private = 100;\n" +
+ " public int vf_public = vf_private;\n" +
+ " \n" +
+ " private int vm_private() {\n" +
+ " vf_private = (new VpPrivate()).vf_private;\n" +
+ " return vf_private;\n" +
+ " }\n" +
+ " public int vm_public() {\n" +
+ " return vm_private();\n" +
+ " }\n" +
+ "}\n" };
}
/* (non-Javadoc)
* @see junit.framework.TestCase#setUp()
Index: src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForClass.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForClass.java,v
retrieving revision 1.15
diff -u -r1.15 JavadocTestForClass.java
--- src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForClass.java 29 Mar 2006 03:50:22 -0000 1.15
+++ src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForClass.java 23 Jun 2006 07:47:44 -0000
@@ -388,18 +388,21 @@
this.runConformReferenceTest(
new String[] {
"test/X.java",
- "package test;\n"
- + "import test.copy.*;\n"
- + " /**\n"
- + " * Valid external classes references \n"
- + " *\n"
- + " * @see VisibilityPublic Valid ref: visible class through import => no warning on import\n"
- + " * @see VisibilityPublic.VpPublic Valid ref: visible inner class in visible class \n"
- + " */\n"
- + "public class X {\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" });
+ "package test;\n" +
+ "import test.copy.*;\n" +
+ " /**\n" +
+ " * Valid external classes references \n" +
+ " *\n" +
+ " * @see VisibilityPublic Valid ref: visible class through import => no warning on import\n" +
+ // Inner classes are not visible in generated documentation
+ //" * @see VisibilityPublic.VpPublic Valid ref: visible inner class in visible class \n" +
+ " */\n" +
+ "public class X {\n" +
+ " public void s_foo() {\n" +
+ " }\n" +
+ "}\n"
+ }
+ );
}
public void test023() {
@@ -435,17 +438,20 @@
this.runConformReferenceTest(
new String[] {
"test/X.java",
- "package test;\n"
- + " /**\n"
- + " * Valid external classes references \n"
- + " *\n"
- + " * @see test.copy.VisibilityPublic Valid ref: visible class through import => no warning on import\n"
- + " * @see test.copy.VisibilityPublic.VpPublic Valid ref: visible inner class in visible class \n"
- + " */\n"
- + "public class X {\n"
- + " public void s_foo() {\n"
- + " }\n"
- + "}\n" });
+ "package test;\n" +
+ " /**\n" +
+ " * Valid external classes references \n" +
+ " *\n" +
+ " * @see test.copy.VisibilityPublic Valid ref: visible class through import => no warning on import\n" +
+ // Inner classes are not visible in generated documentation
+ //" * @see test.copy.VisibilityPublic.VpPublic Valid ref: visible inner class in visible class \n" +
+ " */\n" +
+ "public class X {\n" +
+ " public void s_foo() {\n" +
+ " }\n" +
+ "}\n"
+ }
+ );
}
// @see Field references
Index: src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_3.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_3.java,v
retrieving revision 1.21
diff -u -r1.21 JavadocTest_1_3.java
--- src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_3.java 21 Jun 2006 08:41:18 -0000 1.21
+++ src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_3.java 23 Jun 2006 07:47:51 -0000
@@ -20,6 +20,7 @@
String docCommentSupport = CompilerOptions.ENABLED;
String reportInvalidJavadoc = CompilerOptions.ERROR;
+ String reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
String reportMissingJavadocTags = CompilerOptions.ERROR;
String reportMissingJavadocComments = null;
String reportMissingJavadocCommentsVisibility = null;
@@ -49,6 +50,9 @@
Map options = super.getCompilerOptions();
options.put(CompilerOptions.OPTION_DocCommentSupport, this.docCommentSupport);
options.put(CompilerOptions.OPTION_ReportInvalidJavadoc, reportInvalidJavadoc);
+ if (!CompilerOptions.IGNORE.equals(reportInvalidJavadoc)) {
+ options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsVisibility, this.reportInvalidJavadocVisibility);
+ }
if (reportMissingJavadocComments != null)
options.put(CompilerOptions.OPTION_ReportMissingJavadocComments, reportMissingJavadocComments);
else
@@ -71,9 +75,10 @@
protected void setUp() throws Exception {
super.setUp();
this.docCommentSupport = CompilerOptions.ENABLED;
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportMissingJavadocTags = CompilerOptions.ERROR;
- reportMissingJavadocComments = CompilerOptions.IGNORE;
+ this.reportInvalidJavadoc = CompilerOptions.ERROR;
+ this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
+ this.reportMissingJavadocTags = CompilerOptions.ERROR;
+ this.reportMissingJavadocComments = CompilerOptions.IGNORE;
}
/**
@@ -2546,6 +2551,505 @@
""
);
}
+ /**
+ * Bug 96237: [javadoc] Inner types must be qualified
+ * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=96237"
+ */
+ public void testBug96237_Public01() {
+ this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
+ runConformTest(
+ new String[] {
+ "comment6/Valid.java",
+ "package comment6;\n" +
+ "public class Valid {\n" +
+ " /**\n" +
+ " * @see Valid.Inner\n" +
+ " */\n" +
+ " public class Inner { }\n" +
+ "}\n" +
+ "/**\n" +
+ " * See also {@link Valid.Inner}\n" +
+ " */\n" +
+ "class Sub2 extends Valid { }"
+ }
+ );
+ }
+ public void testBug96237_Public02() {
+ this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
+ runNegativeTest(
+ new String[] {
+ "comment6/Invalid.java",
+ "package comment6;\n" +
+ "public class Invalid {\n" +
+ " /**\n" +
+ " * @see Inner\n" +
+ " */\n" +
+ " public class Inner { }\n" +
+ "}\n" +
+ "/**\n" +
+ " * See also {@link Inner} \n" +
+ " */\n" +
+ "class Sub1 extends Invalid { }\n"
+ },
+// comment6\Invalid.java:6: warning - Tag @see: reference not found: Inner
+ "----------\n" +
+ "1. ERROR in comment6\\Invalid.java (at line 4)\r\n" +
+ " * @see Inner\r\n" +
+ " ^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n"
+ );
+ }
+ public void testBug96237_Public03() {
+ this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
+ runNegativeTest(
+ new String[] {
+ "comment6a/def/Test.java",
+ "package comment6a.def;\n" +
+ "public class Test {\n" +
+ " /**\n" +
+ " * @see Inner\n" +
+ " */\n" +
+ " public class Inner { }\n" +
+ "}\n",
+ "comment6a/test/Invalid.java",
+ "package comment6a.test;\n" +
+ "import comment6a.def.Test;\n" +
+ "/**\n" +
+ " * See also {@link Inner}\n" +
+ " */\n" +
+ "public class Invalid extends Test { \n" +
+ "}",
+ "comment6a/test/Invalid2.java",
+ "package comment6a.test;\n" +
+ "import comment6a.def.Test;\n" +
+ "/**\n" +
+ " * @see Test.Inner\n" +
+ " */\n" +
+ "public class Invalid2 extends Test { \n" +
+ "}"
+ },
+// comment6a\def\Test.java:6: warning - Tag @see: reference not found: Inner
+// comment6a\test\Invalid.java:8: warning - Tag @link: reference not found: Inner
+// comment6a\test\Invalid2.java:8: warning - Tag @see: reference not found: Test.Inner
+ "----------\n" +
+ "1. ERROR in comment6a\\def\\Test.java (at line 4)\n" +
+ " * @see Inner\n" +
+ " ^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in comment6a\\test\\Invalid.java (at line 4)\n" +
+ " * See also {@link Inner}\n" +
+ " ^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in comment6a\\test\\Invalid2.java (at line 4)\n" +
+ " * @see Test.Inner\n" +
+ " ^^^^^^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n"
+ );
+ }
+ public void testBug96237_Public04() {
+ this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
+ runNegativeTest(
+ new String[] {
+ "comment6b/Invalid.java",
+ "package comment6b;\n" +
+ "\n" +
+ "/**\n" +
+ " * @see Inner\n" +
+ " */\n" +
+ "public class Invalid implements Test { \n" +
+ "}",
+ "comment6b/Test.java",
+ "package comment6b;\n" +
+ "public interface Test {\n" +
+ " /**\n" +
+ " * @see Inner\n" +
+ " */\n" +
+ " public class Inner { }\n" +
+ "}\n",
+ "comment6b/Valid.java",
+ "package comment6b;\n" +
+ "\n" +
+ "/**\n" +
+ " * @see Test.Inner\n" +
+ " */\n" +
+ "public class Valid implements Test { \n" +
+ "}"
+ },
+// comment6b\Test.java:6: warning - Tag @see: reference not found: Inner
+// comment6b\Invalid.java:6: warning - Tag @see: reference not found: Inner
+ "----------\n" +
+ "1. ERROR in comment6b\\Invalid.java (at line 4)\n" +
+ " * @see Inner\n" +
+ " ^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in comment6b\\Test.java (at line 4)\n" +
+ " * @see Inner\n" +
+ " ^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n"
+ );
+ }
+ public void testBug96237_Public05() {
+ this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
+ runNegativeTest(
+ new String[] {
+ "test/a/Test.java",
+ "package test.a;\n" +
+ "/**\n" +
+ " * @see Inner\n" +
+ " * @see Test.Inner\n" +
+ " */\n" +
+ "public class Test {\n" +
+ " class Inner {}\n" +
+ "}\n"
+ },
+// test\a\Test.java:6: warning - Tag @see: reference not found: Inner
+// test\a\Test.java:6: warning - Tag @see: reference not found: Test.Inner
+ "----------\n" +
+ "1. ERROR in test\\a\\Test.java (at line 3)\n" +
+ " * @see Inner\n" +
+ " ^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n" +
+ "2. ERROR in test\\a\\Test.java (at line 4)\n" +
+ " * @see Test.Inner\n" +
+ " ^^^^^^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n"
+ );
+ }
+ public void testBug96237_Public06() {
+ this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
+ runNegativeTest(
+ new String[] {
+ "test/b/Test.java",
+ "package test.b;\n" +
+ "/** \n" +
+ " * @see Inner.Level2\n" +
+ " * @see Test.Inner.Level2\n" +
+ " */\n" +
+ "public class Test {\n" +
+ " /** \n" +
+ " * @see Level2\n" +
+ " * @see Test.Inner.Level2\n" +
+ " */\n" +
+ " public class Inner {\n" +
+ " class Level2 {}\n" +
+ " }\n" +
+ "}\n"
+ },
+// test\b\Test.java:6: warning - Tag @see: reference not found: Inner.Level2
+// test\b\Test.java:6: warning - Tag @see: reference not found: Test.Inner.Level2
+// test\b\Test.java:11: warning - Tag @see: reference not found: Level2
+// test\b\Test.java:11: warning - Tag @see: reference not found: Test.Inner.Level2
+ "----------\n" +
+ "1. ERROR in test\\b\\Test.java (at line 3)\n" +
+ " * @see Inner.Level2\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n" +
+ "2. ERROR in test\\b\\Test.java (at line 4)\n" +
+ " * @see Test.Inner.Level2\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n" +
+ "3. ERROR in test\\b\\Test.java (at line 8)\n" +
+ " * @see Level2\n" +
+ " ^^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n" +
+ "4. ERROR in test\\b\\Test.java (at line 9)\n" +
+ " * @see Test.Inner.Level2\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n"
+ );
+ }
+ public void testBug96237_Public07() {
+ this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
+ runNegativeTest(
+ new String[] {
+ "test/c/Test.java",
+ "package test.c;\n" +
+ "/**\n" +
+ " * @see Inner.Level2.Level3\n" +
+ " * @see Test.Inner.Level2.Level3\n" +
+ " */\n" +
+ "public class Test {\n" +
+ " public class Inner {\n" +
+ " /**\n" +
+ " * @see Level3\n" +
+ " * @see Level2.Level3\n" +
+ " * @see Inner.Level2.Level3\n" +
+ " * @see Test.Inner.Level2.Level3\n" +
+ " */\n" +
+ " public class Level2 {\n" +
+ " class Level3 {\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ "}\n"
+ },
+// test\c\Test.java:6: warning - Tag @see: reference not found: Inner.Level2.Level3
+// test\c\Test.java:6: warning - Tag @see: reference not found: Test.Inner.Level2.Level3
+// test\c\Test.java:14: warning - Tag @see: reference not found: Level3
+// test\c\Test.java:14: warning - Tag @see: reference not found: Level2.Level3
+// test\c\Test.java:14: warning - Tag @see: reference not found: Inner.Level2.Level3
+// test\c\Test.java:14: warning - Tag @see: reference not found: Test.Inner.Level2.Level3
+ "----------\n" +
+ "1. ERROR in test\\c\\Test.java (at line 3)\n" +
+ " * @see Inner.Level2.Level3\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n" +
+ "2. ERROR in test\\c\\Test.java (at line 4)\n" +
+ " * @see Test.Inner.Level2.Level3\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n" +
+ "3. ERROR in test\\c\\Test.java (at line 9)\n" +
+ " * @see Level3\n" +
+ " ^^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n" +
+ "4. ERROR in test\\c\\Test.java (at line 10)\n" +
+ " * @see Level2.Level3\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n" +
+ "5. ERROR in test\\c\\Test.java (at line 11)\n" +
+ " * @see Inner.Level2.Level3\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n" +
+ "6. ERROR in test\\c\\Test.java (at line 12)\n" +
+ " * @see Test.Inner.Level2.Level3\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n"
+ );
+ }
+ public void testBug96237_Private01() {
+ this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
+ runConformTest(
+ new String[] {
+ "comment6/Valid.java",
+ "package comment6;\n" +
+ "public class Valid {\n" +
+ " /**\n" +
+ " * @see Valid.Inner\n" +
+ " */\n" +
+ " public class Inner { }\n" +
+ "}\n" +
+ "/**\n" +
+ " * See also {@link Valid.Inner}\n" +
+ " */\n" +
+ "class Sub2 extends Valid { }"
+ }
+ );
+ }
+ public void testBug96237_Private02() {
+ this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
+ runNegativeTest(
+ new String[] {
+ "comment6/Invalid.java",
+ "package comment6;\n" +
+ "public class Invalid {\n" +
+ " /**\n" +
+ " * @see Inner\n" +
+ " */\n" +
+ " public class Inner { }\n" +
+ "}\n" +
+ "/**\n" +
+ " * See also {@link Inner} \n" +
+ " */\n" +
+ "class Sub1 extends Invalid { }\n"
+ },
+// comment6\Invalid.java:6: warning - Tag @see: reference not found: Inner
+// comment6\Invalid.java:11: warning - Tag @link: reference not found: Inner
+ "----------\n" +
+ "1. ERROR in comment6\\Invalid.java (at line 4)\n" +
+ " * @see Inner\n" +
+ " ^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n" +
+ "2. ERROR in comment6\\Invalid.java (at line 9)\n" +
+ " * See also {@link Inner} \n" +
+ " ^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n"
+ );
+ }
+ public void testBug96237_Private03() {
+ this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
+ runNegativeTest(
+ new String[] {
+ "comment6a/def/Test.java",
+ "package comment6a.def;\n" +
+ "public class Test {\n" +
+ " /**\n" +
+ " * @see Inner\n" +
+ " */\n" +
+ " public class Inner { }\n" +
+ "}\n",
+ "comment6a/test/Invalid.java",
+ "package comment6a.test;\n" +
+ "import comment6a.def.Test;\n" +
+ "/**\n" +
+ " * See also {@link Inner}\n" +
+ " */\n" +
+ "public class Invalid extends Test { \n" +
+ "}",
+ "comment6a/test/Invalid2.java",
+ "package comment6a.test;\n" +
+ "import comment6a.def.Test;\n" +
+ "/**\n" +
+ " * @see Test.Inner\n" +
+ " */\n" +
+ "public class Invalid2 extends Test { \n" +
+ "}"
+ },
+// comment6a\def\Test.java:6: warning - Tag @see: reference not found: Inner
+// comment6a\test\Invalid.java:8: warning - Tag @link: reference not found: Inner
+// comment6a\test\Invalid2.java:8: warning - Tag @see: reference not found: Test.Inner
+ "----------\n" +
+ "1. ERROR in comment6a\\def\\Test.java (at line 4)\n" +
+ " * @see Inner\n" +
+ " ^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in comment6a\\test\\Invalid.java (at line 4)\n" +
+ " * See also {@link Inner}\n" +
+ " ^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in comment6a\\test\\Invalid2.java (at line 4)\n" +
+ " * @see Test.Inner\n" +
+ " ^^^^^^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n"
+ );
+ }
+ public void testBug96237_Private04() {
+ this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
+ runNegativeTest(
+ new String[] {
+ "comment6b/Invalid.java",
+ "package comment6b;\n" +
+ "\n" +
+ "/**\n" +
+ " * @see Inner\n" +
+ " */\n" +
+ "public class Invalid implements Test { \n" +
+ "}",
+ "comment6b/Test.java",
+ "package comment6b;\n" +
+ "public interface Test {\n" +
+ " /**\n" +
+ " * @see Inner\n" +
+ " */\n" +
+ " public class Inner { }\n" +
+ "}\n",
+ "comment6b/Valid.java",
+ "package comment6b;\n" +
+ "\n" +
+ "/**\n" +
+ " * @see Test.Inner\n" +
+ " */\n" +
+ "public class Valid implements Test { \n" +
+ "}"
+ },
+// comment6b\Invalid.java:6: warning - Tag @see: reference not found: Inner
+// comment6b\Test.java:6: warning - Tag @see: reference not found: Inner
+ "----------\n" +
+ "1. ERROR in comment6b\\Invalid.java (at line 4)\n" +
+ " * @see Inner\n" +
+ " ^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in comment6b\\Test.java (at line 4)\n" +
+ " * @see Inner\n" +
+ " ^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n"
+ );
+ }
+ public void testBug96237_Private05() {
+ this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
+ runConformTest(
+ new String[] {
+ "test/a/Test.java",
+ "package test.a;\n" +
+ "/**\n" +
+ " * @see Inner\n" +
+ " * @see Test.Inner\n" +
+ " */\n" +
+ "public class Test {\n" +
+ " class Inner {}\n" +
+ "}\n"
+ }
+ );
+ }
+ public void testBug96237_Private06() {
+ this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
+ runConformTest(
+ new String[] {
+ "test/b/Test.java",
+ "package test.b;\n" +
+ "/** \n" +
+ " * @see Inner.Level2\n" +
+ " * @see Test.Inner.Level2\n" +
+ " */\n" +
+ "public class Test {\n" +
+ " /** \n" +
+ " * @see Level2\n" +
+ " * @see Test.Inner.Level2\n" +
+ " */\n" +
+ " public class Inner {\n" +
+ " class Level2 {}\n" +
+ " }\n" +
+ "}\n"
+ }
+ );
+ }
+ public void testBug96237_Private07() {
+ this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
+ runConformTest(
+ new String[] {
+ "test/c/Test.java",
+ "package test.c;\n" +
+ "/**\n" +
+ " * @see Inner.Level2.Level3\n" +
+ " * @see Test.Inner.Level2.Level3\n" +
+ " */\n" +
+ "public class Test {\n" +
+ " public class Inner {\n" +
+ " /**\n" +
+ " * @see Level3\n" +
+ " * @see Level2.Level3\n" +
+ " * @see Inner.Level2.Level3\n" +
+ " * @see Test.Inner.Level2.Level3\n" +
+ " */\n" +
+ " public class Level2 {\n" +
+ " class Level3 {\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ "}\n"
+ }
+ );
+ }
/**
* Bug 95286: [1.5][javadoc] package-info.java incorrectly flags "Missing comment for public declaration"
@@ -3020,6 +3524,343 @@
}
/**
+ * Bug 103304: [Javadoc] Wrong reference proposal for inner classes.
+ * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=103304"
+ */
+ public void testBug103304a() {
+ runNegativeTest(
+ new String[] {
+ "boden/IAFAState.java",
+ "package boden;\n" +
+ "public interface IAFAState {\n" +
+ " public class ValidationException extends Exception {\n" +
+ " public ValidationException(String variableName, IAFAState subformula) {\n" +
+ " super(\"Variable \'\"+variableName+\"\' may be unbound in \'\"+subformula+\"\'\");\n" +
+ " }\n" +
+ " public void method() {}\n" +
+ " }\n" +
+ " /**\n" +
+ " * Validates a formula for consistent bindings. Bindings are consistent, when at each point in time,\n" +
+ " * the set of povided variables can be guaranteed to be a superset of the set of required variables.\n" +
+ " * @throws ValidationException Thrown if a variable is unbound. \n" +
+ " * @see ValidationException#IAFAState.ValidationException(String, IAFAState)\n" +
+ " * @see IAFAState.ValidationException#method()\n" +
+ " * @see ValidationException\n" +
+ " * {@link ValidationException}\n" +
+ " */\n" +
+ " public void validate() throws ValidationException;\n" +
+ "}\n",
+ "boden/TestValid.java",
+ "package boden;\n" +
+ "import boden.IAFAState.ValidationException;\n" +
+ "/**\n" +
+ " * @see ValidationException\n" +
+ " * @see IAFAState.ValidationException\n" +
+ " */\n" +
+ "public class TestValid {\n" +
+ " /** \n" +
+ " * @see ValidationException#IAFAState.ValidationException(String, IAFAState)\n" +
+ " */\n" +
+ " IAFAState.ValidationException valid1;\n" +
+ " /**\n" +
+ " * @see IAFAState.ValidationException#IAFAState.ValidationException(String, IAFAState)\n" +
+ " */\n" +
+ " IAFAState.ValidationException valid2;\n" +
+ "}\n"
+ },
+// boden\TestValid.java:8: warning - Tag @see: reference not found: ValidationException
+// boden\TestValid.java:12: warning - Tag @see: reference not found: ValidationException#IAFAState.ValidationException(String, IAFAState)
+ "----------\n" +
+ "1. ERROR in boden\\TestValid.java (at line 4)\r\n" +
+ " * @see ValidationException\r\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n"
+ );
+ }
+ public void testBug103304b() {
+ runNegativeTest(
+ new String[] {
+ "boden/IAFAState.java",
+ "package boden;\n" +
+ "public interface IAFAState {\n" +
+ " public class ValidationException extends Exception {\n" +
+ " public ValidationException(String variableName, IAFAState subformula) {\n" +
+ " super(\"Variable \'\"+variableName+\"\' may be unbound in \'\"+subformula+\"\'\");\n" +
+ " }\n" +
+ " public void method() {}\n" +
+ " }\n" +
+ "}\n",
+ "boden/TestInvalid1.java",
+ "package boden;\n" +
+ "import boden.IAFAState.ValidationException;\n" +
+ "public class TestInvalid1 {\n" +
+ " /** \n" +
+ " * @see ValidationException#ValidationException(String, IAFAState)\n" +
+ " */ \n" +
+ " IAFAState.ValidationException invalid;\n" +
+ "}\n",
+ "boden/TestInvalid2.java",
+ "package boden;\n" +
+ "import boden.IAFAState.ValidationException;\n" +
+ "public class TestInvalid2 {\n" +
+ " /**\n" +
+ " * @see IAFAState.ValidationException#ValidationException(String, IAFAState)\n" +
+ " */\n" +
+ " IAFAState.ValidationException invalid;\n" +
+ "}\n",
+ "boden/TestInvalid3.java",
+ "package boden;\n" +
+ "import boden.IAFAState.ValidationException;\n" +
+ "public class TestInvalid3 {\n" +
+ " /**\n" +
+ " * @see IAFAState.ValidationException#IAFA.State.ValidationException(String, IAFAState)\n" +
+ " */\n" +
+ " IAFAState.ValidationException invalid;\n" +
+ "}\n",
+ "boden/TestInvalid4.java",
+ "package boden;\n" +
+ "import boden.IAFAState.ValidationException;\n" +
+ "public class TestInvalid4 {\n" +
+ " /**\n" +
+ " * @see IAFAState.ValidationException#IAFAState .ValidationException(String, IAFAState)\n" +
+ " */\n" +
+ " IAFAState.ValidationException invalid;\n" +
+ "}\n"
+ },
+// boden\TestInvalid1.java:7: warning - Tag @see: reference not found: ValidationException#ValidationException(String, IAFAState)
+// boden\TestInvalid2.java:6: warning - Tag @see: can't find ValidationException(String, IAFAState) in boden.IAFAState.ValidationException
+// boden\TestInvalid3.java:6: warning - Tag @see: can't find IAFA.State.ValidationException(String, IAFAState) in boden.IAFAState.ValidationException
+// boden\TestInvalid4.java:6: warning - Tag @see: can't find IAFAState in boden.IAFAState.ValidationException
+ "----------\n" +
+ "1. ERROR in boden\\TestInvalid1.java (at line 5)\n" +
+ " * @see ValidationException#ValidationException(String, IAFAState)\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Invalid qualification for member type constructor\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in boden\\TestInvalid2.java (at line 5)\n" +
+ " * @see IAFAState.ValidationException#ValidationException(String, IAFAState)\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Invalid qualification for member type constructor\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in boden\\TestInvalid3.java (at line 5)\n" +
+ " * @see IAFAState.ValidationException#IAFA.State.ValidationException(String, IAFAState)\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Invalid qualification for member type constructor\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in boden\\TestInvalid4.java (at line 5)\n" +
+ " * @see IAFAState.ValidationException#IAFAState .ValidationException(String, IAFAState)\n" +
+ " ^^^^^^^^^\n" +
+ "Javadoc: IAFAState cannot be resolved or is not a field\n" +
+ "----------\n"
+ );
+ }
+ public void testBug103304c() {
+ runNegativeTest(
+ new String[] {
+ "test/Test.java",
+ "package test;\n" +
+ "public interface Test {\n" +
+ " public class Level0 {\n" +
+ " public Level0() {}\n" +
+ " }\n" +
+ " public interface Member {\n" +
+ " public class Level1 {\n" +
+ " public Level1() {}\n" +
+ " }\n" +
+ " }\n" +
+ "}\n",
+ "test/C.java",
+ "package test;\n" +
+ "public class C {\n" +
+ " /**\n" +
+ " * @see Test.Level0#Test.Level0()\n" +
+ " */\n" +
+ " Test.Level0 valid = new Test.Level0();\n" +
+ " /**\n" +
+ " * @see Test.Level0#Level0()\n" +
+ " */\n" +
+ " Test.Level0 invalid = new Test.Level0();\n" +
+ "}\n"
+ },
+// test\C.java:10: warning - Tag @see: can't find Level0() in test.Test.Level0
+ "----------\n" +
+ "1. ERROR in test\\C.java (at line 8)\n" +
+ " * @see Test.Level0#Level0()\n" +
+ " ^^^^^^^^\n" +
+ "Javadoc: Invalid qualification for member type constructor\n" +
+ "----------\n"
+ );
+ }
+ public void testBug103304d() {
+ runNegativeTest(
+ new String[] {
+ "test/Test.java",
+ "package test;\n" +
+ "public interface Test {\n" +
+ " public class Level0 {\n" +
+ " public Level0() {}\n" +
+ " }\n" +
+ " public interface Member {\n" +
+ " public class Level1 {\n" +
+ " public Level1() {}\n" +
+ " }\n" +
+ " }\n" +
+ "}\n",
+ "test/C2.java",
+ "package test;\n" +
+ "public class C2 {\n" +
+ " /**\n" +
+ " * @see Test.Member.Level1#Test.Member.Level1()\n" +
+ " */\n" +
+ " Test.Member.Level1 valid = new Test.Member.Level1();\n" +
+ " /**\n" +
+ " * @see Test.Member.Level1#Level1()\n" +
+ " */\n" +
+ " Test.Member.Level1 invalid = new Test.Member.Level1();\n" +
+ " /**\n" +
+ " * @see Test.Member.Level1#Test.Level1()\n" +
+ " */\n" +
+ " Test.Member.Level1 wrong = new Test.Member.Level1();\n" +
+ "}\n"
+ },
+// test\C2.java:10: warning - Tag @see: can't find Level1() in test.Test.Member.Level1
+// test\C2.java:14: warning - Tag @see: can't find Test.Level1() in test.Test.Member.Level1
+ "----------\n" +
+ "1. ERROR in test\\C2.java (at line 8)\n" +
+ " * @see Test.Member.Level1#Level1()\n" +
+ " ^^^^^^^^\n" +
+ "Javadoc: Invalid qualification for member type constructor\n" +
+ "----------\n" +
+ "2. ERROR in test\\C2.java (at line 12)\n" +
+ " * @see Test.Member.Level1#Test.Level1()\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Javadoc: Invalid qualification for member type constructor\n" +
+ "----------\n"
+ );
+ }
+ public void testBug103304e() {
+ runConformTest(
+ new String[] {
+ "implicit/Valid.java",
+ "package implicit;\n" +
+ "public interface Valid {\n" +
+ " public class Level0 {\n" +
+ " /**\n" +
+ " * @see #Valid.Level0() Valid\n" +
+ " */\n" +
+ " public Level0() {}\n" +
+ " /**\n" +
+ " * @see #Valid.Level0(String) Valid\n" +
+ " */\n" +
+ " public Level0(String str) {}\n" +
+ " }\n" +
+ " public interface Member {\n" +
+ " public class Level1 {\n" +
+ " /**\n" +
+ " * @see #Valid.Member.Level1() Valid\n" +
+ " */\n" +
+ " public Level1() {}\n" +
+ " /**\n" +
+ " * @see #Valid.Member.Level1(int) Valid\n" +
+ " */\n" +
+ " public Level1(int x) {}\n" +
+ " }\n" +
+ " }\n" +
+ "}\n"
+ }
+ );
+ }
+ public void testBug103304f() {
+ runNegativeTest(
+ new String[] {
+ "implicit/Invalid.java",
+ "package implicit;\n" +
+ "public interface Invalid {\n" +
+ " public class Level0 {\n" +
+ " /**\n" +
+ " * @see #Level0() Invalid\n" +
+ " */\n" +
+ " public Level0() {}\n" +
+ " /**\n" +
+ " * @see #Level0(String) Invalid\n" +
+ " */\n" +
+ " public Level0(String str) {}\n" +
+ " }\n" +
+ " public interface Member {\n" +
+ " public class Level1 {\n" +
+ " /**\n" +
+ " * @see #Level1() Invalid\n" +
+ " * @see #Member.Level1() Invalid\n" +
+ " * @see #Invalid.Level1() Invalid\n" +
+ " */\n" +
+ " public Level1() {}\n" +
+ " /**\n" +
+ " * @see #Level1(int) Invalid\n" +
+ " * @see #Invalid.Level1(int) Invalid\n" +
+ " * @see #Member.Level1(int) Invalid\n" +
+ " */\n" +
+ " public Level1(int x) {}\n" +
+ " }\n" +
+ " }\n" +
+ "}\n"
+ },
+// implicit\Invalid.java:7: warning - Tag @see: can't find Level0() in implicit.Invalid.Level0
+// implicit\Invalid.java:11: warning - Tag @see: can't find Level0(String) in implicit.Invalid.Level0
+// implicit\Invalid.java:20: warning - Tag @see: can't find Level1() in implicit.Invalid.Member.Level1
+// implicit\Invalid.java:20: warning - Tag @see: can't find Member.Level1() in implicit.Invalid.Member.Level1
+// implicit\Invalid.java:20: warning - Tag @see: can't find Invalid.Level1() in implicit.Invalid.Member.Level1
+// implicit\Invalid.java:26: warning - Tag @see: can't find Level1(int) in implicit.Invalid.Member.Level1
+// implicit\Invalid.java:26: warning - Tag @see: can't find Invalid.Level1(int) in implicit.Invalid.Member.Level1
+// implicit\Invalid.java:26: warning - Tag @see: can't find Member.Level1(int) in implicit.Invalid.Member.Level1
+ "----------\n" +
+ "1. ERROR in implicit\\Invalid.java (at line 5)\n" +
+ " * @see #Level0() Invalid\n" +
+ " ^^^^^^^^\n" +
+ "Javadoc: Invalid qualification for member type constructor\n" +
+ "----------\n" +
+ "2. ERROR in implicit\\Invalid.java (at line 9)\n" +
+ " * @see #Level0(String) Invalid\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Javadoc: Invalid qualification for member type constructor\n" +
+ "----------\n" +
+ "3. ERROR in implicit\\Invalid.java (at line 16)\n" +
+ " * @see #Level1() Invalid\n" +
+ " ^^^^^^^^\n" +
+ "Javadoc: Invalid qualification for member type constructor\n" +
+ "----------\n" +
+ "4. ERROR in implicit\\Invalid.java (at line 17)\n" +
+ " * @see #Member.Level1() Invalid\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Invalid qualification for member type constructor\n" +
+ "----------\n" +
+ "5. ERROR in implicit\\Invalid.java (at line 18)\n" +
+ " * @see #Invalid.Level1() Invalid\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Invalid qualification for member type constructor\n" +
+ "----------\n" +
+ "6. ERROR in implicit\\Invalid.java (at line 22)\n" +
+ " * @see #Level1(int) Invalid\n" +
+ " ^^^^^^^^^^^\n" +
+ "Javadoc: Invalid qualification for member type constructor\n" +
+ "----------\n" +
+ "7. ERROR in implicit\\Invalid.java (at line 23)\n" +
+ " * @see #Invalid.Level1(int) Invalid\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Invalid qualification for member type constructor\n" +
+ "----------\n" +
+ "8. ERROR in implicit\\Invalid.java (at line 24)\n" +
+ " * @see #Member.Level1(int) Invalid\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Invalid qualification for member type constructor\n" +
+ "----------\n"
+ );
+ }
+
+ /**
* Bug 112346: [javadoc] {@inheritedDoc} should be inactive for non-overridden method
* @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=112346"
*/
Index: src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_5.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_5.java,v
retrieving revision 1.27
diff -u -r1.27 JavadocTest_1_5.java
--- src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_5.java 21 Jun 2006 08:41:18 -0000 1.27
+++ src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_5.java 23 Jun 2006 07:47:53 -0000
@@ -20,6 +20,7 @@
String docCommentSupport = CompilerOptions.ENABLED;
String reportInvalidJavadoc = CompilerOptions.ERROR;
+ String reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
String reportMissingJavadocTags = CompilerOptions.ERROR;
String reportMissingJavadocTagsOverriding = CompilerOptions.ENABLED;
String reportMissingJavadocComments = null;
@@ -49,6 +50,9 @@
Map options = super.getCompilerOptions();
options.put(CompilerOptions.OPTION_DocCommentSupport, this.docCommentSupport);
options.put(CompilerOptions.OPTION_ReportInvalidJavadoc, reportInvalidJavadoc);
+ if (!CompilerOptions.IGNORE.equals(reportInvalidJavadoc)) {
+ options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsVisibility, this.reportInvalidJavadocVisibility);
+ }
if (reportMissingJavadocComments != null)
options.put(CompilerOptions.OPTION_ReportMissingJavadocComments, reportMissingJavadocComments);
else
@@ -75,10 +79,11 @@
protected void setUp() throws Exception {
super.setUp();
this.docCommentSupport = CompilerOptions.ENABLED;
- reportInvalidJavadoc = CompilerOptions.ERROR;
- reportMissingJavadocTags = CompilerOptions.ERROR;
- reportMissingJavadocTagsOverriding = CompilerOptions.ENABLED;
- reportMissingJavadocComments = CompilerOptions.IGNORE;
+ this.reportInvalidJavadoc = CompilerOptions.ERROR;
+ this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
+ this.reportMissingJavadocTags = CompilerOptions.ERROR;
+ this.reportMissingJavadocTagsOverriding = CompilerOptions.ENABLED;
+ this.reportMissingJavadocComments = CompilerOptions.IGNORE;
}
/**
@@ -1899,6 +1904,465 @@
}
/**
+ * Bug 96237: [javadoc] Inner types must be qualified
+ * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=96237"
+ */
+ public void testBug96237_Public01() {
+ this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
+ runConformTest(
+ new String[] {
+ "comment6/Valid.java",
+ "package comment6;\n" +
+ "public class Valid {\n" +
+ " /**\n" +
+ " * @see Valid.Inner\n" +
+ " */\n" +
+ " public class Inner { }\n" +
+ "}\n" +
+ "/**\n" +
+ " * See also {@link Valid.Inner}\n" +
+ " */\n" +
+ "class Sub2 extends Valid { }"
+ }
+ );
+ }
+ public void testBug96237_Public02() {
+ this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
+ runConformTest(
+ new String[] {
+ "comment6/Invalid.java",
+ "package comment6;\n" +
+ "public class Invalid {\n" +
+ " /**\n" +
+ " * @see Inner\n" +
+ " */\n" +
+ " public class Inner { }\n" +
+ "}\n" +
+ "/**\n" +
+ " * See also {@link Inner} \n" +
+ " */\n" +
+ "class Sub1 extends Invalid { }\n"
+ }
+ );
+ }
+ public void testBug96237_Public03() {
+ this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
+ runNegativeTest(
+ new String[] {
+ "comment6a/def/Test.java",
+ "package comment6a.def;\n" +
+ "public class Test {\n" +
+ " /**\n" +
+ " * @see Inner\n" +
+ " */\n" +
+ " public class Inner { }\n" +
+ "}\n",
+ "comment6a/test/Invalid.java",
+ "package comment6a.test;\n" +
+ "import comment6a.def.Test;\n" +
+ "/**\n" +
+ " * See also {@link Inner}\n" +
+ " */\n" +
+ "public class Invalid extends Test { \n" +
+ "}",
+ "comment6a/test/Invalid2.java",
+ "package comment6a.test;\n" +
+ "import comment6a.def.Test;\n" +
+ "/**\n" +
+ " * @see Test.Inner\n" +
+ " */\n" +
+ "public class Invalid2 extends Test { \n" +
+ "}"
+ },
+// comment6a\test\Invalid.java:8: warning - Tag @link: reference not found: Inner
+// comment6a\test\Invalid2.java:8: warning - Tag @see: reference not found: Test.Inner
+ "----------\n" +
+ "1. ERROR in comment6a\\test\\Invalid.java (at line 4)\n" +
+ " * See also {@link Inner}\n" +
+ " ^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in comment6a\\test\\Invalid2.java (at line 4)\n" +
+ " * @see Test.Inner\n" +
+ " ^^^^^^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n"
+ );
+ }
+ public void testBug96237_Public04() {
+ this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
+ runNegativeTest(
+ new String[] {
+ "comment6b/Invalid.java",
+ "package comment6b;\n" +
+ "\n" +
+ "/**\n" +
+ " * @see Inner\n" +
+ " */\n" +
+ "public class Invalid implements Test { \n" +
+ "}",
+ "comment6b/Test.java",
+ "package comment6b;\n" +
+ "public interface Test {\n" +
+ " /**\n" +
+ " * @see Inner\n" +
+ " */\n" +
+ " public class Inner { }\n" +
+ "}\n",
+ "comment6b/Valid.java",
+ "package comment6b;\n" +
+ "\n" +
+ "/**\n" +
+ " * @see Test.Inner\n" +
+ " */\n" +
+ "public class Valid implements Test { \n" +
+ "}"
+ },
+// comment6b\Invalid.java:6: warning - Tag @see: reference not found: Inner
+ "----------\n" +
+ "1. ERROR in comment6b\\Invalid.java (at line 4)\n" +
+ " * @see Inner\n" +
+ " ^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n"
+ );
+ }
+ public void testBug96237_Public05() {
+ this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
+ runNegativeTest(
+ new String[] {
+ "test/a/Test.java",
+ "package test.a;\n" +
+ "/**\n" +
+ " * @see Inner\n" +
+ " * @see Test.Inner\n" +
+ " */\n" +
+ "public class Test {\n" +
+ " class Inner {}\n" +
+ "}\n"
+ },
+// test\a\Test.java:6: warning - Tag @see: reference not found: Inner
+// test\a\Test.java:6: warning - Tag @see: reference not found: Test.Inner
+ "----------\n" +
+ "1. ERROR in test\\a\\Test.java (at line 3)\n" +
+ " * @see Inner\n" +
+ " ^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n" +
+ "2. ERROR in test\\a\\Test.java (at line 4)\n" +
+ " * @see Test.Inner\n" +
+ " ^^^^^^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n"
+ );
+ }
+ public void testBug96237_Public06() {
+ this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
+ runNegativeTest(
+ new String[] {
+ "test/b/Test.java",
+ "package test.b;\n" +
+ "/** \n" +
+ " * @see Inner.Level2\n" +
+ " * @see Test.Inner.Level2\n" +
+ " */\n" +
+ "public class Test {\n" +
+ " /** \n" +
+ " * @see Level2\n" +
+ " * @see Test.Inner.Level2\n" +
+ " */\n" +
+ " public class Inner {\n" +
+ " class Level2 {}\n" +
+ " }\n" +
+ "}\n"
+ },
+// test\b\Test.java:6: warning - Tag @see: reference not found: Inner.Level2
+// test\b\Test.java:6: warning - Tag @see: reference not found: Test.Inner.Level2
+// test\b\Test.java:11: warning - Tag @see: reference not found: Level2
+// test\b\Test.java:11: warning - Tag @see: reference not found: Test.Inner.Level2
+ "----------\n" +
+ "1. ERROR in test\\b\\Test.java (at line 3)\n" +
+ " * @see Inner.Level2\n" +
+ " ^^^^^^^^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n" +
+ "2. ERROR in test\\b\\Test.java (at line 4)\n" +
+ " * @see Test.Inner.Level2\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n" +
+ "3. ERROR in test\\b\\Test.java (at line 8)\n" +
+ " * @see Level2\n" +
+ " ^^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n" +
+ "4. ERROR in test\\b\\Test.java (at line 9)\n" +
+ " * @see Test.Inner.Level2\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n"
+ );
+ }
+ public void testBug96237_Public07() {
+ this.reportInvalidJavadocVisibility = CompilerOptions.PUBLIC;
+ runNegativeTest(
+ new String[] {
+ "test/c/Test.java",
+ "package test.c;\n" +
+ "/**\n" +
+ " * @see Inner.Level2.Level3\n" +
+ " * @see Test.Inner.Level2.Level3\n" +
+ " */\n" +
+ "public class Test {\n" +
+ " public class Inner {\n" +
+ " /**\n" +
+ " * @see Level3\n" +
+ " * @see Level2.Level3\n" +
+ " * @see Inner.Level2.Level3\n" +
+ " * @see Test.Inner.Level2.Level3\n" +
+ " */\n" +
+ " public class Level2 {\n" +
+ " class Level3 {\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ "}\n"
+ },
+// test\c\Test.java:6: warning - Tag @see: reference not found: Inner.Level2.Level3
+// test\c\Test.java:6: warning - Tag @see: reference not found: Test.Inner.Level2.Level3
+// test\c\Test.java:14: warning - Tag @see: reference not found: Level3
+// test\c\Test.java:14: warning - Tag @see: reference not found: Level2.Level3
+// test\c\Test.java:14: warning - Tag @see: reference not found: Inner.Level2.Level3
+// test\c\Test.java:14: warning - Tag @see: reference not found: Test.Inner.Level2.Level3
+ "----------\n" +
+ "1. ERROR in test\\c\\Test.java (at line 3)\n" +
+ " * @see Inner.Level2.Level3\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n" +
+ "2. ERROR in test\\c\\Test.java (at line 4)\n" +
+ " * @see Test.Inner.Level2.Level3\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n" +
+ "3. ERROR in test\\c\\Test.java (at line 9)\n" +
+ " * @see Level3\n" +
+ " ^^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n" +
+ "4. ERROR in test\\c\\Test.java (at line 10)\n" +
+ " * @see Level2.Level3\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n" +
+ "5. ERROR in test\\c\\Test.java (at line 11)\n" +
+ " * @see Inner.Level2.Level3\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n" +
+ "6. ERROR in test\\c\\Test.java (at line 12)\n" +
+ " * @see Test.Inner.Level2.Level3\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n"
+ );
+ }
+ public void testBug96237_Private01() {
+ this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
+ runConformTest(
+ new String[] {
+ "comment6/Valid.java",
+ "package comment6;\n" +
+ "public class Valid {\n" +
+ " /**\n" +
+ " * @see Valid.Inner\n" +
+ " */\n" +
+ " public class Inner { }\n" +
+ "}\n" +
+ "/**\n" +
+ " * See also {@link Valid.Inner}\n" +
+ " */\n" +
+ "class Sub2 extends Valid { }"
+ }
+ );
+ }
+ public void testBug96237_Private02() {
+ this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
+ runNegativeTest(
+ new String[] {
+ "comment6/Invalid.java",
+ "package comment6;\n" +
+ "public class Invalid {\n" +
+ " /**\n" +
+ " * @see Inner\n" +
+ " */\n" +
+ " public class Inner { }\n" +
+ "}\n" +
+ "/**\n" +
+ " * See also {@link Inner} \n" +
+ " */\n" +
+ "class Sub1 extends Invalid { }\n"
+ },
+// comment6\Invalid.java:11: warning - Tag @link: reference not found: Inner
+ "----------\n" +
+ "1. ERROR in comment6\\Invalid.java (at line 9)\n" +
+ " * See also {@link Inner} \n" +
+ " ^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n"
+ );
+ }
+ public void testBug96237_Private03() {
+ this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
+ runNegativeTest(
+ new String[] {
+ "comment6a/def/Test.java",
+ "package comment6a.def;\n" +
+ "public class Test {\n" +
+ " /**\n" +
+ " * @see Inner\n" +
+ " */\n" +
+ " public class Inner { }\n" +
+ "}\n",
+ "comment6a/test/Invalid.java",
+ "package comment6a.test;\n" +
+ "import comment6a.def.Test;\n" +
+ "/**\n" +
+ " * See also {@link Inner}\n" +
+ " */\n" +
+ "public class Invalid extends Test { \n" +
+ "}",
+ "comment6a/test/Invalid2.java",
+ "package comment6a.test;\n" +
+ "import comment6a.def.Test;\n" +
+ "/**\n" +
+ " * @see Test.Inner\n" +
+ " */\n" +
+ "public class Invalid2 extends Test { \n" +
+ "}"
+ },
+// comment6a\test\Invalid.java:8: warning - Tag @link: reference not found: Inner
+// comment6a\test\Invalid2.java:8: warning - Tag @see: reference not found: Test.Inner
+ "----------\n" +
+ "1. ERROR in comment6a\\test\\Invalid.java (at line 4)\n" +
+ " * See also {@link Inner}\n" +
+ " ^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in comment6a\\test\\Invalid2.java (at line 4)\n" +
+ " * @see Test.Inner\n" +
+ " ^^^^^^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n"
+ );
+ }
+ public void testBug96237_Private04() {
+ this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
+ runNegativeTest(
+ new String[] {
+ "comment6b/Invalid.java",
+ "package comment6b;\n" +
+ "\n" +
+ "/**\n" +
+ " * @see Inner\n" +
+ " */\n" +
+ "public class Invalid implements Test { \n" +
+ "}",
+ "comment6b/Test.java",
+ "package comment6b;\n" +
+ "public interface Test {\n" +
+ " /**\n" +
+ " * @see Inner\n" +
+ " */\n" +
+ " public class Inner { }\n" +
+ "}\n",
+ "comment6b/Valid.java",
+ "package comment6b;\n" +
+ "\n" +
+ "/**\n" +
+ " * @see Test.Inner\n" +
+ " */\n" +
+ "public class Valid implements Test { \n" +
+ "}"
+ },
+// comment6b\Invalid.java:6: warning - Tag @see: reference not found: Inner
+ "----------\n" +
+ "1. ERROR in comment6b\\Invalid.java (at line 4)\n" +
+ " * @see Inner\n" +
+ " ^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n"
+ );
+ }
+ public void testBug96237_Private05() {
+ this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
+ runConformTest(
+ new String[] {
+ "test/a/Test.java",
+ "package test.a;\n" +
+ "/**\n" +
+ " * @see Inner\n" +
+ " * @see Test.Inner\n" +
+ " */\n" +
+ "public class Test {\n" +
+ " class Inner {}\n" +
+ "}\n"
+ }
+ );
+ }
+ public void testBug96237_Private06() {
+ this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
+ runConformTest(
+ new String[] {
+ "test/b/Test.java",
+ "package test.b;\n" +
+ "/** \n" +
+ " * @see Inner.Level2\n" +
+ " * @see Test.Inner.Level2\n" +
+ " */\n" +
+ "public class Test {\n" +
+ " /** \n" +
+ " * @see Level2\n" +
+ " * @see Test.Inner.Level2\n" +
+ " */\n" +
+ " public class Inner {\n" +
+ " class Level2 {}\n" +
+ " }\n" +
+ "}\n"
+ }
+ );
+ }
+ public void testBug96237_Private07() {
+ this.reportInvalidJavadocVisibility = CompilerOptions.PRIVATE;
+ runConformTest(
+ new String[] {
+ "test/c/Test.java",
+ "package test.c;\n" +
+ "/**\n" +
+ " * @see Inner.Level2.Level3\n" +
+ " * @see Test.Inner.Level2.Level3\n" +
+ " */\n" +
+ "public class Test {\n" +
+ " public class Inner {\n" +
+ " /**\n" +
+ " * @see Level3\n" +
+ " * @see Level2.Level3\n" +
+ " * @see Inner.Level2.Level3\n" +
+ " * @see Test.Inner.Level2.Level3\n" +
+ " */\n" +
+ " public class Level2 {\n" +
+ " class Level3 {\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ "}\n"
+ }
+ );
+ }
+
+ /**
* Bug 101283: [1.5][javadoc] Javadoc validation raises missing implementation in compiler
* @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=101283"
*/
@@ -2150,6 +2614,342 @@
}
/**
+ * Bug 103304: [Javadoc] Wrong reference proposal for inner classes.
+ * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=103304"
+ */
+ public void testBug103304a() {
+ runNegativeTest(
+ new String[] {
+ "boden/IAFAState.java",
+ "package boden;\n" +
+ "public interface IAFAState {\n" +
+ " public class ValidationException extends Exception {\n" +
+ " public ValidationException(String variableName, IAFAState subformula) {\n" +
+ " super(\"Variable \'\"+variableName+\"\' may be unbound in \'\"+subformula+\"\'\");\n" +
+ " }\n" +
+ " public void method() {}\n" +
+ " }\n" +
+ " /**\n" +
+ " * Validates a formula for consistent bindings. Bindings are consistent, when at each point in time,\n" +
+ " * the set of povided variables can be guaranteed to be a superset of the set of required variables.\n" +
+ " * @throws ValidationException Thrown if a variable is unbound. \n" +
+ " * @see ValidationException#IAFAState.ValidationException(String, IAFAState)\n" +
+ " * @see IAFAState.ValidationException#method()\n" +
+ " * @see ValidationException\n" +
+ " * {@link ValidationException}\n" +
+ " */\n" +
+ " public void validate() throws ValidationException;\n" +
+ "}\n",
+ "boden/TestValid.java",
+ "package boden;\n" +
+ "import boden.IAFAState.ValidationException;\n" +
+ "/**\n" +
+ " * @see ValidationException\n" +
+ " * @see IAFAState.ValidationException\n" +
+ " */\n" +
+ "public class TestValid {\n" +
+ " /** \n" +
+ " * @see ValidationException#IAFAState.ValidationException(String, IAFAState)\n" +
+ " */\n" +
+ " IAFAState.ValidationException valid1;\n" +
+ " /**\n" +
+ " * @see IAFAState.ValidationException#IAFAState.ValidationException(String, IAFAState)\n" +
+ " */\n" +
+ " IAFAState.ValidationException valid2;\n" +
+ "}\n"
+ },
+ // no warning
+ "----------\n" +
+ "1. ERROR in boden\\TestValid.java (at line 4)\r\n" +
+ " * @see ValidationException\r\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Not visible reference\n" +
+ "----------\n"
+ );
+ }
+ public void testBug103304b() {
+ runNegativeTest(
+ new String[] {
+ "boden/IAFAState.java",
+ "package boden;\n" +
+ "public interface IAFAState {\n" +
+ " public class ValidationException extends Exception {\n" +
+ " public ValidationException(String variableName, IAFAState subformula) {\n" +
+ " super(\"Variable \'\"+variableName+\"\' may be unbound in \'\"+subformula+\"\'\");\n" +
+ " }\n" +
+ " public void method() {}\n" +
+ " }\n" +
+ "}\n",
+ "boden/TestInvalid1.java",
+ "package boden;\n" +
+ "import boden.IAFAState.ValidationException;\n" +
+ "public class TestInvalid1 {\n" +
+ " /** \n" +
+ " * @see ValidationException#ValidationException(String, IAFAState)\n" +
+ " */ \n" +
+ " IAFAState.ValidationException invalid;\n" +
+ "}\n",
+ "boden/TestInvalid2.java",
+ "package boden;\n" +
+ "import boden.IAFAState.ValidationException;\n" +
+ "public class TestInvalid2 {\n" +
+ " /**\n" +
+ " * @see IAFAState.ValidationException#ValidationException(String, IAFAState)\n" +
+ " */\n" +
+ " IAFAState.ValidationException invalid;\n" +
+ "}\n",
+ "boden/TestInvalid3.java",
+ "package boden;\n" +
+ "import boden.IAFAState.ValidationException;\n" +
+ "public class TestInvalid3 {\n" +
+ " /**\n" +
+ " * @see IAFAState.ValidationException#IAFA.State.ValidationException(String, IAFAState)\n" +
+ " */\n" +
+ " IAFAState.ValidationException invalid;\n" +
+ "}\n",
+ "boden/TestInvalid4.java",
+ "package boden;\n" +
+ "import boden.IAFAState.ValidationException;\n" +
+ "public class TestInvalid4 {\n" +
+ " /**\n" +
+ " * @see IAFAState.ValidationException#IAFAState .ValidationException(String, IAFAState)\n" +
+ " */\n" +
+ " IAFAState.ValidationException invalid;\n" +
+ "}\n"
+ },
+// boden\TestInvalid1.java:7: warning - Tag @see: reference not found: ValidationException#ValidationException(String, IAFAState)
+// boden\TestInvalid2.java:6: warning - Tag @see: can't find ValidationException(String, IAFAState) in boden.IAFAState.ValidationException
+// boden\TestInvalid3.java:6: warning - Tag @see: can't find IAFA.State.ValidationException(String, IAFAState) in boden.IAFAState.ValidationException
+// boden\TestInvalid4.java:6: warning - Tag @see: can't find IAFAState in boden.IAFAState.ValidationException
+ "----------\n" +
+ "1. ERROR in boden\\TestInvalid1.java (at line 5)\n" +
+ " * @see ValidationException#ValidationException(String, IAFAState)\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Invalid qualification for member type constructor\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in boden\\TestInvalid2.java (at line 5)\n" +
+ " * @see IAFAState.ValidationException#ValidationException(String, IAFAState)\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Invalid qualification for member type constructor\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in boden\\TestInvalid3.java (at line 5)\n" +
+ " * @see IAFAState.ValidationException#IAFA.State.ValidationException(String, IAFAState)\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Invalid qualification for member type constructor\n" +
+ "----------\n" +
+ "----------\n" +
+ "1. ERROR in boden\\TestInvalid4.java (at line 5)\n" +
+ " * @see IAFAState.ValidationException#IAFAState .ValidationException(String, IAFAState)\n" +
+ " ^^^^^^^^^\n" +
+ "Javadoc: IAFAState cannot be resolved or is not a field\n" +
+ "----------\n"
+ );
+ }
+ public void testBug103304c() {
+ runNegativeTest(
+ new String[] {
+ "test/Test.java",
+ "package test;\n" +
+ "public interface Test {\n" +
+ " public class Level0 {\n" +
+ " public Level0() {}\n" +
+ " }\n" +
+ " public interface Member {\n" +
+ " public class Level1 {\n" +
+ " public Level1() {}\n" +
+ " }\n" +
+ " }\n" +
+ "}\n",
+ "test/C.java",
+ "package test;\n" +
+ "public class C {\n" +
+ " /**\n" +
+ " * @see Test.Level0#Test.Level0()\n" +
+ " */\n" +
+ " Test.Level0 valid = new Test.Level0();\n" +
+ " /**\n" +
+ " * @see Test.Level0#Level0()\n" +
+ " */\n" +
+ " Test.Level0 invalid = new Test.Level0();\n" +
+ "}\n"
+ },
+// test\C.java:10: warning - Tag @see: can't find Level0() in test.Test.Level0
+ "----------\n" +
+ "1. ERROR in test\\C.java (at line 8)\n" +
+ " * @see Test.Level0#Level0()\n" +
+ " ^^^^^^^^\n" +
+ "Javadoc: Invalid qualification for member type constructor\n" +
+ "----------\n"
+ );
+ }
+ public void testBug103304d() {
+ runNegativeTest(
+ new String[] {
+ "test/Test.java",
+ "package test;\n" +
+ "public interface Test {\n" +
+ " public class Level0 {\n" +
+ " public Level0() {}\n" +
+ " }\n" +
+ " public interface Member {\n" +
+ " public class Level1 {\n" +
+ " public Level1() {}\n" +
+ " }\n" +
+ " }\n" +
+ "}\n",
+ "test/C2.java",
+ "package test;\n" +
+ "public class C2 {\n" +
+ " /**\n" +
+ " * @see Test.Member.Level1#Test.Member.Level1()\n" +
+ " */\n" +
+ " Test.Member.Level1 valid = new Test.Member.Level1();\n" +
+ " /**\n" +
+ " * @see Test.Member.Level1#Level1()\n" +
+ " */\n" +
+ " Test.Member.Level1 invalid = new Test.Member.Level1();\n" +
+ " /**\n" +
+ " * @see Test.Member.Level1#Test.Level1()\n" +
+ " */\n" +
+ " Test.Member.Level1 wrong = new Test.Member.Level1();\n" +
+ "}\n"
+ },
+// test\C2.java:10: warning - Tag @see: can't find Level1() in test.Test.Member.Level1
+// test\C2.java:14: warning - Tag @see: can't find Test.Level1() in test.Test.Member.Level1
+ "----------\n" +
+ "1. ERROR in test\\C2.java (at line 8)\n" +
+ " * @see Test.Member.Level1#Level1()\n" +
+ " ^^^^^^^^\n" +
+ "Javadoc: Invalid qualification for member type constructor\n" +
+ "----------\n" +
+ "2. ERROR in test\\C2.java (at line 12)\n" +
+ " * @see Test.Member.Level1#Test.Level1()\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Javadoc: Invalid qualification for member type constructor\n" +
+ "----------\n"
+ );
+ }
+ public void testBug103304e() {
+ runConformTest(
+ new String[] {
+ "implicit/Valid.java",
+ "package implicit;\n" +
+ "public interface Valid {\n" +
+ " public class Level0 {\n" +
+ " /**\n" +
+ " * @see #Valid.Level0() Valid\n" +
+ " */\n" +
+ " public Level0() {}\n" +
+ " /**\n" +
+ " * @see #Valid.Level0(String) Valid\n" +
+ " */\n" +
+ " public Level0(String str) {}\n" +
+ " }\n" +
+ " public interface Member {\n" +
+ " public class Level1 {\n" +
+ " /**\n" +
+ " * @see #Valid.Member.Level1() Valid\n" +
+ " */\n" +
+ " public Level1() {}\n" +
+ " /**\n" +
+ " * @see #Valid.Member.Level1(int) Valid\n" +
+ " */\n" +
+ " public Level1(int x) {}\n" +
+ " }\n" +
+ " }\n" +
+ "}\n"
+ }
+ );
+ }
+ public void testBug103304f() {
+ runNegativeTest(
+ new String[] {
+ "implicit/Invalid.java",
+ "package implicit;\n" +
+ "public interface Invalid {\n" +
+ " public class Level0 {\n" +
+ " /**\n" +
+ " * @see #Level0() Invalid\n" +
+ " */\n" +
+ " public Level0() {}\n" +
+ " /**\n" +
+ " * @see #Level0(String) Invalid\n" +
+ " */\n" +
+ " public Level0(String str) {}\n" +
+ " }\n" +
+ " public interface Member {\n" +
+ " public class Level1 {\n" +
+ " /**\n" +
+ " * @see #Level1() Invalid\n" +
+ " * @see #Member.Level1() Invalid\n" +
+ " * @see #Invalid.Level1() Invalid\n" +
+ " */\n" +
+ " public Level1() {}\n" +
+ " /**\n" +
+ " * @see #Level1(int) Invalid\n" +
+ " * @see #Invalid.Level1(int) Invalid\n" +
+ " * @see #Member.Level1(int) Invalid\n" +
+ " */\n" +
+ " public Level1(int x) {}\n" +
+ " }\n" +
+ " }\n" +
+ "}\n"
+ },
+// implicit\Invalid.java:7: warning - Tag @see: can't find Level0() in implicit.Invalid.Level0
+// implicit\Invalid.java:11: warning - Tag @see: can't find Level0(String) in implicit.Invalid.Level0
+// implicit\Invalid.java:20: warning - Tag @see: can't find Level1() in implicit.Invalid.Member.Level1
+// implicit\Invalid.java:20: warning - Tag @see: can't find Member.Level1() in implicit.Invalid.Member.Level1
+// implicit\Invalid.java:20: warning - Tag @see: can't find Invalid.Level1() in implicit.Invalid.Member.Level1
+// implicit\Invalid.java:26: warning - Tag @see: can't find Level1(int) in implicit.Invalid.Member.Level1
+// implicit\Invalid.java:26: warning - Tag @see: can't find Invalid.Level1(int) in implicit.Invalid.Member.Level1
+// implicit\Invalid.java:26: warning - Tag @see: can't find Member.Level1(int) in implicit.Invalid.Member.Level1
+ "----------\n" +
+ "1. ERROR in implicit\\Invalid.java (at line 5)\n" +
+ " * @see #Level0() Invalid\n" +
+ " ^^^^^^^^\n" +
+ "Javadoc: Invalid qualification for member type constructor\n" +
+ "----------\n" +
+ "2. ERROR in implicit\\Invalid.java (at line 9)\n" +
+ " * @see #Level0(String) Invalid\n" +
+ " ^^^^^^^^^^^^^^\n" +
+ "Javadoc: Invalid qualification for member type constructor\n" +
+ "----------\n" +
+ "3. ERROR in implicit\\Invalid.java (at line 16)\n" +
+ " * @see #Level1() Invalid\n" +
+ " ^^^^^^^^\n" +
+ "Javadoc: Invalid qualification for member type constructor\n" +
+ "----------\n" +
+ "4. ERROR in implicit\\Invalid.java (at line 17)\n" +
+ " * @see #Member.Level1() Invalid\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Invalid qualification for member type constructor\n" +
+ "----------\n" +
+ "5. ERROR in implicit\\Invalid.java (at line 18)\n" +
+ " * @see #Invalid.Level1() Invalid\n" +
+ " ^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Invalid qualification for member type constructor\n" +
+ "----------\n" +
+ "6. ERROR in implicit\\Invalid.java (at line 22)\n" +
+ " * @see #Level1(int) Invalid\n" +
+ " ^^^^^^^^^^^\n" +
+ "Javadoc: Invalid qualification for member type constructor\n" +
+ "----------\n" +
+ "7. ERROR in implicit\\Invalid.java (at line 23)\n" +
+ " * @see #Invalid.Level1(int) Invalid\n" +
+ " ^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Invalid qualification for member type constructor\n" +
+ "----------\n" +
+ "8. ERROR in implicit\\Invalid.java (at line 24)\n" +
+ " * @see #Member.Level1(int) Invalid\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Invalid qualification for member type constructor\n" +
+ "----------\n"
+ );
+ }
+
+ /**
* Bug 112346: [javadoc] {@inheritedDoc} should be inactive for non-overridden method
* @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=112346"
*/
Index: src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForInterface.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForInterface.java,v
retrieving revision 1.19
diff -u -r1.19 JavadocTestForInterface.java
--- src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForInterface.java 9 Jun 2006 10:20:55 -0000 1.19
+++ src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForInterface.java 23 Jun 2006 07:47:46 -0000
@@ -365,17 +365,20 @@
this.runConformReferenceTest(
new String[] {
"test/IX.java",
- "package test;\n"
- + "import test.copy.*;\n"
- + " /**\n"
- + " * Valid external classes references \n"
- + " *\n"
- + " * @see VisibilityPublic Valid ref: visible class through import => no warning on import\n"
- + " * @see VisibilityPublic.VpPublic Valid ref: visible inner class in visible class \n"
- + " */\n"
- + "public interface IX {\n"
- + " public void foo();\n"
- + "}\n" });
+ "package test;\n" +
+ "import test.copy.*;\n" +
+ " /**\n" +
+ " * Valid external classes references \n" +
+ " *\n" +
+ " * @see VisibilityPublic Valid ref: visible class through import => no warning on import\n" +
+ // Inner classes are not visible in generated documentation
+ //" * @see VisibilityPublic.VpPublic Valid ref: visible inner class in visible class \n" +
+ " */\n" +
+ "public interface IX {\n" +
+ " public void foo();\n" +
+ "}\n"
+ }
+ );
}
public void test023() {
@@ -410,16 +413,19 @@
this.runConformReferenceTest(
new String[] {
"test/IX.java",
- "package test;\n"
- + " /**\n"
- + " * Valid external classes references \n"
- + " *\n"
- + " * @see test.copy.VisibilityPublic Valid ref: visible class through import => no warning on import\n"
- + " * @see test.copy.VisibilityPublic.VpPublic Valid ref: visible inner class in visible class \n"
- + " */\n"
- + "public interface IX {\n"
- + " public void foo();\n"
- + "}\n" });
+ "package test;\n" +
+ " /**\n" +
+ " * Valid external classes references \n" +
+ " *\n" +
+ " * @see test.copy.VisibilityPublic Valid ref: visible class through import => no warning on import\n" +
+ // Inner classes are not visible in generated documentation
+ //" * @see test.copy.VisibilityPublic.VpPublic Valid ref: visible inner class in visible class \n" +
+ " */\n" +
+ "public interface IX {\n" +
+ " public void foo();\n" +
+ "}\n"
+ }
+ );
}
// @see Field references
@@ -1622,17 +1628,20 @@
this.runConformReferenceTest(
new String[] {
"test/IX.java",
- "package test;\n"
- + "import test.copy.*;\n"
- + "public interface IX {\n"
- + " /**\n"
- + " * Valid external classes references \n"
- + " *\n"
- + " * @see VisibilityPublic Valid ref: visible class through import => no warning on import\n"
- + " * @see VisibilityPublic.VpPublic Valid ref: visible inner class in visible class \n"
- + " */\n"
- + " public void foo();\n"
- + "}\n" });
+ "package test;\n" +
+ "import test.copy.*;\n" +
+ "public interface IX {\n" +
+ " /**\n" +
+ " * Valid external classes references \n" +
+ " *\n" +
+ " * @see VisibilityPublic Valid ref: visible class through import => no warning on import\n" +
+ // Inner classes are not visible in generated documentation
+ //" * @see VisibilityPublic.VpPublic Valid ref: visible inner class in visible class \n" +
+ " */\n" +
+ " public void foo();\n" +
+ "}\n"
+ }
+ );
}
public void test098() {
@@ -1667,16 +1676,19 @@
this.runConformReferenceTest(
new String[] {
"test/IX.java",
- "package test;\n"
- + "public interface IX {\n"
- + " /**\n"
- + " * Valid external classes references \n"
- + " *\n"
- + " * @see test.copy.VisibilityPublic Valid ref: visible class through import => no warning on import\n"
- + " * @see test.copy.VisibilityPublic.VpPublic Valid ref: visible inner class in visible class \n"
- + " */\n"
- + " public void foo();\n"
- + "}\n" });
+ "package test;\n" +
+ "public interface IX {\n" +
+ " /**\n" +
+ " * Valid external classes references \n" +
+ " *\n" +
+ " * @see test.copy.VisibilityPublic Valid ref: visible class through import => no warning on import\n" +
+ // Inner classes are not visible in generated documentation
+ //" * @see test.copy.VisibilityPublic.VpPublic Valid ref: visible inner class in visible class \n" +
+ " */\n" +
+ " public void foo();\n" +
+ "}\n"
+ }
+ );
}
// @see tag: field references
Index: src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForField.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForField.java,v
retrieving revision 1.14
diff -u -r1.14 JavadocTestForField.java
--- src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForField.java 29 Mar 2006 03:50:22 -0000 1.14
+++ src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForField.java 23 Jun 2006 07:47:45 -0000
@@ -407,17 +407,20 @@
this.runConformReferenceTest(
new String[] {
"test/X.java",
- "package test;\n"
- + "import test.copy.*;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Valid external classes references \n"
- + " *\n"
- + " * @see VisibilityPublic Valid ref: visible class through import => no warning on import\n"
- + " * @see VisibilityPublic.VpPublic Valid ref: visible inner class in visible class \n"
- + " */\n"
- + " public int x;\n"
- + "}\n" });
+ "package test;\n" +
+ "import test.copy.*;\n" +
+ "public class X {\n" +
+ " /**\n" +
+ " * Valid external classes references \n" +
+ " *\n" +
+ " * @see VisibilityPublic Valid ref: visible class through import => no warning on import\n" +
+ // Inner classes are not visible in generated documentation
+ //" * @see VisibilityPublic.VpPublic Valid ref: visible inner class in visible class \n" +
+ " */\n" +
+ " public int x;\n" +
+ "}\n"
+ }
+ );
}
public void test023() {
@@ -452,16 +455,19 @@
this.runConformReferenceTest(
new String[] {
"test/X.java",
- "package test;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Valid external classes references \n"
- + " *\n"
- + " * @see test.copy.VisibilityPublic Valid ref: visible class through import => no warning on import\n"
- + " * @see test.copy.VisibilityPublic.VpPublic Valid ref: visible inner class in visible class \n"
- + " */\n"
- + " public int x;\n"
- + "}\n" });
+ "package test;\n" +
+ "public class X {\n" +
+ " /**\n" +
+ " * Valid external classes references \n" +
+ " *\n" +
+ " * @see test.copy.VisibilityPublic Valid ref: visible class through import => no warning on import\n" +
+ // Inner classes are not visible in generated documentation
+ //" * @see test.copy.VisibilityPublic.VpPublic Valid ref: visible inner class in visible class \n" +
+ " */\n" +
+ " public int x;\n" +
+ "}\n"
+ }
+ );
}
// @see Field references
Index: src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForConstructor.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForConstructor.java,v
retrieving revision 1.16
diff -u -r1.16 JavadocTestForConstructor.java
--- src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForConstructor.java 29 Mar 2006 03:50:23 -0000 1.16
+++ src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForConstructor.java 23 Jun 2006 07:47:44 -0000
@@ -330,18 +330,21 @@
this.runConformReferenceTest(
new String[] {
"test/X.java",
- "package test;\n"
- + "import test.copy.*;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Valid external classes references \n"
- + " *\n"
- + " * @see VisibilityPublic Valid ref: visible class through import => no warning on import\n"
- + " * @see VisibilityPublic.VpPublic Valid ref: visible inner class in visible class \n"
- + " */\n"
- + " public X() {\n"
- + " }\n"
- + "}\n" });
+ "package test;\n" +
+ "import test.copy.*;\n" +
+ "public class X {\n" +
+ " /**\n" +
+ " * Valid external classes references \n" +
+ " *\n" +
+ " * @see VisibilityPublic Valid ref: visible class through import => no warning on import\n" +
+ // Inner classes are not visible in generated documentation
+ //" * @see VisibilityPublic.VpPublic Valid ref: visible inner class in visible class \n" +
+ " */\n" +
+ " public X() {\n" +
+ " }\n" +
+ "}\n"
+ }
+ );
}
public void test023() {
@@ -377,17 +380,20 @@
this.runConformReferenceTest(
new String[] {
"test/X.java",
- "package test;\n"
- + "public class X {\n"
- + " /**\n"
- + " * Valid external classes references \n"
- + " *\n"
- + " * @see test.copy.VisibilityPublic Valid ref: visible class through import => no warning on import\n"
- + " * @see test.copy.VisibilityPublic.VpPublic Valid ref: visible inner class in visible class \n"
- + " */\n"
- + " public X() {\n"
- + " }\n"
- + "}\n" });
+ "package test;\n" +
+ "public class X {\n" +
+ " /**\n" +
+ " * Valid external classes references \n" +
+ " *\n" +
+ " * @see test.copy.VisibilityPublic Valid ref: visible class through import => no warning on import\n" +
+ // Inner classes are not visible in generated documentation
+ //" * @see test.copy.VisibilityPublic.VpPublic Valid ref: visible inner class in visible class \n" +
+ " */\n" +
+ " public X() {\n" +
+ " }\n" +
+ "}\n"
+ }
+ );
}
// @see Field references
#P org.eclipse.jdt.core.tests.model
Index: src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest.java,v
retrieving revision 1.71
diff -u -r1.71 ASTConverterJavadocTest.java
--- src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest.java 8 Jun 2006 13:09:33 -0000 1.71
+++ src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest.java 23 Jun 2006 07:48:01 -0000
@@ -114,7 +114,7 @@
// Run test cases subset
COPY_DIR = false;
System.err.println("WARNING: only subset of tests will be executed!!!");
- suite.addTest(new ASTConverterJavadocTest("testBug130752"));
+ suite.addTest(new ASTConverterJavadocTest("testBug103304"));
return suite;
}
@@ -989,10 +989,27 @@
}
// Verify member name position
Name name = methodRef.getName();
- text = new String(source, start, name.getLength());
- assumeEquals(prefix+"Misplaced method ref name at <"+start+">: ", text, name.toString());
+ int nameLength = name.getLength();
+ text = new String(source, start, nameLength);
+ if (!text.equals(name.toString())) { // may have qualified constructor reference for inner classes
+ if (methodRef.getQualifier().isQualifiedName()) {
+ text = new String(source, start, methodRef.getQualifier().getLength());
+ assumeEquals(prefix+"Misplaced method ref name at <"+start+">: ", text, methodRef.getQualifier().toString());
+ while (source[start] != '.' || Character.isWhitespace(source[start])) {
+ start++; // purge non-stored characters
+ }
+ start++;
+ } else {
+ while (source[start] != '.' || Character.isWhitespace(source[start])) {
+ start++; // purge non-stored characters
+ }
+ start++;
+ text = new String(source, start, nameLength);
+ assumeEquals(prefix+"Misplaced method ref name at <"+start+">: ", text, name.toString());
+ }
+ }
verifyNamePositions(start, name, source);
- start += name.getLength();
+ start += nameLength;
// Verify arguments starting open parenthesis
while (source[start] == '*' || Character.isWhitespace(source[start])) {
start++; // purge non-stored characters
@@ -2989,6 +3006,52 @@
}
/**
+ * @bug 103304: [Javadoc] Wrong reference proposal for inner classes.
+ * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=103304"
+ */
+ public void testBug103304() throws JavaModelException {
+ this.packageBinding = false; // do NOT verify that qualification only can be package name
+ workingCopies = new ICompilationUnit[1];
+ workingCopies[0] = getWorkingCopy("/Converter15/src/javadoc/b103304/Test.java",
+ "package javadoc.b103304;\n" +
+ "interface IAFAState {\n" +
+ " public class ValidationException extends Exception {\n" +
+ " public ValidationException(String variableName, IAFAState subformula) {\n" +
+ " super(\"Variable \'\"+variableName+\"\' may be unbound in \'\"+subformula+\"\'\");\n" +
+ " }\n" +
+ " }\n" +
+ "}\n" +
+ "public class Test {\n" +
+ " /**\n" +
+ " * @see IAFAState.ValidationException#IAFAState.ValidationException(String, IAFAState)\n" +
+ " */\n" +
+ " IAFAState.ValidationException valid;\n" +
+ "}\n"
+ );
+ CompilationUnit compilUnit = (CompilationUnit) runConversion(workingCopies[0], true);
+ verifyWorkingCopiesComments();
+ if (docCommentSupport.equals(JavaCore.ENABLED)) {
+ // Verify comment type
+ Iterator unitComments = compilUnit.getCommentList().iterator();
+ while (unitComments.hasNext()) {
+ Comment comment = (Comment) unitComments.next();
+ assertEquals("Comment should be javadoc", comment.getNodeType(), ASTNode.JAVADOC);
+ Javadoc javadoc = (Javadoc) comment;
+
+ // Verify that there's always a method reference in tags
+ List tags = javadoc.tags();
+ int size = tags.size();
+ for (int i=0; i= ClassFileConstants.JDK1_5;
+ boolean source15 = scope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5;
+ int scopeModifiers = -1;
if (reference instanceof JavadocFieldReference) {
JavadocFieldReference fieldRef = (JavadocFieldReference) reference;
- int modifiers = fieldRef.binding==null ? -1 : fieldRef.binding.modifiers;
// Verify if this is a method reference
// see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=51911
if (fieldRef.methodBinding != null) {
// cannot refer to method for @value tag
if (fieldRef.tagValue == JavadocTagConstants.TAG_VALUE_VALUE) {
- scope.problemReporter().javadocInvalidValueReference(fieldRef.sourceStart, fieldRef.sourceEnd, modifiers);
+ if (scopeModifiers == -1) scopeModifiers = scope.getDeclarationModifiers();
+ scope.problemReporter().javadocInvalidValueReference(fieldRef.sourceStart, fieldRef.sourceEnd, scopeModifiers);
}
else if (fieldRef.receiverType != null) {
fieldRef.superAccess = scope.enclosingSourceType().isCompatibleWith(fieldRef.receiverType);
@@ -252,35 +281,81 @@
}
// Verify whether field ref should be static or not (for @value tags)
- else if (verifyValues && fieldRef.binding != null && fieldRef.binding.isValidBinding()) {
+ else if (source15 && fieldRef.binding != null && fieldRef.binding.isValidBinding()) {
if (fieldRef.tagValue == JavadocTagConstants.TAG_VALUE_VALUE && !fieldRef.binding.isStatic()) {
- scope.problemReporter().javadocInvalidValueReference(fieldRef.sourceStart, fieldRef.sourceEnd, modifiers);
+ if (scopeModifiers == -1) scopeModifiers = scope.getDeclarationModifiers();
+ scope.problemReporter().javadocInvalidValueReference(fieldRef.sourceStart, fieldRef.sourceEnd, scopeModifiers);
}
}
-
+
// That's it for field references
return;
}
- // If not 1.5 level, verification is finished
- if (!verifyValues) return;
+ // Verify type references
+ if ((reference instanceof JavadocSingleTypeReference || reference instanceof JavadocQualifiedTypeReference) && reference.resolvedType instanceof ReferenceBinding) {
+ ReferenceBinding resolvedType = (ReferenceBinding) reference.resolvedType;
+ if (reference.resolvedType.isValidBinding()) {
+
+ // member types
+ if (resolvedType.isMemberType()) {
+ ReferenceBinding topLevelType = resolvedType;
+ int depth = 0;
+ while (topLevelType.enclosingType() != null) {
+ topLevelType = topLevelType.enclosingType();
+ depth++;
+ }
+ ClassScope topLevelScope = scope.classScope();
+ // when scope is not on compilation unit type, then inner class may not be visible...
+ if (topLevelScope.parent.kind != Scope.COMPILATION_UNIT_SCOPE ||
+ !CharOperation.equals(topLevelType.sourceName, topLevelScope.referenceContext.name)) {
+ topLevelScope = topLevelScope.outerMostClassScope();
+ if (reference instanceof JavadocSingleTypeReference) {
+ // inner class single reference can only be done in same unit
+ if ((!source15 && depth == 1) || topLevelType != topLevelScope.referenceContext.binding) {
+ if (scopeModifiers == -1) scopeModifiers = scope.getDeclarationModifiers();
+ scope.problemReporter().javadocNotVisibleReference(reference.sourceStart, reference.sourceEnd, scopeModifiers);
+ }
+ } else {
+ // inner class qualified reference can only be done in same package
+ if (topLevelType.getPackage() != topLevelScope.referenceContext.binding.getPackage()) {
+ if (scopeModifiers == -1) scopeModifiers = scope.getDeclarationModifiers();
+ scope.problemReporter().javadocNotVisibleReference(reference.sourceStart, reference.sourceEnd, scopeModifiers);
+ }
+ }
+ }
+ }
+
+ // reference must have enough visibility to be used
+ if (!canBeSeen(scope.problemReporter().options.reportInvalidJavadocTagsVisibility, resolvedType)) {
+ if (scopeModifiers == -1) scopeModifiers = scope.getDeclarationModifiers();
+ scope.problemReporter().javadocNotVisibleReference(reference.sourceStart, reference.sourceEnd, scopeModifiers);
+ }
+ }
+ }
// Verify that message reference are not used for @value tags
- else if (reference instanceof JavadocMessageSend) {
+ if (reference instanceof JavadocMessageSend) {
JavadocMessageSend msgSend = (JavadocMessageSend) reference;
- int modifiers = msgSend.binding==null ? -1 : msgSend.binding.modifiers;
- if (msgSend.tagValue == JavadocTagConstants.TAG_VALUE_VALUE) { // cannot refer to method for @value tag
- scope.problemReporter().javadocInvalidValueReference(msgSend.sourceStart, msgSend.sourceEnd, modifiers);
+
+ // tag value
+ if (source15 && msgSend.tagValue == JavadocTagConstants.TAG_VALUE_VALUE) { // cannot refer to method for @value tag
+ if (scopeModifiers == -1) scopeModifiers = scope.getDeclarationModifiers();
+ scope.problemReporter().javadocInvalidValueReference(msgSend.sourceStart, msgSend.sourceEnd, scopeModifiers);
}
+
}
- // Verify that constructorreference are not used for @value tags
+ // Verify that constructor reference are not used for @value tags
else if (reference instanceof JavadocAllocationExpression) {
JavadocAllocationExpression alloc = (JavadocAllocationExpression) reference;
- int modifiers = alloc.binding==null ? -1 : alloc.binding.modifiers;
- if (alloc.tagValue == JavadocTagConstants.TAG_VALUE_VALUE) { // cannot refer to method for @value tag
- scope.problemReporter().javadocInvalidValueReference(alloc.sourceStart, alloc.sourceEnd, modifiers);
+
+ // tag value
+ if (source15 && alloc.tagValue == JavadocTagConstants.TAG_VALUE_VALUE) { // cannot refer to method for @value tag
+ if (scopeModifiers == -1) scopeModifiers = scope.getDeclarationModifiers();
+ scope.problemReporter().javadocInvalidValueReference(alloc.sourceStart, alloc.sourceEnd, scopeModifiers);
}
+
}
// Verify that there's no type variable reference
Index: compiler/org/eclipse/jdt/internal/compiler/ast/JavadocAllocationExpression.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocAllocationExpression.java,v
retrieving revision 1.27
diff -u -r1.27 JavadocAllocationExpression.java
--- compiler/org/eclipse/jdt/internal/compiler/ast/JavadocAllocationExpression.java 28 Mar 2006 20:28:15 -0000 1.27
+++ compiler/org/eclipse/jdt/internal/compiler/ast/JavadocAllocationExpression.java 23 Jun 2006 07:48:06 -0000
@@ -10,15 +10,17 @@
*******************************************************************************/
package org.eclipse.jdt.internal.compiler.ast;
+import org.eclipse.jdt.core.compiler.CharOperation;
import org.eclipse.jdt.internal.compiler.impl.Constant;
import org.eclipse.jdt.internal.compiler.lookup.*;
public class JavadocAllocationExpression extends AllocationExpression {
public int tagSourceStart, tagSourceEnd;
- public int tagValue;
+ public int tagValue, memberStart;
public boolean superAccess = false;
-
+ public char[][] qualification;
+
public JavadocAllocationExpression(int start, int end) {
this.sourceStart = start;
this.sourceEnd = end;
@@ -28,7 +30,7 @@
this((int) (pos >>> 32), (int) pos);
}
- private TypeBinding internalResolveType(Scope scope) {
+ TypeBinding internalResolveType(Scope scope) {
// Propagate the type checking to the arguments, and check if the constructor is defined.
this.constant = Constant.NotAConstant;
@@ -120,6 +122,20 @@
}
}
}
+ } else if (this.resolvedType.isMemberType()) { // inner class constructor reference must be qualified
+ int length = qualification.length;
+ ReferenceBinding enclosingTypeBinding = allocationType;
+ if (type instanceof JavadocQualifiedTypeReference && (((JavadocQualifiedTypeReference)type).tokens.length != length)) {
+ scope.problemReporter().javadocInvalidConstructorQualification(this.memberStart+1, this.sourceEnd); //, scope.getDeclarationModifiers());
+ } else {
+ int idx = length;
+ while (idx > 0 && CharOperation.equals(qualification[--idx], enclosingTypeBinding.sourceName) && (enclosingTypeBinding = enclosingTypeBinding.enclosingType()) != null) {
+ // verify that each qualification token matches enclosing types
+ }
+ if (idx > 0 || enclosingTypeBinding != null) {
+ scope.problemReporter().javadocInvalidConstructorQualification(this.memberStart+1, this.sourceEnd); //, scope.getDeclarationModifiers());
+ }
+ }
}
if (isMethodUseDeprecated(this.binding, scope, true)) {
scope.problemReporter().javadocDeprecatedMethod(this.binding, this, scope.getDeclarationModifiers());
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.176
diff -u -r1.176 IProblem.java
--- compiler/org/eclipse/jdt/core/compiler/IProblem.java 16 May 2006 16:37:58 -0000 1.176
+++ compiler/org/eclipse/jdt/core/compiler/IProblem.java 23 Jun 2006 07:48:05 -0000
@@ -753,6 +753,16 @@
/*
* Javadoc comments
*/
+ /**
+ * Problem signaled on a reference to an java element which has a too low visibility level.
+ * @since 3.3
+ */
+ int JavadocNotVisibleReference = Javadoc + Internal + 465;
+ /**
+ * Problem signaled on an unqualified inner class constructor reference.
+ * @since 3.3
+ */
+ int JavadocInvalidConstructorQualification = Javadoc + Internal + 466;
/** @since 3.2 */
int JavadocMissingIdentifier = Javadoc + Internal + 467;
/** @since 3.2 */
Index: codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionJavadocParser.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionJavadocParser.java,v
retrieving revision 1.3
diff -u -r1.3 SelectionJavadocParser.java
--- codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionJavadocParser.java 4 Nov 2005 15:59:32 -0000 1.3
+++ codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionJavadocParser.java 23 Jun 2006 07:48:04 -0000
@@ -101,8 +101,9 @@
* Otherwise return null as we do not need this reference.
*/
protected Object createMethodReference(Object receiver, List arguments) throws InvalidInputException {
- int start = (int) (this.identifierPositionStack[0] >>> 32);
- int end = (int) this.identifierPositionStack[0];
+ int memberPtr = this.identifierLengthStack[0] - 1; // may be > 0 for inner class constructor reference
+ int start = (int) (this.identifierPositionStack[memberPtr] >>> 32);
+ int end = (int) this.identifierPositionStack[memberPtr];
if (start <= this.selectionStart && this.selectionEnd <= end) {
selectedNode = (ASTNode) super.createMethodReference(receiver, arguments);
this.abort = true;
@@ -134,9 +135,10 @@
if (start <= this.selectionStart && this.selectionEnd <= end) {
int pos = i + 1;
char[][] tokens = new char[pos][];
- System.arraycopy(this.identifierStack, this.identifierPtr+1, tokens, 0, pos);
+ int ptr = this.identifierPtr - size;
+ System.arraycopy(this.identifierStack, ptr, tokens, 0, pos);
long[] positions = new long[pos];
- System.arraycopy(this.identifierPositionStack, this.identifierPtr + 1, positions, 0, pos);
+ System.arraycopy(this.identifierPositionStack, ptr, positions, 0, pos);
selectedNode = new JavadocQualifiedTypeReference(tokens, positions, this.tagSourceStart, this.tagSourceEnd);
this.abort = true; // we got selected node => cancel parse
if (SelectionEngine.DEBUG) {
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.204
diff -u -r1.204 messages.properties
--- compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties 9 Jun 2006 10:20:47 -0000 1.204
+++ compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties 23 Jun 2006 07:48:10 -0000
@@ -362,6 +362,8 @@
460 = Empty block should be documented
### DOC
+465 = Not visible reference
+466 = Invalid qualification for member type constructor
467 = Missing identifier
468 = Cannot make a static reference to the non-static type variable {0}
469 = Invalid param tag type parameter name
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.312
diff -u -r1.312 ProblemReporter.java
--- compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java 9 Jun 2006 10:20:47 -0000 1.312
+++ compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java 23 Jun 2006 07:48:10 -0000
@@ -215,6 +215,7 @@
case IProblem.JavadocDuplicateParamName:
case IProblem.JavadocMissingParamName:
case IProblem.JavadocMissingIdentifier:
+ case IProblem.JavadocInvalidConstructorQualification:
case IProblem.JavadocInvalidThrowsClassName:
case IProblem.JavadocDuplicateThrowsClassName:
case IProblem.JavadocMissingThrowsClassName:
@@ -255,6 +256,7 @@
case IProblem.JavadocUsingDeprecatedConstructor:
case IProblem.JavadocUsingDeprecatedMethod:
case IProblem.JavadocUsingDeprecatedType:
+ case IProblem.JavadocNotVisibleReference:
return CompilerOptions.InvalidJavadoc;
case IProblem.JavadocMissingParamTag:
@@ -988,6 +990,7 @@
case IProblem.JavadocDuplicateParamName:
case IProblem.JavadocMissingParamName:
case IProblem.JavadocMissingIdentifier:
+ case IProblem.JavadocInvalidConstructorQualification:
case IProblem.JavadocInvalidThrowsClassName:
case IProblem.JavadocDuplicateThrowsClassName:
case IProblem.JavadocMissingThrowsClassName:
@@ -1042,6 +1045,7 @@
case IProblem.JavadocNotVisibleConstructor:
case IProblem.JavadocNotVisibleMethod:
case IProblem.JavadocNotVisibleType:
+ case IProblem.JavadocNotVisibleReference:
if (!(this.options.reportInvalidJavadocTags && this.options.reportInvalidJavadocTagsNotVisibleRef)) {
return ProblemSeverities.Ignore;
}
@@ -3578,13 +3582,17 @@
int severity = computeSeverity(IProblem.JavadocUsingDeprecatedType);
if (severity == ProblemSeverities.Ignore) return;
if (javadocVisibility(this.options.reportInvalidJavadocTagsVisibility, modifiers)) {
- this.handle(
- IProblem.JavadocUsingDeprecatedType,
- new String[] {new String(type.readableName())},
- new String[] {new String(type.shortReadableName())},
- severity,
- location.sourceStart,
- location.sourceEnd);
+ if (type.isMemberType() && type instanceof ReferenceBinding && !javadocVisibility(this.options.reportInvalidJavadocTagsVisibility, ((ReferenceBinding)type).modifiers)) {
+ this.handle(IProblem.JavadocNotVisibleReference, NoArgument, NoArgument, location.sourceStart, location.sourceEnd);
+ } else {
+ this.handle(
+ IProblem.JavadocUsingDeprecatedType,
+ new String[] {new String(type.readableName())},
+ new String[] {new String(type.shortReadableName())},
+ severity,
+ location.sourceStart,
+ location.sourceEnd);
+ }
}
}
public void javadocDuplicatedParamTag(char[] token, int sourceStart, int sourceEnd, int modifiers) {
@@ -3807,6 +3815,9 @@
statement.sourceStart,
statement.sourceEnd);
}
+public void javadocInvalidConstructorQualification(int sourceStart, int sourceEnd){
+ this.handle(IProblem.JavadocInvalidConstructorQualification, NoArgument, NoArgument, sourceStart, sourceEnd);
+}
/*
* Similar implementation than invalidField(FieldReference...)
* Note that following problem id cannot occur for Javadoc:
@@ -4208,6 +4219,10 @@
typeRef.sourceEnd);
}
}
+public void javadocNotVisibleReference(int sourceStart, int sourceEnd, int modifiers) {
+ if (javadocVisibility(this.options.reportInvalidJavadocTagsVisibility, modifiers))
+ this.handle(IProblem.JavadocNotVisibleReference, NoArgument, NoArgument, sourceStart, sourceEnd);
+}
public void javadocUndeclaredParamTagName(char[] token, int sourceStart, int sourceEnd, int modifiers) {
int severity = computeSeverity(IProblem.JavadocInvalidParamName);
if (severity == ProblemSeverities.Ignore) return;
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.54
diff -u -r1.54 JavadocParser.java
--- compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java 29 Mar 2006 02:47:34 -0000 1.54
+++ compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java 23 Jun 2006 07:48:07 -0000
@@ -180,36 +180,57 @@
TypeReference typeRef = (TypeReference) receiver;
// Decide whether we have a constructor or not
boolean isConstructor = false;
+ int length = this.identifierLengthStack[0]; // may be > 0 for inner class constructor reference
if (typeRef == null) {
char[] name = this.sourceParser.compilationUnit.getMainTypeName();
TypeDeclaration typeDecl = getParsedTypeDeclaration();
if (typeDecl != null) {
name = typeDecl.name;
}
- isConstructor = CharOperation.equals(this.identifierStack[0], name);
+ isConstructor = CharOperation.equals(this.identifierStack[length-1], name);
typeRef = new JavadocImplicitTypeReference(name, this.memberStart);
} else {
- char[] name = null;
if (typeRef instanceof JavadocSingleTypeReference) {
- name = ((JavadocSingleTypeReference)typeRef).token;
+ char[] name = ((JavadocSingleTypeReference)typeRef).token;
+ isConstructor = CharOperation.equals(this.identifierStack[length-1], name);
} else if (typeRef instanceof JavadocQualifiedTypeReference) {
char[][] tokens = ((JavadocQualifiedTypeReference)typeRef).tokens;
- name = tokens[tokens.length-1];
+ int last = tokens.length-1;
+ isConstructor = CharOperation.equals(this.identifierStack[length-1], tokens[last]);
+ if (isConstructor) {
+ boolean valid = true;
+ if (valid) {
+ for (int i=0; i>> 32);
- int refEnd = (int) this.identifierPositionStack[0];
+ int memberPtr = this.identifierLengthStack[0] - 1; // may be > 0 for inner class constructor reference
+ int refStart = (int) (this.identifierPositionStack[memberPtr] >>> 32);
+ int refEnd = (int) this.identifierPositionStack[memberPtr];
boolean inCompletion = (refStart <= (this.cursorLocation+1) && this.cursorLocation <= refEnd) // completion cursor is between first and last stacked identifiers
|| ((refStart == (refEnd+1) && refEnd == this.cursorLocation)) // or it's a completion on empty token
|| (this.memberStart == this.cursorLocation); // or it's a completion just after the member separator with an identifier after the cursor
@@ -226,7 +227,6 @@
this.completionNode = new CompletionOnJavadocQualifiedTypeReference(tokens, this.identifierStack[this.identifierPtr], positions, this.tagSourceStart, this.tagSourceEnd);
}
}
- this.identifierPtr -= nbIdentifiers;
if (CompletionEngine.DEBUG) {
System.out.println(" completion partial qualified type="+completionNode); //$NON-NLS-1$
@@ -792,7 +792,7 @@
// special case of completion just before the dot.
return createTypeReference(primitiveToken);
}
- int idLength = this.identifierLengthStack[this.identifierLengthPtr--];
+ int idLength = this.identifierLengthStack[this.identifierLengthPtr];
char[][] tokens = new char[idLength][];
int startPtr = this.identifierPtr-idLength+1;
System.arraycopy(this.identifierStack, startPtr, tokens, 0, idLength);
@@ -800,7 +800,6 @@
System.arraycopy(this.identifierPositionStack, startPtr, positions, 0, idLength);
positions[idLength] = (((long)this.tokenPreviousPosition)<<32) + this.tokenPreviousPosition;
this.completionNode = new CompletionOnJavadocQualifiedTypeReference(tokens, CharOperation.NO_CHAR, positions, this.tagSourceStart, this.tagSourceEnd);
- this.identifierPtr -= idLength;
if (CompletionEngine.DEBUG) {
System.out.println(" completion partial qualified type="+completionNode); //$NON-NLS-1$
Index: dom/org/eclipse/jdt/core/dom/DocCommentParser.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DocCommentParser.java,v
retrieving revision 1.34
diff -u -r1.34 DocCommentParser.java
--- dom/org/eclipse/jdt/core/dom/DocCommentParser.java 29 Mar 2006 02:54:50 -0000 1.34
+++ dom/org/eclipse/jdt/core/dom/DocCommentParser.java 23 Jun 2006 07:48:11 -0000
@@ -86,7 +86,7 @@
buffer.append(super.toString());
return buffer.toString();
}
-
+
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.compiler.parser.AbstractCommentParser#createArgumentReference(char[], java.lang.Object, int)
*/
@@ -167,13 +167,13 @@
// Create method ref
MethodRef methodRef = this.ast.newMethodRef();
SimpleName methodName = new SimpleName(this.ast);
- methodName.internalSetIdentifier(new String(this.identifierStack[0]));
+ int memberPtr = this.identifierLengthStack[0] - 1;
+ methodName.internalSetIdentifier(new String(this.identifierStack[memberPtr]));
methodRef.setName(methodName);
- int start = (int) (this.identifierPositionStack[0] >>> 32);
- int end = (int) this.identifierPositionStack[0];
+ int start = (int) (this.identifierPositionStack[memberPtr] >>> 32);
+ int end = (int) this.identifierPositionStack[memberPtr];
methodName.setSourceRange(start, end - start + 1);
// Set qualifier
-// int end = methodName.getStartPosition()+methodName.getLength()-1;
if (receiver == null) {
start = this.memberStart;
methodRef.setSourceRange(start, end - start + 1);
@@ -188,10 +188,8 @@
while (parameters.hasNext()) {
MethodRefParameter param = (MethodRefParameter) parameters.next();
methodRef.parameters().add(param);
-// end = param.getStartPosition()+param.getLength()-1;
}
}
-// methodRef.setSourceRange(start, end-start+1);
methodRef.setSourceRange(start, this.scanner.getCurrentTokenEndPosition()-start+1);
return methodRef;
}
@@ -239,7 +237,7 @@
* @see org.eclipse.jdt.internal.compiler.parser.AbstractCommentParser#createTypeReference()
*/
protected Object createTypeReference(int primitiveToken) {
- int size = this.identifierLengthStack[this.identifierLengthPtr--];
+ int size = this.identifierLengthStack[this.identifierLengthPtr];
String[] identifiers = new String[size];
int pos = this.identifierPtr - size + 1;
for (int i = 0; i < size; i++) {
@@ -307,18 +305,9 @@
int end = (int) this.identifierPositionStack[pos];
typeRef.setSourceRange(start, end-start+1);
}
- this.identifierPtr -= size;
return typeRef;
}
- /*
- * Parse @return tag declaration
- */
- protected boolean parseReturn() {
- createTag();
- return true;
- }
-
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.compiler.parser.AbstractCommentParser#parseIdentifierTag(boolean)
*/
@@ -332,6 +321,14 @@
return false;
}
+ /*
+ * Parse @return tag declaration
+ */
+ protected boolean parseReturn() {
+ createTag();
+ return true;
+ }
+
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.compiler.parser.AbstractCommentParser#parseTag(int)
*/