diff options
author | Kim Moir | 2009-11-10 16:29:15 +0000 |
---|---|---|
committer | Kim Moir | 2009-11-10 16:29:15 +0000 |
commit | 69a570824b25ed4f8b10b179d88c81f5fa65b02d (patch) | |
tree | f715aedc0d20de70f43cabbef35e248a02c99c67 | |
parent | a3769525f23db855d7d74b04a7a412165a0d787e (diff) | |
download | eclipse.jdt.core-JUnit4_incubator_bug153429.tar.gz eclipse.jdt.core-JUnit4_incubator_bug153429.tar.xz eclipse.jdt.core-JUnit4_incubator_bug153429.zip |
21 files changed, 3745 insertions, 1882 deletions
diff --git a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/TestingEnvironment.java b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/TestingEnvironment.java index 1d03552aa1..518fd16270 100644 --- a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/TestingEnvironment.java +++ b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/TestingEnvironment.java @@ -438,6 +438,22 @@ public void cleanBuild() { } return project; } + + /** + * Safely delete the given resource. + */ + void deleteResource(IResource resource) { + int retryCount = 0; // wait 1 minute at most + IStatus status = null; + while (++retryCount <= 6) { + status = Util.delete(resource); + if (status.isOK()) { + return; + } + System.gc(); + } + handleCoreException(new CoreException(status)); + } /** Batch builds the workspace. A workspace must be * open. @@ -825,11 +841,7 @@ public void cleanBuild() { checkAssertion("a workspace must be open", this.isOpen); //$NON-NLS-1$ className += ".class"; //$NON-NLS-1$ IFolder packageFolder = this.workspace.getRoot().getFolder(packagePath); - try { - packageFolder.getFile(className).delete(true, null); - } catch (CoreException e) { - handle(e); - } + deleteResource(packageFolder.getFile(className)); } /** Removes a class from the given package in the workspace. @@ -840,11 +852,7 @@ public void cleanBuild() { checkAssertion("a workspace must be open", this.isOpen); //$NON-NLS-1$ className += ".java"; //$NON-NLS-1$ IFolder packageFolder = this.workspace.getRoot().getFolder(packagePath); - try { - packageFolder.getFile(className).delete(true, null); - } catch (CoreException e) { - handle(e); - } + deleteResource(packageFolder.getFile(className)); } /** Removes a package from the given package fragment root @@ -855,11 +863,7 @@ public void cleanBuild() { IPath path = packageFragmentRootPath.append(packageName.replace('.', IPath.SEPARATOR)); IFolder folder = this.workspace.getRoot().getFolder(path); - try { - folder.delete(false, null); - } catch (CoreException e) { - handle(e); - } + deleteResource(folder); } /** Removes the given package fragment root from the @@ -870,11 +874,7 @@ public void cleanBuild() { if (packageFragmentRootName.length() > 0) { IFolder folder = getProject(projectPath).getFolder(packageFragmentRootName); if (folder.exists()) { - try { - folder.delete(false, null); - } catch (CoreException e) { - handle(e); - } + deleteResource(folder); } } IPath rootPath = getPackageFragmentRootPath(projectPath, packageFragmentRootName); @@ -891,11 +891,7 @@ public void cleanBuild() { e.printStackTrace(); } IProject project = getProject(projectPath); - try { - project.delete(true, null); - } catch (CoreException e) { - handle(e); - } + deleteResource(project); } @@ -936,11 +932,7 @@ public void cleanBuild() { removePackageFragmentRoot(projectPath, zipName); IFile file = getProject(projectPath).getFile(zipName); - try { - file.delete(false, null); - } catch (CoreException e) { - handle(e); - } + deleteResource(file); } /** @@ -968,11 +960,7 @@ public void cleanBuild() { */ public void removeFile(IPath filePath) { checkAssertion("a workspace must be open", this.isOpen); //$NON-NLS-1$ - try { - this.workspace.getRoot().getFile(filePath).delete(true, null); - } catch (CoreException e) { - handle(e); - } + deleteResource(this.workspace.getRoot().getFile(filePath)); } /** Remove a folder @@ -980,11 +968,7 @@ public void cleanBuild() { public void removeFolder(IPath folderPath) { checkAssertion("a workspace must be open", this.isOpen); //$NON-NLS-1$ IFolder folder = this.workspace.getRoot().getFolder(folderPath); - try { - folder.delete(true, null); - } catch (CoreException e) { - handle(e); - } + deleteResource(folder); } /** Sets the classpath to the given package fragment diff --git a/org.eclipse.jdt.core.tests.compiler/META-INF/MANIFEST.MF b/org.eclipse.jdt.core.tests.compiler/META-INF/MANIFEST.MF index 7b13537ebc..7cfa539414 100644 --- a/org.eclipse.jdt.core.tests.compiler/META-INF/MANIFEST.MF +++ b/org.eclipse.jdt.core.tests.compiler/META-INF/MANIFEST.MF @@ -13,7 +13,7 @@ Export-Package: org.eclipse.jdt.core.tests.compiler.parser, org.eclipse.jdt.core.tests.junit.extension, org.eclipse.jdt.core.tests.runtime, org.eclipse.jdt.core.tests.util -Require-Bundle: org.junit, +Require-Bundle: org.junit;bundle-version="3.8.1", org.eclipse.jdt.debug;bundle-version="[3.2.0,4.0.0)", org.eclipse.jdt.core;bundle-version="[3.3.0,4.0.0)", org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)", diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionTest.java index f417da1d53..816aac968a 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionTest.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionTest.java @@ -787,14 +787,14 @@ public void test19() { String selectionStartBehind = "return ("; String selectionEndBehind = "return (Object"; - String expectedCompletionNodeToString = "<SelectOnName:Object>"; + String expectedCompletionNodeToString = "<SelectOnType:Object>"; String completionIdentifier = "Object"; String expectedUnitDisplayString = "public class X {\n" + " public X() {\n" + " }\n" + " Object foo() {\n" + - " <SelectOnName:Object>;\n" + + " return (<SelectOnType:Object>) this;\n" + " }\n" + "}\n"; diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AmbiguousMethodTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AmbiguousMethodTest.java index dce1459341..a83206608a 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AmbiguousMethodTest.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AmbiguousMethodTest.java @@ -10,6 +10,10 @@ *******************************************************************************/ package org.eclipse.jdt.core.tests.compiler.regression; +import java.util.Map; + +import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; + import junit.framework.*; public class AmbiguousMethodTest extends AbstractComparableTest { @@ -26,6 +30,11 @@ public class AmbiguousMethodTest extends AbstractComparableTest { return AmbiguousMethodTest.class; } + protected Map getCompilerOptions() { + Map compilerOptions = super.getCompilerOptions(); + compilerOptions.put(CompilerOptions.OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation, CompilerOptions.DISABLED); + return compilerOptions; + } public void test000() { this.runConformTest( new String[] { @@ -3427,4 +3436,96 @@ public void test077() { "" ); } + +//https://bugs.eclipse.org/bugs/show_bug.cgi?id=287592 +public void test078() { + this.runNegativeTest( + new String[] { + "X.java", + "class X {\n" + + " class Field<T> { T value; }\n" + + " <T> void a(T value) {}\n" + + " <T> void a(Field<T> field) {}\n" + + " <T extends Number> void b(T value) {}\n" + + " <T> void b(Field<T> field) {}\n" + + " void c(String value) {}\n" + + " void c(Field<String> field) {}\n" + + " void test(X x) {\n" + + " x.a(null);\n" + + " x.<String>a(null);\n" + + " x.b(null);\n" + + " x.<Integer>b(null);\n" + + " x.c(null);\n" + + " }\n" + + "}" + }, + "----------\n" + + "1. ERROR in X.java (at line 12)\n" + + " x.b(null);\n" + + " ^\n" + + "The method b(Number) is ambiguous for the type X\n" + + "----------\n" + + "2. ERROR in X.java (at line 13)\n" + + " x.<Integer>b(null);\n" + + " ^\n" + + "The method b(Integer) is ambiguous for the type X\n" + + "----------\n" + + "3. ERROR in X.java (at line 14)\n" + + " x.c(null);\n" + + " ^\n" + + "The method c(String) is ambiguous for the type X\n" + + "----------\n" + ); +} + +//https://bugs.eclipse.org/bugs/show_bug.cgi?id=292350 +public void test079() { + this.runConformTest( + new String[] { + "X.java", + "interface I<T> {}\n" + + "class A {}\n" + + "class B extends A {}\n" + + "interface One {\n" + + " I<B> x() throws IllegalAccessError;\n" + + " <T extends A> I<T> y() throws IllegalAccessError;\n" + + "}\n" + + "interface Two extends One {\n" + + " <T extends A> I<T> x() throws IllegalAccessError;\n" + + " I<B> y() throws IllegalAccessError;\n" + + "}\n" + + "class X {\n" + + " void x(Two t) { t.x(); }\n" + + " void y(Two t) { t.y(); }\n" + + "}" + }, + "" + ); +} +// https://bugs.eclipse.org/bugs/show_bug.cgi?id=293384 +public void test080() { + this.runConformTest( + new String[] { + "X.java", + "public class X<Tout extends Object> {\n" + + " static public abstract class BaseA {};\n" + + " static public abstract class BaseB extends BaseA {};\n" + + " static public class Real extends BaseB {};\n" + + " static BaseA ask(String prompt) {\n" + + " Real impl = new Real();\n" + + " return (BaseA) ask(prompt, impl);\n" + + " }\n" + + " static BaseA ask(String prompt, Real impl) {\n" + + " return null;\n" + + " }\n" + + " static <T extends BaseA> T ask(String prompt, T impl) {\n" + + " return null;\n" + + " }\n" + + " static public void main(String[] args) {\n" + + " System.out.println(\"SUCCESS\");\n" + + " }\n" + + "}\n" + }, + "SUCCESS"); +} } diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java index aba4e70b10..14f2036db0 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java @@ -44,7 +44,7 @@ public class AnnotationTest extends AbstractComparableTest { // All specified tests which do not belong to the class are skipped... static { // TESTS_NAMES = new String[] { "test127" }; -// TESTS_NUMBERS = new int[] { 269 }; +// TESTS_NUMBERS = new int[] { 278 }; // TESTS_RANGE = new int[] { 249, -1 }; } @@ -3304,102 +3304,116 @@ public class AnnotationTest extends AbstractComparableTest { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=84791 - variation public void test111() { - this.runNegativeTest( - new String[] { - "X.java", - "import java.lang.annotation.Annotation;\n" + - "import java.util.Arrays;\n" + - "\n" + - "@interface Ann {\n" + - " int foo();\n" + - "}\n" + - "\n" + - "interface Iface extends Ann {\n" + - "}\n" + - "\n" + - "abstract class Klass implements Ann {\n" + - "}\n" + - "\n" + - "class SubKlass extends Klass {\n" + - " public Class<? extends Annotation> annotationType() {\n" + - " return null;\n" + - " }\n" + - "}\n" + - "\n" + - "class AnnImpl implements Ann {\n" + - " public boolean equals(Object obj) { return false; }\n" + - " public int hashCode() { return 0; }\n" + - " public String toString() { return null; }\n" + - " public Class<? extends Annotation> annotationType() { return null; }\n" + - " public int foo() { return 0; }\n" + - "}\n" + - "\n" + - "public class X {\n" + - " public static void main(String[] args) {\n" + - " Class c = SubKlass.class;\n" + - " System.out.println(\"Classes:\");\n" + - " while (c != Object.class) {\n" + - " System.out.println(\"-> \" + c.getName());\n" + - " c = c.getSuperclass();\n" + - " }\n" + - "\n" + - " System.out.println();\n" + - " System.out.println(\"Interfaces:\");\n" + - " c = SubKlass.class;\n" + - " while (c != Object.class) {\n" + - " Class[] i = c.getInterfaces();\n" + - " System.out.println(\"-> \" + Arrays.asList(i));\n" + - " c = c.getSuperclass();\n" + - " }\n" + - " }\n" + - "}\n", - }, - "----------\n" + - "1. WARNING in X.java (at line 8)\n" + - " interface Iface extends Ann {\n" + - " ^^^\n" + - "The annotation type Ann should not be used as a superinterface for Iface\n" + - "----------\n" + - "2. WARNING in X.java (at line 11)\n" + - " abstract class Klass implements Ann {\n" + - " ^^^\n" + - "The annotation type Ann should not be used as a superinterface for Klass\n" + - "----------\n" + - "3. ERROR in X.java (at line 14)\n" + - " class SubKlass extends Klass {\n" + - " ^^^^^^^^\n" + - "The type SubKlass must implement the inherited abstract method Ann.foo()\n" + - "----------\n" + - "4. WARNING in X.java (at line 20)\n" + - " class AnnImpl implements Ann {\n" + - " ^^^\n" + - "The annotation type Ann should not be used as a superinterface for AnnImpl\n" + - "----------\n" + - "5. WARNING in X.java (at line 21)\n" + - " public boolean equals(Object obj) { return false; }\n" + - " ^^^^^^^^^^^^^^^^^^\n" + - "The method equals(Object) of type AnnImpl should be tagged with @Override since it actually overrides a superclass method\n" + - "----------\n" + - "6. WARNING in X.java (at line 22)\n" + - " public int hashCode() { return 0; }\n" + - " ^^^^^^^^^^\n" + - "The method hashCode() of type AnnImpl should be tagged with @Override since it actually overrides a superclass method\n" + - "----------\n" + - "7. WARNING in X.java (at line 23)\n" + - " public String toString() { return null; }\n" + - " ^^^^^^^^^^\n" + - "The method toString() of type AnnImpl should be tagged with @Override since it actually overrides a superclass method\n" + - "----------\n" + - "8. WARNING in X.java (at line 30)\n" + - " Class c = SubKlass.class;\n" + - " ^^^^^\n" + - "Class is a raw type. References to generic type Class<T> should be parameterized\n" + - "----------\n" + - "9. WARNING in X.java (at line 41)\n" + - " Class[] i = c.getInterfaces();\n" + - " ^^^^^\n" + - "Class is a raw type. References to generic type Class<T> should be parameterized\n" + - "----------\n"); + Map customOptions = getCompilerOptions(); + customOptions.put( + CompilerOptions.OPTION_ReportMissingOverrideAnnotation, + CompilerOptions.ERROR); + customOptions.put( + CompilerOptions.OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation, + CompilerOptions.DISABLED); + + String expectedOutput = + "----------\n" + + "1. WARNING in X.java (at line 8)\n" + + " interface Iface extends Ann {\n" + + " ^^^\n" + + "The annotation type Ann should not be used as a superinterface for Iface\n" + + "----------\n" + + "2. WARNING in X.java (at line 11)\n" + + " abstract class Klass implements Ann {\n" + + " ^^^\n" + + "The annotation type Ann should not be used as a superinterface for Klass\n" + + "----------\n" + + "3. ERROR in X.java (at line 14)\n" + + " class SubKlass extends Klass {\n" + + " ^^^^^^^^\n" + + "The type SubKlass must implement the inherited abstract method Ann.foo()\n" + + "----------\n" + + "4. WARNING in X.java (at line 20)\n" + + " class AnnImpl implements Ann {\n" + + " ^^^\n" + + "The annotation type Ann should not be used as a superinterface for AnnImpl\n" + + "----------\n" + + "5. ERROR in X.java (at line 21)\n" + + " public boolean equals(Object obj) { return false; }\n" + + " ^^^^^^^^^^^^^^^^^^\n" + + "The method equals(Object) of type AnnImpl should be tagged with @Override since it actually overrides a superclass method\n" + + "----------\n" + + "6. ERROR in X.java (at line 22)\n" + + " public int hashCode() { return 0; }\n" + + " ^^^^^^^^^^\n" + + "The method hashCode() of type AnnImpl should be tagged with @Override since it actually overrides a superclass method\n" + + "----------\n" + + "7. ERROR in X.java (at line 23)\n" + + " public String toString() { return null; }\n" + + " ^^^^^^^^^^\n" + + "The method toString() of type AnnImpl should be tagged with @Override since it actually overrides a superclass method\n" + + "----------\n" + + "8. WARNING in X.java (at line 30)\n" + + " Class c = SubKlass.class;\n" + + " ^^^^^\n" + + "Class is a raw type. References to generic type Class<T> should be parameterized\n" + + "----------\n" + + "9. WARNING in X.java (at line 41)\n" + + " Class[] i = c.getInterfaces();\n" + + " ^^^^^\n" + + "Class is a raw type. References to generic type Class<T> should be parameterized\n" + + "----------\n"; + + this.runNegativeTest( + true, + new String[] { + "X.java", + "import java.lang.annotation.Annotation;\n" + + "import java.util.Arrays;\n" + + "\n" + + "@interface Ann {\n" + + " int foo();\n" + + "}\n" + + "\n" + + "interface Iface extends Ann {\n" + + "}\n" + + "\n" + + "abstract class Klass implements Ann {\n" + + "}\n" + + "\n" + + "class SubKlass extends Klass {\n" + + " public Class<? extends Annotation> annotationType() {\n" + + " return null;\n" + + " }\n" + + "}\n" + + "\n" + + "class AnnImpl implements Ann {\n" + + " public boolean equals(Object obj) { return false; }\n" + + " public int hashCode() { return 0; }\n" + + " public String toString() { return null; }\n" + + " public Class<? extends Annotation> annotationType() { return null; }\n" + + " public int foo() { return 0; }\n" + + "}\n" + + "\n" + + "public class X {\n" + + " public static void main(String[] args) {\n" + + " Class c = SubKlass.class;\n" + + " System.out.println(\"Classes:\");\n" + + " while (c != Object.class) {\n" + + " System.out.println(\"-> \" + c.getName());\n" + + " c = c.getSuperclass();\n" + + " }\n" + + "\n" + + " System.out.println();\n" + + " System.out.println(\"Interfaces:\");\n" + + " c = SubKlass.class;\n" + + " while (c != Object.class) {\n" + + " Class[] i = c.getInterfaces();\n" + + " System.out.println(\"-> \" + Arrays.asList(i));\n" + + " c = c.getSuperclass();\n" + + " }\n" + + " }\n" + + "}\n", + }, + null, customOptions, + expectedOutput, + JavacTestOptions.SKIP); } // https://bugs.eclipse.org/bugs/show_bug.cgi?id=86291 @@ -3886,7 +3900,7 @@ public class AnnotationTest extends AbstractComparableTest { " void foo(List list) {\n" + " List<String> ls1 = list;\n" + " }\n" + - " @SuppressWarnings(\"unchecked\")\n" + + " @SuppressWarnings({\"unchecked\", \"rawtypes\"})\n" + " void bar(List list) {\n" + " List<String> ls2 = list;\n" + " }\n" + @@ -4064,6 +4078,7 @@ public class AnnotationTest extends AbstractComparableTest { "\n" + "@SuppressWarnings( { \"deprecation\",//$NON-NLS-1$\n" + " \"finally\",//$NON-NLS-1$\n" + + " \"rawtypes\",//$NON-NLS-1$\n" + " \"serial\",//$NON-NLS-1$\n" + " \"unchecked\"//$NON-NLS-1$\n" + "})\n" + @@ -4093,7 +4108,7 @@ public class AnnotationTest extends AbstractComparableTest { "}\n" }, "----------\n" + - "1. ERROR in X.java (at line 23)\n" + + "1. ERROR in X.java (at line 24)\n" + " Zork dummy;\n" + " ^^^^\n" + "Zork cannot be resolved to a type\n" + @@ -4111,6 +4126,7 @@ public class AnnotationTest extends AbstractComparableTest { "public class X {\n" + " @SuppressWarnings( { \"deprecation\",//$NON-NLS-1$\n" + " \"finally\",//$NON-NLS-1$\n" + + " \"rawtypes\",//$NON-NLS-1$\n" + " \"unchecked\"//$NON-NLS-1$\n" + " })\n" + " public static void main(String[] args) {\n" + @@ -4124,7 +4140,7 @@ public class AnnotationTest extends AbstractComparableTest { " }\n" + " }\n" + "\n" + - " @SuppressWarnings(\"unchecked\"//$NON-NLS-1$\n" + + " @SuppressWarnings({\"unchecked\", \"rawtypes\"}//$NON-NLS-1$//$NON-NLS-2$\n" + " )\n" + " List<X> l = new Vector();\n" + "\n" + @@ -4144,7 +4160,7 @@ public class AnnotationTest extends AbstractComparableTest { "}\n" }, "----------\n" + - "1. ERROR in X.java (at line 28)\n" + + "1. ERROR in X.java (at line 29)\n" + " Zork dummy;\n" + " ^^^^\n" + "Zork cannot be resolved to a type\n" + @@ -5054,7 +5070,7 @@ public void test143() { this.runNegativeTest( new String[] { "X.java", - "@SuppressWarnings(\"unchecked\")\n" + + "@SuppressWarnings({\"unchecked\", \"rawtypes\"})\n" + "public class X<T> {\n" + " \n" + " public static void main(String[] args) {\n" + @@ -7001,6 +7017,14 @@ public void test213() { } //https://bugs.eclipse.org/bugs/show_bug.cgi?id=141931 public void test214() { + Map customOptions = getCompilerOptions(); + customOptions.put( + CompilerOptions.OPTION_ReportMissingOverrideAnnotation, + CompilerOptions.ERROR); + customOptions.put( + CompilerOptions.OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation, + CompilerOptions.DISABLED); + String expectedOutput = new CompilerOptions(getCompilerOptions()).sourceLevel < ClassFileConstants.JDK1_6 ? "----------\n" + "1. ERROR in X.java (at line 3)\n" + @@ -7025,6 +7049,7 @@ public void test214() { "The method foo() of type I must override or implement a supertype method\n" + "----------\n"; this.runNegativeTest( + true, new String[] { "X.java", "interface I {\n" + @@ -7042,7 +7067,10 @@ public void test214() { " void foo();\n" + "}\n", }, - expectedOutput); + null, + customOptions, + expectedOutput, + JavacTestOptions.SKIP); } // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141931 // variant @@ -7110,7 +7138,32 @@ public void test216() { } // extending java.lang.annotation.Annotation public void test217() { + Map customOptions = getCompilerOptions(); + customOptions.put( + CompilerOptions.OPTION_ReportMissingOverrideAnnotation, + CompilerOptions.ERROR); + customOptions.put( + CompilerOptions.OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation, + CompilerOptions.DISABLED); + String expectedOutput = + "----------\n" + + "1. WARNING in X.java (at line 3)\n" + + " void bar(MyConstructor constructor, Class<Ann> ann) {\n" + + " ^^^^^^^^^^^^^\n" + + "MyConstructor is a raw type. References to generic type MyConstructor<V> should be parameterized\n" + + "----------\n" + + "2. WARNING in X.java (at line 4)\n" + + " constructor.getAnnotation(ann).message();\n" + + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + + "Type safety: The method getAnnotation(Class) belongs to the raw type MyConstructor. References to generic type MyConstructor<V> should be parameterized\n" + + "----------\n" + + "3. ERROR in X.java (at line 4)\n" + + " constructor.getAnnotation(ann).message();\n" + + " ^^^^^^^\n" + + "The method message() is undefined for the type Annotation\n" + + "----------\n"; this.runNegativeTest( + true, new String[] { "X.java", "import java.lang.annotation.Annotation;\n" + @@ -7132,22 +7185,10 @@ public void test217() { " public <T extends Annotation> T getAnnotation(Class<T> c) { return null; }\n" + "}\n", }, - "----------\n" + - "1. WARNING in X.java (at line 3)\n" + - " void bar(MyConstructor constructor, Class<Ann> ann) {\n" + - " ^^^^^^^^^^^^^\n" + - "MyConstructor is a raw type. References to generic type MyConstructor<V> should be parameterized\n" + - "----------\n" + - "2. WARNING in X.java (at line 4)\n" + - " constructor.getAnnotation(ann).message();\n" + - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + - "Type safety: The method getAnnotation(Class) belongs to the raw type MyConstructor. References to generic type MyConstructor<V> should be parameterized\n" + - "----------\n" + - "3. ERROR in X.java (at line 4)\n" + - " constructor.getAnnotation(ann).message();\n" + - " ^^^^^^^\n" + - "The method message() is undefined for the type Annotation\n" + - "----------\n"); + null, + customOptions, + expectedOutput, + JavacTestOptions.SKIP); } // extending java.lang.annotation.Annotation public void test218() { @@ -8869,4 +8910,373 @@ public void test270() { "Cycle detected: the annotation type Test<T>.Anno cannot contain attributes of the annotation type itself\n" + "----------\n"); } +//https://bugs.eclipse.org/bugs/show_bug.cgi?id=289576 +public void test271() throws Exception { + this.runConformTest( + new String[] { + "X.java", + "@interface A {}\n" + + "public class X {\n" + + " @SuppressWarnings(\"unused\")\n" + + " private void foo(@A Object o) {}\n" + + "}" + }, + ""); + + String expectedOutput = + " // Method descriptor #15 (Ljava/lang/Object;)V\n" + + " // Stack: 0, Locals: 2\n" + + " private void foo(@A java.lang.Object o);\n"; + + checkDisassembledClassFile(OUTPUT_DIR + File.separator +"X.class", "X", expectedOutput, ClassFileBytesDisassembler.DETAILED); +} +//https://bugs.eclipse.org/bugs/show_bug.cgi?id=289516 +public void test272() throws Exception { + if (this.complianceLevel != ClassFileConstants.JDK1_5) { + return; + } + Map options = getCompilerOptions(); + options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5); + options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_4); + options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5); + this.runConformTest( + new String[] { + "X.java", + "@interface A {}\n" + + "public class X {\n" + + " @SuppressWarnings(\"unused\")\n" + + " private void foo(@A Object o) {}\n" + + "}" + }, + "", + null, + true, + null, + options, + null, + true); + + String expectedOutput = + " // Method descriptor #15 (Ljava/lang/Object;)V\n" + + " // Stack: 0, Locals: 2\n" + + " private void foo(@A java.lang.Object o);\n"; + + checkDisassembledClassFile(OUTPUT_DIR + File.separator +"X.class", "X", expectedOutput, ClassFileBytesDisassembler.DETAILED); +} +//https://bugs.eclipse.org/bugs/show_bug.cgi?id=289576 +public void test273() throws Exception { + this.runConformTest( + new String[] { + "X.java", + "@interface A {}\n" + + "public class X {\n" + + " @SuppressWarnings(\"unused\")\n" + + " private X(@A Object o) {}\n" + + "}" + }, + ""); + + String expectedOutput = + " // Method descriptor #6 (Ljava/lang/Object;)V\n" + + " // Stack: 1, Locals: 2\n" + + " private X(@A java.lang.Object o);\n"; + + checkDisassembledClassFile(OUTPUT_DIR + File.separator +"X.class", "X", expectedOutput, ClassFileBytesDisassembler.DETAILED); +} +// https://bugs.eclipse.org/bugs/show_bug.cgi?id=163194 +// To check Missing override annotation error when a method implements +// and also overrides a method in a superclass +public void test274a() { + String testString [] = new String[] { + "T.java", + "public interface T {\n" + + " void m();\n" + + "}\n" + + "abstract class A implements T {\n" + + "}\n" + + "class B extends A {\n" + + " public void m() {}\n" + + "}\n" + }; + Map customOptions = getCompilerOptions(); + customOptions.put( + CompilerOptions.OPTION_ReportMissingOverrideAnnotation, + CompilerOptions.ERROR); + customOptions.put( + CompilerOptions.OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation, + CompilerOptions.ENABLED); + if (new CompilerOptions(customOptions).sourceLevel >= ClassFileConstants.JDK1_6) { + String expectedOutput = + "----------\n" + + "1. ERROR in T.java (at line 7)\n" + + " public void m() {}\n" + + " ^^^\n" + + "The method m() of type B should be tagged with @Override since it actually overrides a superinterface method\n" + + "----------\n"; + this.runNegativeTest( + true, + testString, + null, customOptions, + expectedOutput, + JavacTestOptions.Excuse.EclipseWarningConfiguredAsError); + } else { + this.runConformTest( + true, testString, + null, + customOptions, + null, + null, null, + JavacTestOptions.Excuse.EclipseWarningConfiguredAsError); + } +} + +// https://bugs.eclipse.org/bugs/show_bug.cgi?id=163194 +// To check Missing override annotation error when a method implements but +// doesn't overrides +public void test274b() { + String testString [] = new String[] { + "Over.java", + "interface I {\n" + + " void m();\n" + + "}\n" + + "public class Over implements I {\n" + + " public void m() {}\n" + + "}\n" + }; + Map customOptions = getCompilerOptions(); + customOptions.put( + CompilerOptions.OPTION_ReportMissingOverrideAnnotation, + CompilerOptions.ERROR); + customOptions.put( + CompilerOptions.OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation, + CompilerOptions.ENABLED); + if (new CompilerOptions(customOptions).sourceLevel >= ClassFileConstants.JDK1_6) { + String expectedOutput = + "----------\n" + + "1. ERROR in Over.java (at line 5)\n" + + " public void m() {}\n" + + " ^^^\n" + + "The method m() of type Over should be tagged with @Override since it actually overrides a superinterface method\n" + + "----------\n"; + this.runNegativeTest( + true, + testString, + null, customOptions, + expectedOutput, + JavacTestOptions.Excuse.EclipseWarningConfiguredAsError); + } else { + this.runConformTest( + true, testString, + null, + customOptions, + null, + null, null, + JavacTestOptions.Excuse.EclipseWarningConfiguredAsError); + } +} + +// https://bugs.eclipse.org/bugs/show_bug.cgi?id=163194 +// To check Missing override annotation error when a method simply overrides +public void test274c() { + String testString [] = new String[] { + "B.java", + "interface A {\n" + + " void m();\n" + + "}\n" + + "public interface B extends A {\n" + + " void m();\n" + + "}\n" + }; + Map customOptions = getCompilerOptions(); + customOptions.put( + CompilerOptions.OPTION_ReportMissingOverrideAnnotation, + CompilerOptions.ERROR); + customOptions.put( + CompilerOptions.OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation, + CompilerOptions.ENABLED); + if (new CompilerOptions(customOptions).sourceLevel >= ClassFileConstants.JDK1_6) { + String expectedOutput = + "----------\n" + + "1. ERROR in B.java (at line 5)\n" + + " void m();\n" + + " ^^^\n" + + "The method m() of type B should be tagged with @Override since it actually overrides a superinterface method\n" + + "----------\n"; + this.runNegativeTest( + true, + testString, + null, customOptions, + expectedOutput, + JavacTestOptions.Excuse.EclipseWarningConfiguredAsError); + } else { + this.runConformTest( + true, testString, + null, + customOptions, + null, + null, null, + JavacTestOptions.Excuse.EclipseWarningConfiguredAsError); + } +} + +// https://bugs.eclipse.org/bugs/show_bug.cgi?id=163194 +// To check missing override annotation if the method has a signature +// that is override-equivalent to that of any public method declared in Object. +public void test274d() { + String testString [] = new String[] { + "A.java", + "public interface A {\n" + + " String toString();\n" + + "}\n" + }; + Map customOptions = getCompilerOptions(); + customOptions.put( + CompilerOptions.OPTION_ReportMissingOverrideAnnotation, + CompilerOptions.ERROR); + customOptions.put( + CompilerOptions.OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation, + CompilerOptions.ENABLED); + if (new CompilerOptions(customOptions).sourceLevel >= ClassFileConstants.JDK1_6) { + String expectedOutput = + "----------\n" + + "1. ERROR in A.java (at line 2)\n" + + " String toString();\n" + + " ^^^^^^^^^^\n" + + "The method toString() of type A should be tagged with @Override since it actually overrides a superinterface method\n" + + "----------\n"; + this.runNegativeTest( + true, + testString, + null, customOptions, + expectedOutput, + JavacTestOptions.Excuse.EclipseWarningConfiguredAsError); + } else { + this.runConformTest( + true, testString, + null, + customOptions, + null, + null, null, + JavacTestOptions.Excuse.EclipseWarningConfiguredAsError); + } +} +//https://bugs.eclipse.org/bugs/show_bug.cgi?id=282770. +public void test275() { + Map customOptions = getCompilerOptions(); + customOptions.put(CompilerOptions.OPTION_ReportDeadCodeInTrivialIfStatement, CompilerOptions.ENABLED); + + runConformTest( + true, + new String[] { + "X.java", + "public class X {\n" + + " public static final boolean DEBUG = false;\n" + + "// @SuppressWarnings(\"unused\")\n" + + " public void foo() {\n" + + " if (DEBUG)\n" + + " System.out.println(\"true\");\n" + + " else\n" + + " System.out.println(\"false\");\n" + + " \n" + + " }\n" + + "}\n" + }, + null, + customOptions, + "----------\n" + + "1. WARNING in X.java (at line 6)\n" + + " System.out.println(\"true\");\n" + + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + + "Dead code\n" + + "----------\n", + "", + "", + JavacTestOptions.SKIP); +} +//https://bugs.eclipse.org/bugs/show_bug.cgi?id=282770. +public void test276() { + Map customOptions = getCompilerOptions(); + customOptions.put(CompilerOptions.OPTION_ReportDeadCodeInTrivialIfStatement, CompilerOptions.ENABLED); + + runConformTest( + true, + new String[] { + "X.java", + "public class X {\n" + + " public static final boolean DEBUG = false;\n" + + " @SuppressWarnings(\"unused\")\n" + + " public void foo() {\n" + + " if (DEBUG)\n" + + " System.out.println(\"true\");\n" + + " else\n" + + " System.out.println(\"false\");\n" + + " \n" + + " }\n" + + "}\n" + }, + null, + customOptions, + "", + "", + "", + JavacTestOptions.SKIP); +} +//https://bugs.eclipse.org/bugs/show_bug.cgi?id=282770. +public void test277() { + Map customOptions = getCompilerOptions(); + customOptions.put(CompilerOptions.OPTION_ReportDeadCodeInTrivialIfStatement, CompilerOptions.DISABLED); + + runConformTest( + true, + new String[] { + "X.java", + "public class X {\n" + + " public static final boolean DEBUG = false;\n" + + " @SuppressWarnings(\"unused\")\n" + + " public void foo() {\n" + + " if (0 < 1)\n" + + " System.out.println(\"true\");\n" + + " else\n" + + " System.out.println(\"false\");\n" + + " \n" + + " }\n" + + "}\n" + }, + null, + customOptions, + "", + "", + "", + JavacTestOptions.SKIP); +} +// https://bugs.eclipse.org/bugs/show_bug.cgi?id=293777 +// To verify that a misleading warning against @Override annotation is not +// issued in case the method signature has not been resolved properly. +public void test278() { + String testString [] = new String[] { + "A.java", + "import javax.swing.JComponent;\n" + + "public class A extends JComponent {\n" + + " @Override\n" + + " protected void paintComponent(Graphics g) {" + + " }\n" + + "}\n" + }; + String expectedOutput = + "----------\n" + + "1. WARNING in A.java (at line 2)\n" + + " public class A extends JComponent {\n" + + " ^\n" + + "The serializable class A does not declare a static final serialVersionUID field of type long\n" + + "----------\n" + + "2. ERROR in A.java (at line 4)\n" + + " protected void paintComponent(Graphics g) { }\n" + + " ^^^^^^^^\n" + + "Graphics cannot be resolved to a type\n" + + "----------\n"; + this.runNegativeTest( + testString, + expectedOutput, + JavacTestOptions.Excuse.EclipseWarningConfiguredAsError); +} } diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java index fe19124c09..3b0544cab5 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java @@ -312,554 +312,556 @@ public void test011_problem_categories() { } ProblemAttributes DEPRECATED = new ProblemAttributes(true); Map expectedProblemAttributes = new HashMap(); - expectedProblemAttributes.put("ObjectHasNoSuperclass", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("UndefinedType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("NotVisibleType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("AbstractMethodCannotBeOverridden", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("AbstractMethodInAbstractClass", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("AbstractMethodInEnum", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("AbstractMethodMustBeImplemented", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("AbstractMethodMustBeImplementedOverConcreteMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("AbstractMethodsInConcreteClass", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("AmbiguousConstructor", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("AmbiguousConstructorInDefaultConstructor", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("AmbiguousConstructorInImplicitConstructorCall", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("AmbiguousField", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("AmbiguousMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); expectedProblemAttributes.put("AmbiguousType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("UsingDeprecatedType", new ProblemAttributes(CategorizedProblem.CAT_DEPRECATION)); - expectedProblemAttributes.put("InternalTypeNameProvided", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("UnusedPrivateType", new ProblemAttributes(CategorizedProblem.CAT_UNNECESSARY_CODE)); - expectedProblemAttributes.put("IncompatibleTypesInEqualityOperator", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("IncompatibleTypesInConditionalOperator", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("TypeMismatch", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("IndirectAccessToStaticType", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); - expectedProblemAttributes.put("MissingEnclosingInstanceForConstructorCall", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("MissingEnclosingInstance", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("IncorrectEnclosingInstanceReference", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("IllegalEnclosingInstanceSpecification", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("CannotDefineStaticInitializerInLocalType", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("OuterLocalMustBeFinal", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("CannotDefineInterfaceInLocalType", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("IllegalPrimitiveOrArrayTypeForEnclosingInstance", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("EnclosingInstanceInConstructorCall", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("AnnotationCannotOverrideMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("AnnotationCircularity", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("AnnotationCircularitySelfReference", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("AnnotationFieldNeedConstantInitialization", DEPRECATED); + expectedProblemAttributes.put("AnnotationMembersCannotHaveParameters", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("AnnotationMembersCannotHaveTypeParameters", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("AnnotationTypeDeclarationCannotHaveConstructor", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("AnnotationTypeDeclarationCannotHaveSuperclass", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("AnnotationTypeDeclarationCannotHaveSuperinterfaces", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("AnnotationTypeUsedAsSuperInterface", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); + expectedProblemAttributes.put("AnnotationValueMustBeAnEnumConstant", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("AnnotationValueMustBeAnnotation", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("AnnotationValueMustBeArrayInitializer", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("AnnotationValueMustBeClassLiteral", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("AnnotationValueMustBeConstant", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); expectedProblemAttributes.put("AnonymousClassCannotExtendFinalClass", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("CannotDefineAnnotationInLocalType", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("CannotDefineEnumInLocalType", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("NonStaticContextForEnumMemberType", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("TypeHidingType", new ProblemAttributes(CategorizedProblem.CAT_NAME_SHADOWING_CONFLICT)); - expectedProblemAttributes.put("UndefinedName", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("UninitializedLocalVariable", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("VariableTypeCannotBeVoid", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("VariableTypeCannotBeVoidArray", DEPRECATED); - expectedProblemAttributes.put("CannotAllocateVoidArray", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("RedefinedLocal", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("RedefinedArgument", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("DuplicateFinalLocalInitialization", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("NonBlankFinalLocalAssignment", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("ParameterAssignment", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); - expectedProblemAttributes.put("FinalOuterLocalAssignment", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("LocalVariableIsNeverUsed", new ProblemAttributes(CategorizedProblem.CAT_UNNECESSARY_CODE)); + expectedProblemAttributes.put("ArgumentHidingField", new ProblemAttributes(CategorizedProblem.CAT_NAME_SHADOWING_CONFLICT)); + expectedProblemAttributes.put("ArgumentHidingLocalVariable", new ProblemAttributes(CategorizedProblem.CAT_NAME_SHADOWING_CONFLICT)); expectedProblemAttributes.put("ArgumentIsNeverUsed", new ProblemAttributes(CategorizedProblem.CAT_UNNECESSARY_CODE)); + expectedProblemAttributes.put("ArgumentTypeAmbiguous", DEPRECATED); + expectedProblemAttributes.put("ArgumentTypeCannotBeVoid", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("ArgumentTypeCannotBeVoidArray", DEPRECATED); + expectedProblemAttributes.put("ArgumentTypeInheritedNameHidesEnclosingName", DEPRECATED); + expectedProblemAttributes.put("ArgumentTypeInternalNameProvided", DEPRECATED); + expectedProblemAttributes.put("ArgumentTypeNotFound", DEPRECATED); + expectedProblemAttributes.put("ArgumentTypeNotVisible", DEPRECATED); + expectedProblemAttributes.put("ArrayConstantsOnlyInArrayInitializers", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("ArrayReferenceRequired", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("AssignmentHasNoEffect", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); + expectedProblemAttributes.put("BodyForAbstractMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("BodyForNativeMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("BoundCannotBeArray", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("BoundHasConflictingArguments", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("BoundMustBeAnInterface", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("BoxingConversion", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); expectedProblemAttributes.put("BytecodeExceeds64KLimit", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); expectedProblemAttributes.put("BytecodeExceeds64KLimitForClinit", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("TooManyArgumentSlots", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("TooManyLocalVariableSlots", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("TooManySyntheticArgumentSlots", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("TooManyArrayDimensions", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); expectedProblemAttributes.put("BytecodeExceeds64KLimitForConstructor", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("UndefinedField", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("NotVisibleField", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("AmbiguousField", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("UsingDeprecatedField", new ProblemAttributes(CategorizedProblem.CAT_DEPRECATION)); - expectedProblemAttributes.put("NonStaticFieldFromStaticInvocation", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("ReferenceToForwardField", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("NonStaticAccessToStaticField", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); - expectedProblemAttributes.put("UnusedPrivateField", new ProblemAttributes(CategorizedProblem.CAT_UNNECESSARY_CODE)); - expectedProblemAttributes.put("IndirectAccessToStaticField", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); - expectedProblemAttributes.put("UnqualifiedFieldAccess", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); - expectedProblemAttributes.put("FinalFieldAssignment", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("UninitializedBlankFinalField", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("DuplicateBlankFinalFieldInitialization", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("UnresolvedVariable", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("LocalVariableHidingLocalVariable", new ProblemAttributes(CategorizedProblem.CAT_NAME_SHADOWING_CONFLICT)); - expectedProblemAttributes.put("LocalVariableHidingField", new ProblemAttributes(CategorizedProblem.CAT_NAME_SHADOWING_CONFLICT)); - expectedProblemAttributes.put("FieldHidingLocalVariable", new ProblemAttributes(CategorizedProblem.CAT_NAME_SHADOWING_CONFLICT)); - expectedProblemAttributes.put("FieldHidingField", new ProblemAttributes(CategorizedProblem.CAT_NAME_SHADOWING_CONFLICT)); - expectedProblemAttributes.put("ArgumentHidingLocalVariable", new ProblemAttributes(CategorizedProblem.CAT_NAME_SHADOWING_CONFLICT)); - expectedProblemAttributes.put("ArgumentHidingField", new ProblemAttributes(CategorizedProblem.CAT_NAME_SHADOWING_CONFLICT)); - expectedProblemAttributes.put("MissingSerialVersion", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); - expectedProblemAttributes.put("UndefinedMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("NotVisibleMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("AmbiguousMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("UsingDeprecatedMethod", new ProblemAttributes(CategorizedProblem.CAT_DEPRECATION)); - expectedProblemAttributes.put("DirectInvocationOfAbstractMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("VoidMethodReturnsValue", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("MethodReturnsVoid", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("MethodRequiresBody", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("ShouldReturnValue", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("MethodButWithConstructorName", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); - expectedProblemAttributes.put("MissingReturnType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("BodyForNativeMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("BodyForAbstractMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("NoMessageSendOnBaseType", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("ParameterMismatch", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("NoMessageSendOnArrayType", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("NonStaticAccessToStaticMethod", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); - expectedProblemAttributes.put("UnusedPrivateMethod", new ProblemAttributes(CategorizedProblem.CAT_UNNECESSARY_CODE)); - expectedProblemAttributes.put("IndirectAccessToStaticMethod", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); - expectedProblemAttributes.put("MissingTypeInMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("MissingTypeInConstructor", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("UndefinedConstructor", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("NotVisibleConstructor", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("AmbiguousConstructor", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("UsingDeprecatedConstructor", new ProblemAttributes(CategorizedProblem.CAT_DEPRECATION)); - expectedProblemAttributes.put("UnusedPrivateConstructor", new ProblemAttributes(CategorizedProblem.CAT_UNNECESSARY_CODE)); - expectedProblemAttributes.put("InstanceFieldDuringConstructorInvocation", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("InstanceMethodDuringConstructorInvocation", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("RecursiveConstructorInvocation", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("ThisSuperDuringConstructorInvocation", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("InvalidExplicitConstructorCall", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("UndefinedConstructorInDefaultConstructor", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("NotVisibleConstructorInDefaultConstructor", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("AmbiguousConstructorInDefaultConstructor", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("UndefinedConstructorInImplicitConstructorCall", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("NotVisibleConstructorInImplicitConstructorCall", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("AmbiguousConstructorInImplicitConstructorCall", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("UnhandledExceptionInDefaultConstructor", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("UnhandledExceptionInImplicitConstructorCall", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("ArrayReferenceRequired", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("NoImplicitStringConversionForCharArrayExpression", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); - expectedProblemAttributes.put("StringConstantIsExceedingUtf8Limit", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("NonConstantExpression", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("NumericValueOutOfRange", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("IllegalCast", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("InvalidClassInstantiation", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("CannotAllocateVoidArray", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("CannotDeclareEnumSpecialMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("CannotDefineAnnotationInLocalType", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); expectedProblemAttributes.put("CannotDefineDimensionExpressionsWithInit", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("MustDefineEitherDimensionExpressionsOrInitializer", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("InvalidOperator", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("CodeCannotBeReached", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("CannotDefineEnumInLocalType", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("CannotDefineInterfaceInLocalType", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("CannotDefineStaticInitializerInLocalType", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("CannotExtendEnum", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("CannotHideAnInstanceMethodWithAStaticMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("CannotImportPackage", new ProblemAttributes(CategorizedProblem.CAT_IMPORT)); + expectedProblemAttributes.put("CannotInvokeSuperConstructorInEnum", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("CannotOverrideAStaticMethodWithAnInstanceMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("CannotReadSource", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); expectedProblemAttributes.put("CannotReturnInInitializer", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("InitializerMustCompleteNormally", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("InvalidVoidExpression", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("MaskedCatch", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); - expectedProblemAttributes.put("DuplicateDefaultCase", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("UnreachableCatch", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("UnhandledException", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("IncorrectSwitchType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("CannotThrowNull", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("CannotThrowType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("CannotUseSuperInCodeSnippet", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("ClassExtendFinalClass", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("CodeCannotBeReached", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("CodeSnippetMissingClass", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("CodeSnippetMissingMethod", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("ComparingIdentical", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); + expectedProblemAttributes.put("ConflictingImport", new ProblemAttributes(CategorizedProblem.CAT_IMPORT)); + expectedProblemAttributes.put("ConstructorVarargsArgumentNeedCast", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); + expectedProblemAttributes.put("CorruptedSignature", new ProblemAttributes(CategorizedProblem.CAT_BUILDPATH)); + expectedProblemAttributes.put("DeadCode", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); + expectedProblemAttributes.put("DirectInvocationOfAbstractMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("DisallowedTargetForAnnotation", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("DiscouragedReference", new ProblemAttributes(CategorizedProblem.CAT_RESTRICTION)); + expectedProblemAttributes.put("DuplicateAnnotation", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("DuplicateAnnotationMember", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("DuplicateBlankFinalFieldInitialization", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("DuplicateBounds", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); expectedProblemAttributes.put("DuplicateCase", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("DuplicateDefaultCase", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("DuplicateField", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("DuplicateFinalLocalInitialization", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("DuplicateImport", new ProblemAttributes(CategorizedProblem.CAT_IMPORT)); expectedProblemAttributes.put("DuplicateLabel", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("InvalidBreak", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("InvalidContinue", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("UndefinedLabel", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("InvalidTypeToSynchronized", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("InvalidNullToSynchronized", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("CannotThrowNull", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("AssignmentHasNoEffect", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); - expectedProblemAttributes.put("PossibleAccidentalBooleanAssignment", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); - expectedProblemAttributes.put("SuperfluousSemicolon", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); - expectedProblemAttributes.put("UnnecessaryCast", new ProblemAttributes(CategorizedProblem.CAT_UNNECESSARY_CODE)); - expectedProblemAttributes.put("UnnecessaryArgumentCast", DEPRECATED); - expectedProblemAttributes.put("UnnecessaryInstanceof", new ProblemAttributes(CategorizedProblem.CAT_UNNECESSARY_CODE)); - expectedProblemAttributes.put("FinallyMustCompleteNormally", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); - expectedProblemAttributes.put("UnusedMethodDeclaredThrownException", new ProblemAttributes(CategorizedProblem.CAT_UNNECESSARY_CODE)); - expectedProblemAttributes.put("UnusedConstructorDeclaredThrownException", new ProblemAttributes(CategorizedProblem.CAT_UNNECESSARY_CODE)); - expectedProblemAttributes.put("InvalidCatchBlockSequence", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("DuplicateMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("DuplicateMethodErasure", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("DuplicateModifierForArgument", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("DuplicateModifierForField", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("DuplicateModifierForMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("DuplicateModifierForType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("DuplicateModifierForVariable", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("DuplicateNestedType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("DuplicateParameterizedMethods", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("DuplicateSuperInterface", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("DuplicateTargetInTargetAnnotation", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("DuplicateTypes", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("DuplicateTypeVariable", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); expectedProblemAttributes.put("EmptyControlFlowStatement", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); - expectedProblemAttributes.put("UnnecessaryElse", new ProblemAttributes(CategorizedProblem.CAT_UNNECESSARY_CODE)); - expectedProblemAttributes.put("NeedToEmulateFieldReadAccess", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); - expectedProblemAttributes.put("NeedToEmulateFieldWriteAccess", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); - expectedProblemAttributes.put("NeedToEmulateMethodAccess", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); - expectedProblemAttributes.put("NeedToEmulateConstructorAccess", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); + expectedProblemAttributes.put("EnclosingInstanceInConstructorCall", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("EndOfSource", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("EnumAbstractMethodMustBeImplemented", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("EnumConstantCannotDefineAbstractMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("EnumConstantMustImplementAbstractMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("EnumConstantsCannotBeSurroundedByParenthesis", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("EnumStaticFieldInInInitializerContext", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("EnumSwitchCannotTargetField", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("ExceptionTypeAmbiguous", DEPRECATED); + expectedProblemAttributes.put("ExceptionTypeInheritedNameHidesEnclosingName", DEPRECATED); + expectedProblemAttributes.put("ExceptionTypeInternalNameProvided", DEPRECATED); + expectedProblemAttributes.put("ExceptionTypeNotFound", DEPRECATED); + expectedProblemAttributes.put("ExceptionTypeNotVisible", DEPRECATED); + expectedProblemAttributes.put("ExpressionShouldBeAVariable", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("ExternalProblemFixable", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("ExternalProblemNotFixable", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); expectedProblemAttributes.put("FallthroughCase", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); - expectedProblemAttributes.put("InheritedMethodHidesEnclosingName", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("InheritedFieldHidesEnclosingName", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("InheritedTypeHidesEnclosingName", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("IllegalUsageOfQualifiedTypeReference", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("UnusedLabel", new ProblemAttributes(CategorizedProblem.CAT_UNNECESSARY_CODE)); - expectedProblemAttributes.put("ThisInStaticContext", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("StaticMethodRequested", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("FieldHidingField", new ProblemAttributes(CategorizedProblem.CAT_NAME_SHADOWING_CONFLICT)); + expectedProblemAttributes.put("FieldHidingLocalVariable", new ProblemAttributes(CategorizedProblem.CAT_NAME_SHADOWING_CONFLICT)); + expectedProblemAttributes.put("FieldMissingDeprecatedAnnotation", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); + expectedProblemAttributes.put("FieldTypeAmbiguous", DEPRECATED); + expectedProblemAttributes.put("FieldTypeInheritedNameHidesEnclosingName", DEPRECATED); + expectedProblemAttributes.put("FieldTypeInternalNameProvided", DEPRECATED); + expectedProblemAttributes.put("FieldTypeNotFound", DEPRECATED); + expectedProblemAttributes.put("FieldTypeNotVisible", DEPRECATED); + expectedProblemAttributes.put("FinalBoundForTypeVariable", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); + expectedProblemAttributes.put("FinalFieldAssignment", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("FinallyMustCompleteNormally", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); + expectedProblemAttributes.put("FinalMethodCannotBeOverridden", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("FinalOuterLocalAssignment", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("ForbiddenReference", new ProblemAttributes(CategorizedProblem.CAT_RESTRICTION)); + expectedProblemAttributes.put("GenericConstructorTypeArgumentMismatch", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("GenericMethodTypeArgumentMismatch", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("GenericTypeCannotExtendThrowable", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("HidingEnclosingType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("HierarchyCircularity", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("HierarchyCircularitySelfReference", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("HierarchyHasProblems", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("IllegalAbstractModifierCombinationForMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("IllegalAccessFromTypeVariable", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("IllegalCast", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("IllegalClassLiteralForTypeVariable", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); expectedProblemAttributes.put("IllegalDimension", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("InvalidTypeExpression", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("ParsingError", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("ParsingErrorNoSuggestion", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("InvalidUnaryExpression", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("InterfaceCannotHaveConstructors", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("ArrayConstantsOnlyInArrayInitializers", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("ParsingErrorOnKeyword", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("ParsingErrorOnKeywordNoSuggestion", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("ComparingIdentical", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); - expectedProblemAttributes.put("UnmatchedBracket", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("NoFieldOnBaseType", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("InvalidExpressionAsStatement", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("ExpressionShouldBeAVariable", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("MissingSemiColon", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("InvalidParenthesizedExpression", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("ParsingErrorInsertTokenBefore", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("ParsingErrorInsertTokenAfter", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("ParsingErrorDeleteToken", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("ParsingErrorDeleteTokens", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("ParsingErrorMergeTokens", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("ParsingErrorInvalidToken", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("ParsingErrorMisplacedConstruct", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("ParsingErrorReplaceTokens", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("ParsingErrorNoSuggestionForTokens", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("ParsingErrorUnexpectedEOF", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("ParsingErrorInsertToComplete", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("ParsingErrorInsertToCompleteScope", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("ParsingErrorInsertToCompletePhrase", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("EndOfSource", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("InvalidHexa", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("InvalidOctal", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("InvalidCharacterConstant", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("InvalidEscape", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("InvalidInput", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("InvalidUnicodeEscape", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("InvalidFloat", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("NullSourceString", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("UnterminatedString", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("UnterminatedComment", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("NonExternalizedStringLiteral", new ProblemAttributes(CategorizedProblem.CAT_NLS)); - expectedProblemAttributes.put("InvalidDigit", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("InvalidLowSurrogate", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("InvalidHighSurrogate", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("UnnecessaryNLSTag", new ProblemAttributes(CategorizedProblem.CAT_NLS)); - expectedProblemAttributes.put("DiscouragedReference", new ProblemAttributes(CategorizedProblem.CAT_RESTRICTION)); - expectedProblemAttributes.put("InterfaceCannotHaveInitializers", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("DuplicateModifierForType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("IllegalEnclosingInstanceSpecification", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("IllegalExtendedDimensions", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("IllegalExtendedDimensionsForVarArgs", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("IllegalGenericArray", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("IllegalInstanceofParameterizedType", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("IllegalInstanceofTypeParameter", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("IllegalModifierCombinationFinalAbstractForClass", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("IllegalModifierCombinationFinalVolatileForField", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("IllegalModifierForAnnotationField", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("IllegalModifierForAnnotationMemberType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("IllegalModifierForAnnotationMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("IllegalModifierForAnnotationType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("IllegalModifierForArgument", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); expectedProblemAttributes.put("IllegalModifierForClass", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("IllegalModifierForConstructor", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("IllegalModifierForEnum", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("IllegalModifierForEnumConstant", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("IllegalModifierForEnumConstructor", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("IllegalModifierForField", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); expectedProblemAttributes.put("IllegalModifierForInterface", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("IllegalModifierForInterfaceField", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("IllegalModifierForInterfaceMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("IllegalModifierForLocalClass", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("IllegalModifierForLocalEnum", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); expectedProblemAttributes.put("IllegalModifierForMemberClass", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("IllegalModifierForMemberEnum", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); expectedProblemAttributes.put("IllegalModifierForMemberInterface", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("IllegalModifierForLocalClass", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("ForbiddenReference", new ProblemAttributes(CategorizedProblem.CAT_RESTRICTION)); - expectedProblemAttributes.put("IllegalModifierCombinationFinalAbstractForClass", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("IllegalVisibilityModifierForInterfaceMemberType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("IllegalVisibilityModifierCombinationForMemberType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("IllegalModifierForMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("IllegalModifierForVariable", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("IllegalPrimitiveOrArrayTypeForEnclosingInstance", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("IllegalQualifiedEnumConstantLabel", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("IllegalQualifiedParameterizedTypeAllocation", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); expectedProblemAttributes.put("IllegalStaticModifierForMemberType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("SuperclassMustBeAClass", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("ClassExtendFinalClass", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("DuplicateSuperInterface", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("SuperInterfaceMustBeAnInterface", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("HierarchyCircularitySelfReference", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("HierarchyCircularity", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("HidingEnclosingType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("DuplicateNestedType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("CannotThrowType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("PackageCollidesWithType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("TypeCollidesWithPackage", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("DuplicateTypes", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("IsClassPathCorrect", new ProblemAttributes(CategorizedProblem.CAT_BUILDPATH)); - expectedProblemAttributes.put("PublicClassMustMatchFileName", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("MustSpecifyPackage", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("HierarchyHasProblems", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("PackageIsNotExpectedPackage", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("ObjectCannotHaveSuperTypes", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("ObjectMustBeClass", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("RedundantSuperinterface", new ProblemAttributes(CategorizedProblem.CAT_UNNECESSARY_CODE)); - expectedProblemAttributes.put("ShouldImplementHashcode", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); - expectedProblemAttributes.put("AbstractMethodsInConcreteClass", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("AbstractMethodInEnum", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("DeadCode", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); - expectedProblemAttributes.put("SuperclassNotFound", DEPRECATED); - expectedProblemAttributes.put("SuperclassNotVisible", DEPRECATED); - expectedProblemAttributes.put("SuperclassAmbiguous", DEPRECATED); - expectedProblemAttributes.put("SuperclassInternalNameProvided", DEPRECATED); - expectedProblemAttributes.put("SuperclassInheritedNameHidesEnclosingName", DEPRECATED); - expectedProblemAttributes.put("InterfaceNotFound", DEPRECATED); - expectedProblemAttributes.put("InterfaceNotVisible", DEPRECATED); - expectedProblemAttributes.put("InterfaceAmbiguous", DEPRECATED); - expectedProblemAttributes.put("InterfaceInternalNameProvided", DEPRECATED); - expectedProblemAttributes.put("InterfaceInheritedNameHidesEnclosingName", DEPRECATED); - expectedProblemAttributes.put("DuplicateField", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("DuplicateModifierForField", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("IllegalModifierForField", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("IllegalModifierForInterfaceField", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("IllegalTypeVariableSuperReference", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("IllegalUsageOfQualifiedTypeReference", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("IllegalVararg", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); expectedProblemAttributes.put("IllegalVisibilityModifierCombinationForField", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("IllegalModifierCombinationFinalVolatileForField", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("UnexpectedStaticModifierForField", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("FieldTypeNotFound", DEPRECATED); - expectedProblemAttributes.put("FieldTypeNotVisible", DEPRECATED); - expectedProblemAttributes.put("FieldTypeAmbiguous", DEPRECATED); - expectedProblemAttributes.put("FieldTypeInternalNameProvided", DEPRECATED); - expectedProblemAttributes.put("FieldTypeInheritedNameHidesEnclosingName", DEPRECATED); - expectedProblemAttributes.put("DuplicateMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("IllegalModifierForArgument", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("DuplicateModifierForMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("IllegalModifierForMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("IllegalModifierForInterfaceMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("IllegalVisibilityModifierCombinationForMemberType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); expectedProblemAttributes.put("IllegalVisibilityModifierCombinationForMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("UnexpectedStaticModifierForMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("IllegalAbstractModifierCombinationForMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("AbstractMethodInAbstractClass", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("ArgumentTypeCannotBeVoid", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("ArgumentTypeCannotBeVoidArray", DEPRECATED); - expectedProblemAttributes.put("ReturnTypeCannotBeVoidArray", DEPRECATED); - expectedProblemAttributes.put("NativeMethodsCannotBeStrictfp", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("DuplicateModifierForArgument", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("IllegalModifierForConstructor", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("ArgumentTypeNotFound", DEPRECATED); - expectedProblemAttributes.put("ArgumentTypeNotVisible", DEPRECATED); - expectedProblemAttributes.put("ArgumentTypeAmbiguous", DEPRECATED); - expectedProblemAttributes.put("ArgumentTypeInternalNameProvided", DEPRECATED); - expectedProblemAttributes.put("ArgumentTypeInheritedNameHidesEnclosingName", DEPRECATED); - expectedProblemAttributes.put("ExceptionTypeNotFound", DEPRECATED); - expectedProblemAttributes.put("ExceptionTypeNotVisible", DEPRECATED); - expectedProblemAttributes.put("ExceptionTypeAmbiguous", DEPRECATED); - expectedProblemAttributes.put("ExceptionTypeInternalNameProvided", DEPRECATED); - expectedProblemAttributes.put("ExceptionTypeInheritedNameHidesEnclosingName", DEPRECATED); - expectedProblemAttributes.put("ReturnTypeNotFound", DEPRECATED); - expectedProblemAttributes.put("ReturnTypeNotVisible", DEPRECATED); - expectedProblemAttributes.put("ReturnTypeAmbiguous", DEPRECATED); - expectedProblemAttributes.put("ReturnTypeInternalNameProvided", DEPRECATED); - expectedProblemAttributes.put("ReturnTypeInheritedNameHidesEnclosingName", DEPRECATED); - expectedProblemAttributes.put("ConflictingImport", new ProblemAttributes(CategorizedProblem.CAT_IMPORT)); - expectedProblemAttributes.put("DuplicateImport", new ProblemAttributes(CategorizedProblem.CAT_IMPORT)); - expectedProblemAttributes.put("CannotImportPackage", new ProblemAttributes(CategorizedProblem.CAT_IMPORT)); - expectedProblemAttributes.put("UnusedImport", new ProblemAttributes(CategorizedProblem.CAT_UNNECESSARY_CODE)); - expectedProblemAttributes.put("ImportNotFound", new ProblemAttributes(CategorizedProblem.CAT_IMPORT)); - expectedProblemAttributes.put("ImportNotVisible", DEPRECATED); + expectedProblemAttributes.put("IllegalVisibilityModifierForInterfaceMemberType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); expectedProblemAttributes.put("ImportAmbiguous", DEPRECATED); - expectedProblemAttributes.put("ImportInternalNameProvided", DEPRECATED); expectedProblemAttributes.put("ImportInheritedNameHidesEnclosingName", DEPRECATED); - expectedProblemAttributes.put("InvalidTypeForStaticImport", new ProblemAttributes(CategorizedProblem.CAT_IMPORT)); - expectedProblemAttributes.put("DuplicateModifierForVariable", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("IllegalModifierForVariable", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("LocalVariableCannotBeNull", DEPRECATED); - expectedProblemAttributes.put("LocalVariableCanOnlyBeNull", DEPRECATED); - expectedProblemAttributes.put("LocalVariableMayBeNull", DEPRECATED); - expectedProblemAttributes.put("AbstractMethodMustBeImplemented", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("FinalMethodCannotBeOverridden", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("IncompatibleExceptionInThrowsClause", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("ImportInternalNameProvided", DEPRECATED); + expectedProblemAttributes.put("ImportNotFound", new ProblemAttributes(CategorizedProblem.CAT_IMPORT)); + expectedProblemAttributes.put("ImportNotVisible", DEPRECATED); expectedProblemAttributes.put("IncompatibleExceptionInInheritedMethodThrowsClause", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("IncompatibleExceptionInThrowsClause", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("IncompatibleExceptionInThrowsClauseForNonInheritedInterfaceMethod", new ProblemAttributes(CategorizedProblem.CAT_NAME_SHADOWING_CONFLICT)); expectedProblemAttributes.put("IncompatibleReturnType", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("InheritedMethodReducesVisibility", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("CannotOverrideAStaticMethodWithAnInstanceMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("CannotHideAnInstanceMethodWithAStaticMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("StaticInheritedMethodConflicts", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("MethodReducesVisibility", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("OverridingNonVisibleMethod", new ProblemAttributes(CategorizedProblem.CAT_NAME_SHADOWING_CONFLICT)); - expectedProblemAttributes.put("AbstractMethodCannotBeOverridden", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("OverridingDeprecatedMethod", new ProblemAttributes(CategorizedProblem.CAT_DEPRECATION)); expectedProblemAttributes.put("IncompatibleReturnTypeForNonInheritedInterfaceMethod", new ProblemAttributes(CategorizedProblem.CAT_NAME_SHADOWING_CONFLICT)); - expectedProblemAttributes.put("IncompatibleExceptionInThrowsClauseForNonInheritedInterfaceMethod", new ProblemAttributes(CategorizedProblem.CAT_NAME_SHADOWING_CONFLICT)); - expectedProblemAttributes.put("IllegalVararg", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("OverridingMethodWithoutSuperInvocation", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); - expectedProblemAttributes.put("MissingSynchronizedModifierInInheritedMethod", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); - expectedProblemAttributes.put("AbstractMethodMustBeImplementedOverConcreteMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("IncompatibleTypesInConditionalOperator", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("IncompatibleTypesInEqualityOperator", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("IncompatibleTypesInForeach", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("IncorrectArityForParameterizedConstructor", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("IncorrectArityForParameterizedMethod", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("IncorrectArityForParameterizedType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("IncorrectEnclosingInstanceReference", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("IncorrectSwitchType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("IndirectAccessToStaticField", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); + expectedProblemAttributes.put("IndirectAccessToStaticMethod", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); + expectedProblemAttributes.put("IndirectAccessToStaticType", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); + expectedProblemAttributes.put("InheritedFieldHidesEnclosingName", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); expectedProblemAttributes.put("InheritedIncompatibleReturnType", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("CodeSnippetMissingClass", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("CodeSnippetMissingMethod", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("CannotUseSuperInCodeSnippet", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("TooManyConstantsInConstantPool", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("TooManyBytesForStringConstant", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("TooManyFields", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("TooManyMethods", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("UseAssertAsAnIdentifier", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); - expectedProblemAttributes.put("UseEnumAsAnIdentifier", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); - expectedProblemAttributes.put("EnumConstantsCannotBeSurroundedByParenthesis", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("Task", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("NullLocalVariableReference", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); - expectedProblemAttributes.put("PotentialNullLocalVariableReference", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); - expectedProblemAttributes.put("RedundantNullCheckOnNullLocalVariable", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); - expectedProblemAttributes.put("NullLocalVariableComparisonYieldsFalse", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); - expectedProblemAttributes.put("RedundantLocalVariableNullAssignment", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); - expectedProblemAttributes.put("NullLocalVariableInstanceofYieldsFalse", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); - expectedProblemAttributes.put("RedundantNullCheckOnNonNullLocalVariable", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); - expectedProblemAttributes.put("NonNullLocalVariableComparisonYieldsFalse", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); - expectedProblemAttributes.put("UndocumentedEmptyBlock", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); - expectedProblemAttributes.put("JavadocInvalidSeeUrlReference", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocMissingTagDescription", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("InheritedMethodHidesEnclosingName", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("InheritedMethodReducesVisibility", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("InheritedTypeHidesEnclosingName", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("InitializerMustCompleteNormally", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("InstanceFieldDuringConstructorInvocation", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("InstanceMethodDuringConstructorInvocation", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("InterfaceAmbiguous", DEPRECATED); + expectedProblemAttributes.put("InterfaceCannotHaveConstructors", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("InterfaceCannotHaveInitializers", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("InterfaceInheritedNameHidesEnclosingName", DEPRECATED); + expectedProblemAttributes.put("InterfaceInternalNameProvided", DEPRECATED); + expectedProblemAttributes.put("InterfaceNotFound", DEPRECATED); + expectedProblemAttributes.put("InterfaceNotVisible", DEPRECATED); + expectedProblemAttributes.put("InternalTypeNameProvided", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("InvalidAnnotationMemberType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("InvalidBreak", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("InvalidCatchBlockSequence", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("InvalidCharacterConstant", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("InvalidClassInstantiation", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("InvalidContinue", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("InvalidDigit", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("InvalidEncoding", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("InvalidEscape", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("InvalidExplicitConstructorCall", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("InvalidExpressionAsStatement", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("InvalidFileNameForPackageAnnotations", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("InvalidFloat", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("InvalidHexa", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("InvalidHighSurrogate", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("InvalidInput", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("InvalidLowSurrogate", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("InvalidNullToSynchronized", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("InvalidOctal", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("InvalidOperator", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("InvalidParameterizedExceptionType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("InvalidParenthesizedExpression", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("InvalidTypeExpression", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("InvalidTypeForCollection", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("InvalidTypeForStaticImport", new ProblemAttributes(CategorizedProblem.CAT_IMPORT)); + expectedProblemAttributes.put("InvalidTypeToSynchronized", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("InvalidTypeVariableExceptionType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("InvalidUnaryExpression", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("InvalidUnicodeEscape", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("InvalidUsageOfAnnotationDeclarations", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("InvalidUsageOfAnnotations", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("InvalidUsageOfEnumDeclarations", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("InvalidUsageOfForeachStatements", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("InvalidUsageOfStaticImports", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("InvalidUsageOfTypeArguments", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("InvalidUsageOfTypeParameters", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("InvalidUsageOfTypeParametersForAnnotationDeclaration", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("InvalidUsageOfTypeParametersForEnumDeclaration", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("InvalidUsageOfVarargs", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("InvalidUsageOfWildcard", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("InvalidVoidExpression", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("IsClassPathCorrect", new ProblemAttributes(CategorizedProblem.CAT_BUILDPATH)); + expectedProblemAttributes.put("JavadocAmbiguousConstructor", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocAmbiguousField", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocAmbiguousMethod", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocAmbiguousMethodReference", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocAmbiguousType", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocDuplicateParamName", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocDuplicateReturnTag", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); expectedProblemAttributes.put("JavadocDuplicateTag", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocDuplicateThrowsClassName", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocEmptyReturnTag", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocGenericConstructorTypeArgumentMismatch", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocGenericMethodTypeArgumentMismatch", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); expectedProblemAttributes.put("JavadocHiddenReference", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocIncorrectArityForParameterizedConstructor", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocIncorrectArityForParameterizedMethod", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocInheritedFieldHidesEnclosingName", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocInheritedMethodHidesEnclosingName", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocInheritedNameHidesEnclosingTypeName", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocInternalTypeNameProvided", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); expectedProblemAttributes.put("JavadocInvalidMemberTypeQualification", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocMissingIdentifier", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocNonStaticTypeFromStaticInvocation", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocInvalidParamTagTypeParameter", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocUnexpectedTag", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocMissingParamTag", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocMissingParamName", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocDuplicateParamName", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); expectedProblemAttributes.put("JavadocInvalidParamName", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocMissingReturnTag", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocDuplicateReturnTag", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocMissingThrowsTag", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocMissingThrowsClassName", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocInvalidParamTagName", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocInvalidParamTagTypeParameter", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocInvalidSeeArgs", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocInvalidSeeHref", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocInvalidSeeReference", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocInvalidSeeUrlReference", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocInvalidTag", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); expectedProblemAttributes.put("JavadocInvalidThrowsClass", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocDuplicateThrowsClassName", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); expectedProblemAttributes.put("JavadocInvalidThrowsClassName", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocMissingSeeReference", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocInvalidSeeReference", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocInvalidSeeHref", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocInvalidSeeArgs", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocInvalidValueReference", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocMalformedSeeReference", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocMessagePrefix", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); expectedProblemAttributes.put("JavadocMissing", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocInvalidTag", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocUndefinedField", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocNotVisibleField", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocAmbiguousField", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocUsingDeprecatedField", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocUndefinedConstructor", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocMissingHashCharacter", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocMissingIdentifier", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocMissingParamName", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocMissingParamTag", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocMissingReturnTag", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocMissingSeeReference", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocMissingTagDescription", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocMissingThrowsClassName", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocMissingThrowsTag", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocNoMessageSendOnArrayType", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocNoMessageSendOnBaseType", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocNonGenericConstructor", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocNonGenericMethod", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocNonStaticTypeFromStaticInvocation", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); expectedProblemAttributes.put("JavadocNotVisibleConstructor", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocAmbiguousConstructor", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocUsingDeprecatedConstructor", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocUndefinedMethod", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocNotVisibleField", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); expectedProblemAttributes.put("JavadocNotVisibleMethod", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocAmbiguousMethod", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocUsingDeprecatedMethod", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocNoMessageSendOnBaseType", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocNotVisibleType", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocParameterizedConstructorArgumentTypeMismatch", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocParameterizedMethodArgumentTypeMismatch", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); expectedProblemAttributes.put("JavadocParameterMismatch", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocNoMessageSendOnArrayType", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocTypeArgumentsForRawGenericConstructor", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocTypeArgumentsForRawGenericMethod", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocUndefinedConstructor", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocUndefinedField", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocUndefinedMethod", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); expectedProblemAttributes.put("JavadocUndefinedType", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocNotVisibleType", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocAmbiguousType", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocUsingDeprecatedType", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocInternalTypeNameProvided", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocInheritedMethodHidesEnclosingName", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocInheritedFieldHidesEnclosingName", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocInheritedNameHidesEnclosingTypeName", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocAmbiguousMethodReference", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocUnterminatedInlineTag", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocMalformedSeeReference", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocMessagePrefix", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("JavadocMissingHashCharacter", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocEmptyReturnTag", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocInvalidValueReference", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocUnexpectedTag", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); expectedProblemAttributes.put("JavadocUnexpectedText", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocInvalidParamTagName", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("DuplicateTypeVariable", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("IllegalTypeVariableSuperReference", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("JavadocUnterminatedInlineTag", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocUsingDeprecatedConstructor", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocUsingDeprecatedField", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocUsingDeprecatedMethod", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("JavadocUsingDeprecatedType", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); + expectedProblemAttributes.put("LocalVariableCannotBeNull", DEPRECATED); + expectedProblemAttributes.put("LocalVariableCanOnlyBeNull", DEPRECATED); + expectedProblemAttributes.put("LocalVariableHidingField", new ProblemAttributes(CategorizedProblem.CAT_NAME_SHADOWING_CONFLICT)); + expectedProblemAttributes.put("LocalVariableHidingLocalVariable", new ProblemAttributes(CategorizedProblem.CAT_NAME_SHADOWING_CONFLICT)); + expectedProblemAttributes.put("LocalVariableIsNeverUsed", new ProblemAttributes(CategorizedProblem.CAT_UNNECESSARY_CODE)); + expectedProblemAttributes.put("LocalVariableMayBeNull", DEPRECATED); + expectedProblemAttributes.put("MaskedCatch", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); + expectedProblemAttributes.put("MethodButWithConstructorName", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); + expectedProblemAttributes.put("MethodMissingDeprecatedAnnotation", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); + expectedProblemAttributes.put("MethodMustOverride", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("MethodMustOverrideOrImplement", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("MethodNameClash", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("MethodReducesVisibility", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("MethodRequiresBody", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("MethodReturnsVoid", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("MethodVarargsArgumentNeedCast", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); + expectedProblemAttributes.put("MissingArgumentsForParameterizedMemberType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("MissingEnclosingInstance", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("MissingEnclosingInstanceForConstructorCall", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("MissingEnumConstantCase", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); + expectedProblemAttributes.put("MissingOverrideAnnotation", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); + expectedProblemAttributes.put("MissingOverrideAnnotationForInterfaceMethodImplementation", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); + expectedProblemAttributes.put("MissingReturnType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("MissingSemiColon", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("MissingSerialVersion", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); + expectedProblemAttributes.put("MissingSynchronizedModifierInInheritedMethod", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); + expectedProblemAttributes.put("MissingTypeInConstructor", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("MissingTypeInMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("MissingValueForAnnotationMember", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("MustDefineEitherDimensionExpressionsOrInitializer", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("MustSpecifyPackage", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("NativeMethodsCannotBeStrictfp", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("NeedToEmulateConstructorAccess", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); + expectedProblemAttributes.put("NeedToEmulateFieldReadAccess", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); + expectedProblemAttributes.put("NeedToEmulateFieldWriteAccess", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); + expectedProblemAttributes.put("NeedToEmulateMethodAccess", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); + expectedProblemAttributes.put("NoAdditionalBoundAfterTypeVariable", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("NoFieldOnBaseType", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("NoImplicitStringConversionForCharArrayExpression", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); + expectedProblemAttributes.put("NoMessageSendOnArrayType", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("NoMessageSendOnBaseType", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("NonBlankFinalLocalAssignment", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("NonConstantExpression", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("NonExternalizedStringLiteral", new ProblemAttributes(CategorizedProblem.CAT_NLS)); + expectedProblemAttributes.put("NonGenericConstructor", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("NonGenericMethod", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("NonGenericType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("NonNullLocalVariableComparisonYieldsFalse", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); + expectedProblemAttributes.put("NonStaticAccessToStaticField", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); + expectedProblemAttributes.put("NonStaticAccessToStaticMethod", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); + expectedProblemAttributes.put("NonStaticContextForEnumMemberType", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("NonStaticFieldFromStaticInvocation", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); expectedProblemAttributes.put("NonStaticTypeFromStaticInvocation", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("NotVisibleConstructor", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("NotVisibleConstructorInDefaultConstructor", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("NotVisibleConstructorInImplicitConstructorCall", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("NotVisibleField", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("NotVisibleMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("NotVisibleType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("NullLocalVariableComparisonYieldsFalse", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); + expectedProblemAttributes.put("NullLocalVariableInstanceofYieldsFalse", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); + expectedProblemAttributes.put("NullLocalVariableReference", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); + expectedProblemAttributes.put("NullSourceString", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("NumericValueOutOfRange", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); expectedProblemAttributes.put("ObjectCannotBeGeneric", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("NonGenericType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("IncorrectArityForParameterizedType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("TypeArgumentMismatch", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("DuplicateMethodErasure", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("ReferenceToForwardTypeVariable", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("BoundMustBeAnInterface", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("UnsafeRawConstructorInvocation", new ProblemAttributes(CategorizedProblem.CAT_UNCHECKED_RAW)); - expectedProblemAttributes.put("UnsafeRawMethodInvocation", new ProblemAttributes(CategorizedProblem.CAT_UNCHECKED_RAW)); - expectedProblemAttributes.put("UnsafeTypeConversion", new ProblemAttributes(CategorizedProblem.CAT_UNCHECKED_RAW)); - expectedProblemAttributes.put("InvalidTypeVariableExceptionType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("InvalidParameterizedExceptionType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("IllegalGenericArray", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("UnsafeRawFieldAssignment", new ProblemAttributes(CategorizedProblem.CAT_UNCHECKED_RAW)); - expectedProblemAttributes.put("FinalBoundForTypeVariable", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); - expectedProblemAttributes.put("UndefinedTypeVariable", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("SuperInterfacesCollide", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("WildcardConstructorInvocation", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("WildcardMethodInvocation", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("WildcardFieldAssignment", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("GenericMethodTypeArgumentMismatch", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("GenericConstructorTypeArgumentMismatch", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("UnsafeGenericCast", new ProblemAttributes(CategorizedProblem.CAT_UNCHECKED_RAW)); - expectedProblemAttributes.put("IllegalInstanceofParameterizedType", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("IllegalInstanceofTypeParameter", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("NonGenericMethod", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("IncorrectArityForParameterizedMethod", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("ParameterizedMethodArgumentTypeMismatch", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("NonGenericConstructor", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("IncorrectArityForParameterizedConstructor", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("ObjectCannotHaveSuperTypes", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("ObjectHasNoSuperclass", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("ObjectMustBeClass", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("OuterLocalMustBeFinal", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("OverridingDeprecatedMethod", new ProblemAttributes(CategorizedProblem.CAT_DEPRECATION)); + expectedProblemAttributes.put("OverridingMethodWithoutSuperInvocation", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); + expectedProblemAttributes.put("OverridingNonVisibleMethod", new ProblemAttributes(CategorizedProblem.CAT_NAME_SHADOWING_CONFLICT)); + expectedProblemAttributes.put("PackageCollidesWithType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("PackageIsNotExpectedPackage", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("ParameterAssignment", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); expectedProblemAttributes.put("ParameterizedConstructorArgumentTypeMismatch", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("TypeArgumentsForRawGenericMethod", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("TypeArgumentsForRawGenericConstructor", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("SuperTypeUsingWildcard", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("GenericTypeCannotExtendThrowable", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("IllegalClassLiteralForTypeVariable", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("UnsafeReturnTypeOverride", new ProblemAttributes(CategorizedProblem.CAT_UNCHECKED_RAW)); - expectedProblemAttributes.put("MethodNameClash", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("ParameterizedMethodArgumentTypeMismatch", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("ParameterMismatch", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("ParsingError", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("ParsingErrorDeleteToken", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("ParsingErrorDeleteTokens", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("ParsingErrorInsertToComplete", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("ParsingErrorInsertToCompletePhrase", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("ParsingErrorInsertToCompleteScope", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("ParsingErrorInsertTokenAfter", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("ParsingErrorInsertTokenBefore", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("ParsingErrorInvalidToken", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("ParsingErrorMergeTokens", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("ParsingErrorMisplacedConstruct", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("ParsingErrorNoSuggestion", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("ParsingErrorNoSuggestionForTokens", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("ParsingErrorOnKeyword", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("ParsingErrorOnKeywordNoSuggestion", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("ParsingErrorReplaceTokens", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("ParsingErrorUnexpectedEOF", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("PossibleAccidentalBooleanAssignment", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); + expectedProblemAttributes.put("PotentialNullLocalVariableReference", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); + expectedProblemAttributes.put("PublicClassMustMatchFileName", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); expectedProblemAttributes.put("RawMemberTypeCannotBeParameterized", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("MissingArgumentsForParameterizedMemberType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("StaticMemberOfParameterizedType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("BoundHasConflictingArguments", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("DuplicateParameterizedMethods", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("IllegalQualifiedParameterizedTypeAllocation", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("DuplicateBounds", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("BoundCannotBeArray", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("UnsafeRawGenericConstructorInvocation", new ProblemAttributes(CategorizedProblem.CAT_UNCHECKED_RAW)); - expectedProblemAttributes.put("UnsafeRawGenericMethodInvocation", new ProblemAttributes(CategorizedProblem.CAT_UNCHECKED_RAW)); - expectedProblemAttributes.put("TypeParameterHidingType", new ProblemAttributes(CategorizedProblem.CAT_NAME_SHADOWING_CONFLICT)); expectedProblemAttributes.put("RawTypeReference", new ProblemAttributes(CategorizedProblem.CAT_UNCHECKED_RAW)); - expectedProblemAttributes.put("NoAdditionalBoundAfterTypeVariable", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("UnsafeGenericArrayForVarargs", new ProblemAttributes(CategorizedProblem.CAT_UNCHECKED_RAW)); - expectedProblemAttributes.put("IllegalAccessFromTypeVariable", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("TypeHidingTypeParameterFromType", new ProblemAttributes(CategorizedProblem.CAT_NAME_SHADOWING_CONFLICT)); + expectedProblemAttributes.put("RecursiveConstructorInvocation", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("RedefinedArgument", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("RedefinedLocal", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("RedundantLocalVariableNullAssignment", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); + expectedProblemAttributes.put("RedundantNullCheckOnNonNullLocalVariable", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); + expectedProblemAttributes.put("RedundantNullCheckOnNullLocalVariable", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); + expectedProblemAttributes.put("RedundantSuperinterface", new ProblemAttributes(CategorizedProblem.CAT_UNNECESSARY_CODE)); + expectedProblemAttributes.put("ReferenceToForwardField", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("ReferenceToForwardTypeVariable", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("ReturnTypeAmbiguous", DEPRECATED); + expectedProblemAttributes.put("ReturnTypeCannotBeVoidArray", DEPRECATED); + expectedProblemAttributes.put("ReturnTypeInheritedNameHidesEnclosingName", DEPRECATED); + expectedProblemAttributes.put("ReturnTypeInternalNameProvided", DEPRECATED); + expectedProblemAttributes.put("ReturnTypeNotFound", DEPRECATED); + expectedProblemAttributes.put("ReturnTypeNotVisible", DEPRECATED); + expectedProblemAttributes.put("ShouldImplementHashcode", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); + expectedProblemAttributes.put("ShouldReturnValue", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("StaticInheritedMethodConflicts", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("StaticMemberOfParameterizedType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("StaticMethodRequested", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("StringConstantIsExceedingUtf8Limit", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("SuperclassAmbiguous", DEPRECATED); + expectedProblemAttributes.put("SuperclassInheritedNameHidesEnclosingName", DEPRECATED); + expectedProblemAttributes.put("SuperclassInternalNameProvided", DEPRECATED); + expectedProblemAttributes.put("SuperclassMustBeAClass", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("SuperclassNotFound", DEPRECATED); + expectedProblemAttributes.put("SuperclassNotVisible", DEPRECATED); + expectedProblemAttributes.put("SuperfluousSemicolon", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); + expectedProblemAttributes.put("SuperInterfaceMustBeAnInterface", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("SuperInterfacesCollide", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("SuperTypeUsingWildcard", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("Task", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("ThisInStaticContext", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("ThisSuperDuringConstructorInvocation", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("TooManyArgumentSlots", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("TooManyArrayDimensions", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("TooManyBytesForStringConstant", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("TooManyConstantsInConstantPool", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("TooManyFields", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("TooManyLocalVariableSlots", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("TooManyMethods", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("TooManySyntheticArgumentSlots", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("TypeArgumentMismatch", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("TypeArgumentsForRawGenericConstructor", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("TypeArgumentsForRawGenericMethod", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("TypeCollidesWithPackage", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("TypeHidingType", new ProblemAttributes(CategorizedProblem.CAT_NAME_SHADOWING_CONFLICT)); expectedProblemAttributes.put("TypeHidingTypeParameterFromMethod", new ProblemAttributes(CategorizedProblem.CAT_NAME_SHADOWING_CONFLICT)); - expectedProblemAttributes.put("InvalidUsageOfWildcard", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("UnusedTypeArgumentsForMethodInvocation", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("IncompatibleTypesInForeach", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("InvalidTypeForCollection", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("InvalidUsageOfTypeParameters", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("InvalidUsageOfStaticImports", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("InvalidUsageOfForeachStatements", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("InvalidUsageOfTypeArguments", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("InvalidUsageOfEnumDeclarations", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("InvalidUsageOfVarargs", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("InvalidUsageOfAnnotations", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("InvalidUsageOfAnnotationDeclarations", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("InvalidUsageOfTypeParametersForAnnotationDeclaration", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("InvalidUsageOfTypeParametersForEnumDeclaration", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("IllegalModifierForAnnotationMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("IllegalExtendedDimensions", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("InvalidFileNameForPackageAnnotations", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("IllegalModifierForAnnotationType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("IllegalModifierForAnnotationMemberType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("InvalidAnnotationMemberType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("AnnotationCircularitySelfReference", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("AnnotationCircularity", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("DuplicateAnnotation", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("MissingValueForAnnotationMember", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("DuplicateAnnotationMember", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("UndefinedAnnotationMember", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("AnnotationValueMustBeClassLiteral", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("AnnotationValueMustBeConstant", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("AnnotationFieldNeedConstantInitialization", DEPRECATED); - expectedProblemAttributes.put("IllegalModifierForAnnotationField", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("AnnotationCannotOverrideMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("AnnotationMembersCannotHaveParameters", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("AnnotationMembersCannotHaveTypeParameters", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("AnnotationTypeDeclarationCannotHaveSuperclass", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("AnnotationTypeDeclarationCannotHaveSuperinterfaces", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("DuplicateTargetInTargetAnnotation", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("DisallowedTargetForAnnotation", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("MethodMustOverride", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("AnnotationTypeDeclarationCannotHaveConstructor", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("AnnotationValueMustBeAnnotation", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("AnnotationTypeUsedAsSuperInterface", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); - expectedProblemAttributes.put("MissingOverrideAnnotation", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); - expectedProblemAttributes.put("FieldMissingDeprecatedAnnotation", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); - expectedProblemAttributes.put("MethodMissingDeprecatedAnnotation", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); + expectedProblemAttributes.put("TypeHidingTypeParameterFromType", new ProblemAttributes(CategorizedProblem.CAT_NAME_SHADOWING_CONFLICT)); + expectedProblemAttributes.put("TypeMismatch", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); expectedProblemAttributes.put("TypeMissingDeprecatedAnnotation", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); + expectedProblemAttributes.put("TypeParameterHidingType", new ProblemAttributes(CategorizedProblem.CAT_NAME_SHADOWING_CONFLICT)); + expectedProblemAttributes.put("UnboxingConversion", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); + expectedProblemAttributes.put("UndefinedAnnotationMember", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("UndefinedConstructor", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("UndefinedConstructorInDefaultConstructor", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("UndefinedConstructorInImplicitConstructorCall", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("UndefinedField", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("UndefinedLabel", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("UndefinedMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("UndefinedName", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("UndefinedType", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("UndefinedTypeVariable", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("UndocumentedEmptyBlock", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); + expectedProblemAttributes.put("UnexpectedStaticModifierForField", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("UnexpectedStaticModifierForMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("UnhandledException", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("UnhandledExceptionInDefaultConstructor", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("UnhandledExceptionInImplicitConstructorCall", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); expectedProblemAttributes.put("UnhandledWarningToken", new ProblemAttributes(CategorizedProblem.CAT_UNNECESSARY_CODE)); - expectedProblemAttributes.put("AnnotationValueMustBeArrayInitializer", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("AnnotationValueMustBeAnEnumConstant", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("MethodMustOverrideOrImplement", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("UnusedWarningToken", new ProblemAttributes(CategorizedProblem.CAT_UNNECESSARY_CODE)); + expectedProblemAttributes.put("UninitializedBlankFinalField", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("UninitializedLocalVariable", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("UnmatchedBracket", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("UnnecessaryArgumentCast", DEPRECATED); + expectedProblemAttributes.put("UnnecessaryCast", new ProblemAttributes(CategorizedProblem.CAT_UNNECESSARY_CODE)); + expectedProblemAttributes.put("UnnecessaryElse", new ProblemAttributes(CategorizedProblem.CAT_UNNECESSARY_CODE)); + expectedProblemAttributes.put("UnnecessaryInstanceof", new ProblemAttributes(CategorizedProblem.CAT_UNNECESSARY_CODE)); + expectedProblemAttributes.put("UnnecessaryOperator", new ProblemAttributes(CategorizedProblem.CAT_UNNECESSARY_CODE)); + expectedProblemAttributes.put("UnnecessaryNLSTag", new ProblemAttributes(CategorizedProblem.CAT_NLS)); + expectedProblemAttributes.put("UnqualifiedFieldAccess", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); + expectedProblemAttributes.put("UnreachableCatch", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("UnresolvedVariable", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("UnsafeGenericArrayForVarargs", new ProblemAttributes(CategorizedProblem.CAT_UNCHECKED_RAW)); + expectedProblemAttributes.put("UnsafeGenericCast", new ProblemAttributes(CategorizedProblem.CAT_UNCHECKED_RAW)); + expectedProblemAttributes.put("UnsafeRawConstructorInvocation", new ProblemAttributes(CategorizedProblem.CAT_UNCHECKED_RAW)); + expectedProblemAttributes.put("UnsafeRawFieldAssignment", new ProblemAttributes(CategorizedProblem.CAT_UNCHECKED_RAW)); + expectedProblemAttributes.put("UnsafeRawGenericConstructorInvocation", new ProblemAttributes(CategorizedProblem.CAT_UNCHECKED_RAW)); + expectedProblemAttributes.put("UnsafeRawGenericMethodInvocation", new ProblemAttributes(CategorizedProblem.CAT_UNCHECKED_RAW)); + expectedProblemAttributes.put("UnsafeRawMethodInvocation", new ProblemAttributes(CategorizedProblem.CAT_UNCHECKED_RAW)); + expectedProblemAttributes.put("UnsafeReturnTypeOverride", new ProblemAttributes(CategorizedProblem.CAT_UNCHECKED_RAW)); + expectedProblemAttributes.put("UnsafeTypeConversion", new ProblemAttributes(CategorizedProblem.CAT_UNCHECKED_RAW)); + expectedProblemAttributes.put("UnterminatedComment", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("UnterminatedString", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); + expectedProblemAttributes.put("UnusedConstructorDeclaredThrownException", new ProblemAttributes(CategorizedProblem.CAT_UNNECESSARY_CODE)); + expectedProblemAttributes.put("UnusedImport", new ProblemAttributes(CategorizedProblem.CAT_UNNECESSARY_CODE)); + expectedProblemAttributes.put("UnusedLabel", new ProblemAttributes(CategorizedProblem.CAT_UNNECESSARY_CODE)); + expectedProblemAttributes.put("UnusedMethodDeclaredThrownException", new ProblemAttributes(CategorizedProblem.CAT_UNNECESSARY_CODE)); + expectedProblemAttributes.put("UnusedPrivateConstructor", new ProblemAttributes(CategorizedProblem.CAT_UNNECESSARY_CODE)); + expectedProblemAttributes.put("UnusedPrivateField", new ProblemAttributes(CategorizedProblem.CAT_UNNECESSARY_CODE)); + expectedProblemAttributes.put("UnusedPrivateMethod", new ProblemAttributes(CategorizedProblem.CAT_UNNECESSARY_CODE)); + expectedProblemAttributes.put("UnusedPrivateType", new ProblemAttributes(CategorizedProblem.CAT_UNNECESSARY_CODE)); expectedProblemAttributes.put("UnusedTypeArgumentsForConstructorInvocation", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("CorruptedSignature", new ProblemAttributes(CategorizedProblem.CAT_BUILDPATH)); - expectedProblemAttributes.put("InvalidEncoding", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("CannotReadSource", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("BoxingConversion", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); - expectedProblemAttributes.put("UnboxingConversion", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); - expectedProblemAttributes.put("IllegalModifierForEnum", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("IllegalModifierForEnumConstant", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("IllegalModifierForLocalEnum", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("IllegalModifierForMemberEnum", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("CannotDeclareEnumSpecialMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("IllegalQualifiedEnumConstantLabel", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("CannotExtendEnum", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); - expectedProblemAttributes.put("CannotInvokeSuperConstructorInEnum", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("EnumAbstractMethodMustBeImplemented", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("EnumSwitchCannotTargetField", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("IllegalModifierForEnumConstructor", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("MissingEnumConstantCase", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); - expectedProblemAttributes.put("EnumStaticFieldInInInitializerContext", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("EnumConstantMustImplementAbstractMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("EnumConstantCannotDefineAbstractMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("IllegalExtendedDimensionsForVarArgs", new ProblemAttributes(CategorizedProblem.CAT_SYNTAX)); - expectedProblemAttributes.put("MethodVarargsArgumentNeedCast", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); - expectedProblemAttributes.put("ConstructorVarargsArgumentNeedCast", new ProblemAttributes(CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM)); + expectedProblemAttributes.put("UnusedTypeArgumentsForMethodInvocation", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("UnusedWarningToken", new ProblemAttributes(CategorizedProblem.CAT_UNNECESSARY_CODE)); + expectedProblemAttributes.put("UseAssertAsAnIdentifier", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); + expectedProblemAttributes.put("UseEnumAsAnIdentifier", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); + expectedProblemAttributes.put("UsingDeprecatedConstructor", new ProblemAttributes(CategorizedProblem.CAT_DEPRECATION)); + expectedProblemAttributes.put("UsingDeprecatedField", new ProblemAttributes(CategorizedProblem.CAT_DEPRECATION)); + expectedProblemAttributes.put("UsingDeprecatedMethod", new ProblemAttributes(CategorizedProblem.CAT_DEPRECATION)); + expectedProblemAttributes.put("UsingDeprecatedType", new ProblemAttributes(CategorizedProblem.CAT_DEPRECATION)); expectedProblemAttributes.put("VarargsConflict", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); - expectedProblemAttributes.put("JavadocGenericMethodTypeArgumentMismatch", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocNonGenericMethod", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocIncorrectArityForParameterizedMethod", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocParameterizedMethodArgumentTypeMismatch", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocTypeArgumentsForRawGenericMethod", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocGenericConstructorTypeArgumentMismatch", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocNonGenericConstructor", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocIncorrectArityForParameterizedConstructor", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocParameterizedConstructorArgumentTypeMismatch", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("JavadocTypeArgumentsForRawGenericConstructor", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC)); - expectedProblemAttributes.put("ExternalProblemNotFixable", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - expectedProblemAttributes.put("ExternalProblemFixable", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("VariableTypeCannotBeVoid", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); + expectedProblemAttributes.put("VariableTypeCannotBeVoidArray", DEPRECATED); + expectedProblemAttributes.put("VoidMethodReturnsValue", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); + expectedProblemAttributes.put("WildcardConstructorInvocation", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("WildcardFieldAssignment", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); + expectedProblemAttributes.put("WildcardMethodInvocation", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); StringBuffer failures = new StringBuffer(); StringBuffer correctResult = new StringBuffer(70000); Field[] fields = (iProblemClass = IProblem.class).getFields(); @@ -870,26 +872,27 @@ public void test011_problem_categories() { int problemId = field.getInt(iProblemClass); int maskedProblemId = problemId & IProblem.IgnoreCategoriesMask; if (maskedProblemId != 0 && maskedProblemId != IProblem.IgnoreCategoriesMask) { - ProblemAttributes expectedAttributes = (ProblemAttributes) expectedProblemAttributes.get(field.getName()); + String name = field.getName(); + ProblemAttributes expectedAttributes = (ProblemAttributes) expectedProblemAttributes.get(name); if (expectedAttributes == null) { - failures.append("missing expected problem attributes for problem " + field.getName() + "\n"); + failures.append("missing expected problem attributes for problem " + name + "\n"); int actualCategory = ProblemReporter.getProblemCategory(ProblemSeverities.Error, problemId); - correctResult.append("\t\texpectedProblemAttributes.put(\"" + field.getName() + "\", new ProblemAttributes(CategorizedProblem." + categoryName(actualCategory) + "));\n"); + correctResult.append("\t\texpectedProblemAttributes.put(\"" + name + "\", new ProblemAttributes(CategorizedProblem." + categoryName(actualCategory) + "));\n"); } else if (!expectedAttributes.deprecated) { int actualCategory = ProblemReporter.getProblemCategory(ProblemSeverities.Error, problemId); - correctResult.append("\t\texpectedProblemAttributes.put(\"" + field.getName() + "\", new ProblemAttributes(CategorizedProblem." + categoryName(actualCategory) + "));\n"); + correctResult.append("\t\texpectedProblemAttributes.put(\"" + name + "\", new ProblemAttributes(CategorizedProblem." + categoryName(actualCategory) + "));\n"); if (expectedAttributes.category != actualCategory) { - failures.append("category mismatch for problem " + field.getName() + " (expected " + categoryName(expectedAttributes.category) + ", got " + categoryName(actualCategory) + ")\n"); + failures.append("category mismatch for problem " + name + " (expected " + categoryName(expectedAttributes.category) + ", got " + categoryName(actualCategory) + ")\n"); } if (watchInternalCategory && actualCategory == CategorizedProblem.CAT_INTERNAL) { if (printHeader) { printHeader = false; System.err.println("CAT_INTERNAL for problems:"); } - System.err.println("\t" + field.getName()); + System.err.println("\t" + name); } } else { - correctResult.append("\t\texpectedProblemAttributes.put(\"" + field.getName() + "\", DEPRECATED);\n"); + correctResult.append("\t\texpectedProblemAttributes.put(\"" + name + "\", DEPRECATED);\n"); } } } @@ -941,554 +944,555 @@ public void test012_compiler_problems_tuning() { } ProblemAttributes SKIP = new ProblemAttributes(true); Map expectedProblemAttributes = new HashMap(); - expectedProblemAttributes.put("ObjectHasNoSuperclass", SKIP); - expectedProblemAttributes.put("UndefinedType", SKIP); - expectedProblemAttributes.put("NotVisibleType", SKIP); + expectedProblemAttributes.put("AbstractMethodCannotBeOverridden", SKIP); + expectedProblemAttributes.put("AbstractMethodInAbstractClass", SKIP); + expectedProblemAttributes.put("AbstractMethodInEnum", SKIP); + expectedProblemAttributes.put("AbstractMethodMustBeImplemented", SKIP); + expectedProblemAttributes.put("AbstractMethodMustBeImplementedOverConcreteMethod", SKIP); + expectedProblemAttributes.put("AbstractMethodsInConcreteClass", SKIP); + expectedProblemAttributes.put("AmbiguousConstructor", SKIP); + expectedProblemAttributes.put("AmbiguousConstructorInDefaultConstructor", SKIP); + expectedProblemAttributes.put("AmbiguousConstructorInImplicitConstructorCall", SKIP); + expectedProblemAttributes.put("AmbiguousField", SKIP); + expectedProblemAttributes.put("AmbiguousMethod", SKIP); expectedProblemAttributes.put("AmbiguousType", SKIP); - expectedProblemAttributes.put("UsingDeprecatedType", new ProblemAttributes(JavaCore.COMPILER_PB_DEPRECATION)); - expectedProblemAttributes.put("InternalTypeNameProvided", SKIP); - expectedProblemAttributes.put("UnusedPrivateType", new ProblemAttributes(JavaCore.COMPILER_PB_UNUSED_PRIVATE_MEMBER)); - expectedProblemAttributes.put("IncompatibleTypesInEqualityOperator", SKIP); - expectedProblemAttributes.put("IncompatibleTypesInConditionalOperator", SKIP); - expectedProblemAttributes.put("TypeMismatch", SKIP); - expectedProblemAttributes.put("IndirectAccessToStaticType", new ProblemAttributes(JavaCore.COMPILER_PB_INDIRECT_STATIC_ACCESS)); - expectedProblemAttributes.put("MissingEnclosingInstanceForConstructorCall", SKIP); - expectedProblemAttributes.put("MissingEnclosingInstance", SKIP); - expectedProblemAttributes.put("IncorrectEnclosingInstanceReference", SKIP); - expectedProblemAttributes.put("IllegalEnclosingInstanceSpecification", SKIP); - expectedProblemAttributes.put("CannotDefineStaticInitializerInLocalType", SKIP); - expectedProblemAttributes.put("OuterLocalMustBeFinal", SKIP); - expectedProblemAttributes.put("CannotDefineInterfaceInLocalType", SKIP); - expectedProblemAttributes.put("IllegalPrimitiveOrArrayTypeForEnclosingInstance", SKIP); - expectedProblemAttributes.put("EnclosingInstanceInConstructorCall", SKIP); + expectedProblemAttributes.put("AnnotationCannotOverrideMethod", SKIP); + expectedProblemAttributes.put("AnnotationCircularity", SKIP); + expectedProblemAttributes.put("AnnotationCircularitySelfReference", SKIP); + expectedProblemAttributes.put("AnnotationFieldNeedConstantInitialization", SKIP); + expectedProblemAttributes.put("AnnotationMembersCannotHaveParameters", SKIP); + expectedProblemAttributes.put("AnnotationMembersCannotHaveTypeParameters", SKIP); + expectedProblemAttributes.put("AnnotationTypeDeclarationCannotHaveConstructor", SKIP); + expectedProblemAttributes.put("AnnotationTypeDeclarationCannotHaveSuperclass", SKIP); + expectedProblemAttributes.put("AnnotationTypeDeclarationCannotHaveSuperinterfaces", SKIP); + expectedProblemAttributes.put("AnnotationTypeUsedAsSuperInterface", new ProblemAttributes(JavaCore.COMPILER_PB_ANNOTATION_SUPER_INTERFACE)); + expectedProblemAttributes.put("AnnotationValueMustBeAnEnumConstant", SKIP); + expectedProblemAttributes.put("AnnotationValueMustBeAnnotation", SKIP); + expectedProblemAttributes.put("AnnotationValueMustBeArrayInitializer", SKIP); + expectedProblemAttributes.put("AnnotationValueMustBeClassLiteral", SKIP); + expectedProblemAttributes.put("AnnotationValueMustBeConstant", SKIP); expectedProblemAttributes.put("AnonymousClassCannotExtendFinalClass", SKIP); - expectedProblemAttributes.put("CannotDefineAnnotationInLocalType", SKIP); - expectedProblemAttributes.put("CannotDefineEnumInLocalType", SKIP); - expectedProblemAttributes.put("NonStaticContextForEnumMemberType", SKIP); - expectedProblemAttributes.put("TypeHidingType", new ProblemAttributes(JavaCore.COMPILER_PB_TYPE_PARAMETER_HIDING)); - expectedProblemAttributes.put("UndefinedName", SKIP); - expectedProblemAttributes.put("UninitializedLocalVariable", SKIP); - expectedProblemAttributes.put("VariableTypeCannotBeVoid", SKIP); - expectedProblemAttributes.put("VariableTypeCannotBeVoidArray", SKIP); - expectedProblemAttributes.put("CannotAllocateVoidArray", SKIP); - expectedProblemAttributes.put("RedefinedLocal", SKIP); - expectedProblemAttributes.put("RedefinedArgument", SKIP); - expectedProblemAttributes.put("DuplicateFinalLocalInitialization", SKIP); - expectedProblemAttributes.put("NonBlankFinalLocalAssignment", SKIP); - expectedProblemAttributes.put("ParameterAssignment", new ProblemAttributes(JavaCore.COMPILER_PB_PARAMETER_ASSIGNMENT)); - expectedProblemAttributes.put("FinalOuterLocalAssignment", SKIP); - expectedProblemAttributes.put("LocalVariableIsNeverUsed", new ProblemAttributes(JavaCore.COMPILER_PB_UNUSED_LOCAL)); + expectedProblemAttributes.put("ArgumentHidingField", new ProblemAttributes(JavaCore.COMPILER_PB_LOCAL_VARIABLE_HIDING)); + expectedProblemAttributes.put("ArgumentHidingLocalVariable", new ProblemAttributes(JavaCore.COMPILER_PB_LOCAL_VARIABLE_HIDING)); expectedProblemAttributes.put("ArgumentIsNeverUsed", new ProblemAttributes(JavaCore.COMPILER_PB_UNUSED_PARAMETER)); + expectedProblemAttributes.put("ArgumentTypeAmbiguous", SKIP); + expectedProblemAttributes.put("ArgumentTypeCannotBeVoid", SKIP); + expectedProblemAttributes.put("ArgumentTypeCannotBeVoidArray", SKIP); + expectedProblemAttributes.put("ArgumentTypeInheritedNameHidesEnclosingName", SKIP); + expectedProblemAttributes.put("ArgumentTypeInternalNameProvided", SKIP); + expectedProblemAttributes.put("ArgumentTypeNotFound", SKIP); + expectedProblemAttributes.put("ArgumentTypeNotVisible", SKIP); + expectedProblemAttributes.put("ArrayConstantsOnlyInArrayInitializers", SKIP); + expectedProblemAttributes.put("ArrayReferenceRequired", SKIP); + expectedProblemAttributes.put("AssignmentHasNoEffect", new ProblemAttributes(JavaCore.COMPILER_PB_NO_EFFECT_ASSIGNMENT)); + expectedProblemAttributes.put("BodyForAbstractMethod", SKIP); + expectedProblemAttributes.put("BodyForNativeMethod", SKIP); + expectedProblemAttributes.put("BoundCannotBeArray", SKIP); + expectedProblemAttributes.put("BoundHasConflictingArguments", SKIP); + expectedProblemAttributes.put("BoundMustBeAnInterface", SKIP); + expectedProblemAttributes.put("BoxingConversion", new ProblemAttributes(JavaCore.COMPILER_PB_AUTOBOXING)); expectedProblemAttributes.put("BytecodeExceeds64KLimit", SKIP); expectedProblemAttributes.put("BytecodeExceeds64KLimitForClinit", SKIP); - expectedProblemAttributes.put("TooManyArgumentSlots", SKIP); - expectedProblemAttributes.put("TooManyLocalVariableSlots", SKIP); - expectedProblemAttributes.put("TooManySyntheticArgumentSlots", SKIP); - expectedProblemAttributes.put("TooManyArrayDimensions", SKIP); expectedProblemAttributes.put("BytecodeExceeds64KLimitForConstructor", SKIP); - expectedProblemAttributes.put("UndefinedField", SKIP); - expectedProblemAttributes.put("NotVisibleField", SKIP); - expectedProblemAttributes.put("AmbiguousField", SKIP); - expectedProblemAttributes.put("UsingDeprecatedField", new ProblemAttributes(JavaCore.COMPILER_PB_DEPRECATION)); - expectedProblemAttributes.put("NonStaticFieldFromStaticInvocation", SKIP); - expectedProblemAttributes.put("ReferenceToForwardField", SKIP); - expectedProblemAttributes.put("NonStaticAccessToStaticField", new ProblemAttributes(JavaCore.COMPILER_PB_STATIC_ACCESS_RECEIVER)); - expectedProblemAttributes.put("UnusedPrivateField", new ProblemAttributes(JavaCore.COMPILER_PB_UNUSED_PRIVATE_MEMBER)); - expectedProblemAttributes.put("IndirectAccessToStaticField", new ProblemAttributes(JavaCore.COMPILER_PB_INDIRECT_STATIC_ACCESS)); - expectedProblemAttributes.put("UnqualifiedFieldAccess", new ProblemAttributes(JavaCore.COMPILER_PB_UNQUALIFIED_FIELD_ACCESS)); - expectedProblemAttributes.put("FinalFieldAssignment", SKIP); - expectedProblemAttributes.put("UninitializedBlankFinalField", SKIP); - expectedProblemAttributes.put("DuplicateBlankFinalFieldInitialization", SKIP); - expectedProblemAttributes.put("UnresolvedVariable", SKIP); - expectedProblemAttributes.put("LocalVariableHidingLocalVariable", new ProblemAttributes(JavaCore.COMPILER_PB_LOCAL_VARIABLE_HIDING)); - expectedProblemAttributes.put("LocalVariableHidingField", new ProblemAttributes(JavaCore.COMPILER_PB_LOCAL_VARIABLE_HIDING)); - expectedProblemAttributes.put("FieldHidingLocalVariable", new ProblemAttributes(JavaCore.COMPILER_PB_FIELD_HIDING)); - expectedProblemAttributes.put("FieldHidingField", new ProblemAttributes(JavaCore.COMPILER_PB_FIELD_HIDING)); - expectedProblemAttributes.put("ArgumentHidingLocalVariable", new ProblemAttributes(JavaCore.COMPILER_PB_LOCAL_VARIABLE_HIDING)); - expectedProblemAttributes.put("ArgumentHidingField", new ProblemAttributes(JavaCore.COMPILER_PB_LOCAL_VARIABLE_HIDING)); - expectedProblemAttributes.put("MissingSerialVersion", new ProblemAttributes(JavaCore.COMPILER_PB_MISSING_SERIAL_VERSION)); - expectedProblemAttributes.put("UndefinedMethod", SKIP); - expectedProblemAttributes.put("NotVisibleMethod", SKIP); - expectedProblemAttributes.put("AmbiguousMethod", SKIP); - expectedProblemAttributes.put("UsingDeprecatedMethod", new ProblemAttributes(JavaCore.COMPILER_PB_DEPRECATION)); - expectedProblemAttributes.put("DirectInvocationOfAbstractMethod", SKIP); - expectedProblemAttributes.put("VoidMethodReturnsValue", SKIP); - expectedProblemAttributes.put("MethodReturnsVoid", SKIP); - expectedProblemAttributes.put("MethodRequiresBody", SKIP); - expectedProblemAttributes.put("ShouldReturnValue", SKIP); - expectedProblemAttributes.put("MethodButWithConstructorName", new ProblemAttributes(JavaCore.COMPILER_PB_METHOD_WITH_CONSTRUCTOR_NAME)); - expectedProblemAttributes.put("MissingReturnType", SKIP); - expectedProblemAttributes.put("BodyForNativeMethod", SKIP); - expectedProblemAttributes.put("BodyForAbstractMethod", SKIP); - expectedProblemAttributes.put("NoMessageSendOnBaseType", SKIP); - expectedProblemAttributes.put("ParameterMismatch", SKIP); - expectedProblemAttributes.put("NoMessageSendOnArrayType", SKIP); - expectedProblemAttributes.put("NonStaticAccessToStaticMethod", new ProblemAttributes(JavaCore.COMPILER_PB_STATIC_ACCESS_RECEIVER)); - expectedProblemAttributes.put("UnusedPrivateMethod", new ProblemAttributes(JavaCore.COMPILER_PB_UNUSED_PRIVATE_MEMBER)); - expectedProblemAttributes.put("IndirectAccessToStaticMethod", new ProblemAttributes(JavaCore.COMPILER_PB_INDIRECT_STATIC_ACCESS)); - expectedProblemAttributes.put("MissingTypeInMethod", SKIP); - expectedProblemAttributes.put("MissingTypeInConstructor", SKIP); - expectedProblemAttributes.put("UndefinedConstructor", SKIP); - expectedProblemAttributes.put("NotVisibleConstructor", SKIP); - expectedProblemAttributes.put("AmbiguousConstructor", SKIP); - expectedProblemAttributes.put("UsingDeprecatedConstructor", new ProblemAttributes(JavaCore.COMPILER_PB_DEPRECATION)); - expectedProblemAttributes.put("UnusedPrivateConstructor", new ProblemAttributes(JavaCore.COMPILER_PB_UNUSED_PRIVATE_MEMBER)); - expectedProblemAttributes.put("InstanceFieldDuringConstructorInvocation", SKIP); - expectedProblemAttributes.put("InstanceMethodDuringConstructorInvocation", SKIP); - expectedProblemAttributes.put("RecursiveConstructorInvocation", SKIP); - expectedProblemAttributes.put("ThisSuperDuringConstructorInvocation", SKIP); - expectedProblemAttributes.put("InvalidExplicitConstructorCall", SKIP); - expectedProblemAttributes.put("UndefinedConstructorInDefaultConstructor", SKIP); - expectedProblemAttributes.put("NotVisibleConstructorInDefaultConstructor", SKIP); - expectedProblemAttributes.put("AmbiguousConstructorInDefaultConstructor", SKIP); - expectedProblemAttributes.put("UndefinedConstructorInImplicitConstructorCall", SKIP); - expectedProblemAttributes.put("NotVisibleConstructorInImplicitConstructorCall", SKIP); - expectedProblemAttributes.put("AmbiguousConstructorInImplicitConstructorCall", SKIP); - expectedProblemAttributes.put("UnhandledExceptionInDefaultConstructor", SKIP); - expectedProblemAttributes.put("UnhandledExceptionInImplicitConstructorCall", SKIP); - expectedProblemAttributes.put("DeadCode", new ProblemAttributes(JavaCore.COMPILER_PB_DEAD_CODE)); - expectedProblemAttributes.put("ArrayReferenceRequired", SKIP); - expectedProblemAttributes.put("NoImplicitStringConversionForCharArrayExpression", new ProblemAttributes(JavaCore.COMPILER_PB_CHAR_ARRAY_IN_STRING_CONCATENATION)); - expectedProblemAttributes.put("StringConstantIsExceedingUtf8Limit", SKIP); - expectedProblemAttributes.put("NonConstantExpression", SKIP); - expectedProblemAttributes.put("NumericValueOutOfRange", SKIP); - expectedProblemAttributes.put("IllegalCast", SKIP); - expectedProblemAttributes.put("InvalidClassInstantiation", SKIP); + expectedProblemAttributes.put("CannotAllocateVoidArray", SKIP); + expectedProblemAttributes.put("CannotDeclareEnumSpecialMethod", SKIP); + expectedProblemAttributes.put("CannotDefineAnnotationInLocalType", SKIP); expectedProblemAttributes.put("CannotDefineDimensionExpressionsWithInit", SKIP); - expectedProblemAttributes.put("MustDefineEitherDimensionExpressionsOrInitializer", SKIP); - expectedProblemAttributes.put("InvalidOperator", SKIP); - expectedProblemAttributes.put("CodeCannotBeReached", SKIP); + expectedProblemAttributes.put("CannotDefineEnumInLocalType", SKIP); + expectedProblemAttributes.put("CannotDefineInterfaceInLocalType", SKIP); + expectedProblemAttributes.put("CannotDefineStaticInitializerInLocalType", SKIP); + expectedProblemAttributes.put("CannotExtendEnum", SKIP); + expectedProblemAttributes.put("CannotHideAnInstanceMethodWithAStaticMethod", SKIP); + expectedProblemAttributes.put("CannotImportPackage", SKIP); + expectedProblemAttributes.put("CannotInvokeSuperConstructorInEnum", SKIP); + expectedProblemAttributes.put("CannotOverrideAStaticMethodWithAnInstanceMethod", SKIP); + expectedProblemAttributes.put("CannotReadSource", SKIP); expectedProblemAttributes.put("CannotReturnInInitializer", SKIP); - expectedProblemAttributes.put("InitializerMustCompleteNormally", SKIP); - expectedProblemAttributes.put("InvalidVoidExpression", SKIP); - expectedProblemAttributes.put("MaskedCatch", new ProblemAttributes(JavaCore.COMPILER_PB_HIDDEN_CATCH_BLOCK)); - expectedProblemAttributes.put("DuplicateDefaultCase", SKIP); - expectedProblemAttributes.put("UnreachableCatch", SKIP); - expectedProblemAttributes.put("UnhandledException", SKIP); - expectedProblemAttributes.put("IncorrectSwitchType", SKIP); + expectedProblemAttributes.put("CannotThrowNull", SKIP); + expectedProblemAttributes.put("CannotThrowType", SKIP); + expectedProblemAttributes.put("CannotUseSuperInCodeSnippet", SKIP); + expectedProblemAttributes.put("ClassExtendFinalClass", SKIP); + expectedProblemAttributes.put("CodeCannotBeReached", SKIP); + expectedProblemAttributes.put("CodeSnippetMissingClass", SKIP); + expectedProblemAttributes.put("CodeSnippetMissingMethod", SKIP); + expectedProblemAttributes.put("ComparingIdentical", new ProblemAttributes(JavaCore.COMPILER_PB_COMPARING_IDENTICAL)); + expectedProblemAttributes.put("ConflictingImport", SKIP); + expectedProblemAttributes.put("ConstructorVarargsArgumentNeedCast", new ProblemAttributes(JavaCore.COMPILER_PB_VARARGS_ARGUMENT_NEED_CAST)); + expectedProblemAttributes.put("CorruptedSignature", SKIP); + expectedProblemAttributes.put("DeadCode", new ProblemAttributes(JavaCore.COMPILER_PB_DEAD_CODE)); + expectedProblemAttributes.put("DirectInvocationOfAbstractMethod", SKIP); + expectedProblemAttributes.put("DisallowedTargetForAnnotation", SKIP); + expectedProblemAttributes.put("DiscouragedReference", new ProblemAttributes(JavaCore.COMPILER_PB_DISCOURAGED_REFERENCE)); + expectedProblemAttributes.put("DuplicateAnnotation", SKIP); + expectedProblemAttributes.put("DuplicateAnnotationMember", SKIP); + expectedProblemAttributes.put("DuplicateBlankFinalFieldInitialization", SKIP); + expectedProblemAttributes.put("DuplicateBounds", SKIP); expectedProblemAttributes.put("DuplicateCase", SKIP); + expectedProblemAttributes.put("DuplicateDefaultCase", SKIP); + expectedProblemAttributes.put("DuplicateField", SKIP); + expectedProblemAttributes.put("DuplicateFinalLocalInitialization", SKIP); + expectedProblemAttributes.put("DuplicateImport", SKIP); expectedProblemAttributes.put("DuplicateLabel", SKIP); - expectedProblemAttributes.put("InvalidBreak", SKIP); - expectedProblemAttributes.put("InvalidContinue", SKIP); - expectedProblemAttributes.put("UndefinedLabel", SKIP); - expectedProblemAttributes.put("InvalidTypeToSynchronized", SKIP); - expectedProblemAttributes.put("InvalidNullToSynchronized", SKIP); - expectedProblemAttributes.put("CannotThrowNull", SKIP); - expectedProblemAttributes.put("AssignmentHasNoEffect", new ProblemAttributes(JavaCore.COMPILER_PB_NO_EFFECT_ASSIGNMENT)); - expectedProblemAttributes.put("PossibleAccidentalBooleanAssignment", new ProblemAttributes(JavaCore.COMPILER_PB_POSSIBLE_ACCIDENTAL_BOOLEAN_ASSIGNMENT)); - expectedProblemAttributes.put("SuperfluousSemicolon", new ProblemAttributes(JavaCore.COMPILER_PB_EMPTY_STATEMENT)); - expectedProblemAttributes.put("UnnecessaryCast", new ProblemAttributes(JavaCore.COMPILER_PB_UNNECESSARY_TYPE_CHECK)); - expectedProblemAttributes.put("UnnecessaryArgumentCast", SKIP); - expectedProblemAttributes.put("UnnecessaryInstanceof", new ProblemAttributes(JavaCore.COMPILER_PB_UNNECESSARY_TYPE_CHECK)); - expectedProblemAttributes.put("FinallyMustCompleteNormally", new ProblemAttributes(JavaCore.COMPILER_PB_FINALLY_BLOCK_NOT_COMPLETING)); - expectedProblemAttributes.put("UnusedMethodDeclaredThrownException", new ProblemAttributes(JavaCore.COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_WHEN_OVERRIDING)); - expectedProblemAttributes.put("UnusedConstructorDeclaredThrownException", new ProblemAttributes(JavaCore.COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_WHEN_OVERRIDING)); - expectedProblemAttributes.put("InvalidCatchBlockSequence", SKIP); + expectedProblemAttributes.put("DuplicateMethod", SKIP); + expectedProblemAttributes.put("DuplicateMethodErasure", SKIP); + expectedProblemAttributes.put("DuplicateModifierForArgument", SKIP); + expectedProblemAttributes.put("DuplicateModifierForField", SKIP); + expectedProblemAttributes.put("DuplicateModifierForMethod", SKIP); + expectedProblemAttributes.put("DuplicateModifierForType", SKIP); + expectedProblemAttributes.put("DuplicateModifierForVariable", SKIP); + expectedProblemAttributes.put("DuplicateNestedType", SKIP); + expectedProblemAttributes.put("DuplicateParameterizedMethods", SKIP); + expectedProblemAttributes.put("DuplicateSuperInterface", SKIP); + expectedProblemAttributes.put("DuplicateTargetInTargetAnnotation", SKIP); + expectedProblemAttributes.put("DuplicateTypes", SKIP); + expectedProblemAttributes.put("DuplicateTypeVariable", SKIP); expectedProblemAttributes.put("EmptyControlFlowStatement", new ProblemAttributes(JavaCore.COMPILER_PB_EMPTY_STATEMENT)); - expectedProblemAttributes.put("UnnecessaryElse", new ProblemAttributes(JavaCore.COMPILER_PB_UNNECESSARY_ELSE)); - expectedProblemAttributes.put("NeedToEmulateFieldReadAccess", new ProblemAttributes(JavaCore.COMPILER_PB_SYNTHETIC_ACCESS_EMULATION)); - expectedProblemAttributes.put("NeedToEmulateFieldWriteAccess", new ProblemAttributes(JavaCore.COMPILER_PB_SYNTHETIC_ACCESS_EMULATION)); - expectedProblemAttributes.put("NeedToEmulateMethodAccess", new ProblemAttributes(JavaCore.COMPILER_PB_SYNTHETIC_ACCESS_EMULATION)); - expectedProblemAttributes.put("NeedToEmulateConstructorAccess", new ProblemAttributes(JavaCore.COMPILER_PB_SYNTHETIC_ACCESS_EMULATION)); + expectedProblemAttributes.put("EnclosingInstanceInConstructorCall", SKIP); + expectedProblemAttributes.put("EndOfSource", SKIP); + expectedProblemAttributes.put("EnumAbstractMethodMustBeImplemented", SKIP); + expectedProblemAttributes.put("EnumConstantCannotDefineAbstractMethod", SKIP); + expectedProblemAttributes.put("EnumConstantMustImplementAbstractMethod", SKIP); + expectedProblemAttributes.put("EnumConstantsCannotBeSurroundedByParenthesis", SKIP); + expectedProblemAttributes.put("EnumStaticFieldInInInitializerContext", SKIP); + expectedProblemAttributes.put("EnumSwitchCannotTargetField", SKIP); + expectedProblemAttributes.put("ExceptionTypeAmbiguous", SKIP); + expectedProblemAttributes.put("ExceptionTypeInheritedNameHidesEnclosingName", SKIP); + expectedProblemAttributes.put("ExceptionTypeInternalNameProvided", SKIP); + expectedProblemAttributes.put("ExceptionTypeNotFound", SKIP); + expectedProblemAttributes.put("ExceptionTypeNotVisible", SKIP); + expectedProblemAttributes.put("ExpressionShouldBeAVariable", SKIP); + expectedProblemAttributes.put("ExternalProblemFixable", SKIP); + expectedProblemAttributes.put("ExternalProblemNotFixable", SKIP); expectedProblemAttributes.put("FallthroughCase", new ProblemAttributes(JavaCore.COMPILER_PB_FALLTHROUGH_CASE)); - expectedProblemAttributes.put("InheritedMethodHidesEnclosingName", SKIP); - expectedProblemAttributes.put("InheritedFieldHidesEnclosingName", SKIP); - expectedProblemAttributes.put("InheritedTypeHidesEnclosingName", SKIP); - expectedProblemAttributes.put("IllegalUsageOfQualifiedTypeReference", SKIP); - expectedProblemAttributes.put("UnusedLabel", new ProblemAttributes(JavaCore.COMPILER_PB_UNUSED_LABEL)); - expectedProblemAttributes.put("ThisInStaticContext", SKIP); - expectedProblemAttributes.put("StaticMethodRequested", SKIP); + expectedProblemAttributes.put("FieldHidingField", new ProblemAttributes(JavaCore.COMPILER_PB_FIELD_HIDING)); + expectedProblemAttributes.put("FieldHidingLocalVariable", new ProblemAttributes(JavaCore.COMPILER_PB_FIELD_HIDING)); + expectedProblemAttributes.put("FieldMissingDeprecatedAnnotation", new ProblemAttributes(JavaCore.COMPILER_PB_MISSING_DEPRECATED_ANNOTATION)); + expectedProblemAttributes.put("FieldTypeAmbiguous", SKIP); + expectedProblemAttributes.put("FieldTypeInheritedNameHidesEnclosingName", SKIP); + expectedProblemAttributes.put("FieldTypeInternalNameProvided", SKIP); + expectedProblemAttributes.put("FieldTypeNotFound", SKIP); + expectedProblemAttributes.put("FieldTypeNotVisible", SKIP); + expectedProblemAttributes.put("FinalBoundForTypeVariable", new ProblemAttributes(JavaCore.COMPILER_PB_FINAL_PARAMETER_BOUND)); + expectedProblemAttributes.put("FinalFieldAssignment", SKIP); + expectedProblemAttributes.put("FinallyMustCompleteNormally", new ProblemAttributes(JavaCore.COMPILER_PB_FINALLY_BLOCK_NOT_COMPLETING)); + expectedProblemAttributes.put("FinalMethodCannotBeOverridden", SKIP); + expectedProblemAttributes.put("FinalOuterLocalAssignment", SKIP); + expectedProblemAttributes.put("ForbiddenReference", new ProblemAttributes(JavaCore.COMPILER_PB_FORBIDDEN_REFERENCE)); + expectedProblemAttributes.put("GenericConstructorTypeArgumentMismatch", SKIP); + expectedProblemAttributes.put("GenericMethodTypeArgumentMismatch", SKIP); + expectedProblemAttributes.put("GenericTypeCannotExtendThrowable", SKIP); + expectedProblemAttributes.put("HidingEnclosingType", SKIP); + expectedProblemAttributes.put("HierarchyCircularity", SKIP); + expectedProblemAttributes.put("HierarchyCircularitySelfReference", SKIP); + expectedProblemAttributes.put("HierarchyHasProblems", SKIP); + expectedProblemAttributes.put("IllegalAbstractModifierCombinationForMethod", SKIP); + expectedProblemAttributes.put("IllegalAccessFromTypeVariable", SKIP); + expectedProblemAttributes.put("IllegalCast", SKIP); + expectedProblemAttributes.put("IllegalClassLiteralForTypeVariable", SKIP); expectedProblemAttributes.put("IllegalDimension", SKIP); - expectedProblemAttributes.put("InvalidTypeExpression", SKIP); - expectedProblemAttributes.put("ParsingError", SKIP); - expectedProblemAttributes.put("ParsingErrorNoSuggestion", SKIP); - expectedProblemAttributes.put("InvalidUnaryExpression", SKIP); - expectedProblemAttributes.put("InterfaceCannotHaveConstructors", SKIP); - expectedProblemAttributes.put("ArrayConstantsOnlyInArrayInitializers", SKIP); - expectedProblemAttributes.put("ParsingErrorOnKeyword", SKIP); - expectedProblemAttributes.put("ParsingErrorOnKeywordNoSuggestion", SKIP); - expectedProblemAttributes.put("ComparingIdentical", new ProblemAttributes(JavaCore.COMPILER_PB_COMPARING_IDENTICAL)); - expectedProblemAttributes.put("UnmatchedBracket", SKIP); - expectedProblemAttributes.put("NoFieldOnBaseType", SKIP); - expectedProblemAttributes.put("InvalidExpressionAsStatement", SKIP); - expectedProblemAttributes.put("ExpressionShouldBeAVariable", SKIP); - expectedProblemAttributes.put("MissingSemiColon", SKIP); - expectedProblemAttributes.put("InvalidParenthesizedExpression", SKIP); - expectedProblemAttributes.put("ParsingErrorInsertTokenBefore", SKIP); - expectedProblemAttributes.put("ParsingErrorInsertTokenAfter", SKIP); - expectedProblemAttributes.put("ParsingErrorDeleteToken", SKIP); - expectedProblemAttributes.put("ParsingErrorDeleteTokens", SKIP); - expectedProblemAttributes.put("ParsingErrorMergeTokens", SKIP); - expectedProblemAttributes.put("ParsingErrorInvalidToken", SKIP); - expectedProblemAttributes.put("ParsingErrorMisplacedConstruct", SKIP); - expectedProblemAttributes.put("ParsingErrorReplaceTokens", SKIP); - expectedProblemAttributes.put("ParsingErrorNoSuggestionForTokens", SKIP); - expectedProblemAttributes.put("ParsingErrorUnexpectedEOF", SKIP); - expectedProblemAttributes.put("ParsingErrorInsertToComplete", SKIP); - expectedProblemAttributes.put("ParsingErrorInsertToCompleteScope", SKIP); - expectedProblemAttributes.put("ParsingErrorInsertToCompletePhrase", SKIP); - expectedProblemAttributes.put("EndOfSource", SKIP); - expectedProblemAttributes.put("InvalidHexa", SKIP); - expectedProblemAttributes.put("InvalidOctal", SKIP); - expectedProblemAttributes.put("InvalidCharacterConstant", SKIP); - expectedProblemAttributes.put("InvalidEscape", SKIP); - expectedProblemAttributes.put("InvalidInput", SKIP); - expectedProblemAttributes.put("InvalidUnicodeEscape", SKIP); - expectedProblemAttributes.put("InvalidFloat", SKIP); - expectedProblemAttributes.put("NullSourceString", SKIP); - expectedProblemAttributes.put("UnterminatedString", SKIP); - expectedProblemAttributes.put("UnterminatedComment", SKIP); - expectedProblemAttributes.put("NonExternalizedStringLiteral", new ProblemAttributes(JavaCore.COMPILER_PB_NON_NLS_STRING_LITERAL)); - expectedProblemAttributes.put("InvalidDigit", SKIP); - expectedProblemAttributes.put("InvalidLowSurrogate", SKIP); - expectedProblemAttributes.put("InvalidHighSurrogate", SKIP); - expectedProblemAttributes.put("UnnecessaryNLSTag", new ProblemAttributes(JavaCore.COMPILER_PB_NON_NLS_STRING_LITERAL)); - expectedProblemAttributes.put("DiscouragedReference", new ProblemAttributes(JavaCore.COMPILER_PB_DISCOURAGED_REFERENCE)); - expectedProblemAttributes.put("InterfaceCannotHaveInitializers", SKIP); - expectedProblemAttributes.put("DuplicateModifierForType", SKIP); + expectedProblemAttributes.put("IllegalEnclosingInstanceSpecification", SKIP); + expectedProblemAttributes.put("IllegalExtendedDimensions", SKIP); + expectedProblemAttributes.put("IllegalExtendedDimensionsForVarArgs", SKIP); + expectedProblemAttributes.put("IllegalGenericArray", SKIP); + expectedProblemAttributes.put("IllegalInstanceofParameterizedType", SKIP); + expectedProblemAttributes.put("IllegalInstanceofTypeParameter", SKIP); + expectedProblemAttributes.put("IllegalModifierCombinationFinalAbstractForClass", SKIP); + expectedProblemAttributes.put("IllegalModifierCombinationFinalVolatileForField", SKIP); + expectedProblemAttributes.put("IllegalModifierForAnnotationField", SKIP); + expectedProblemAttributes.put("IllegalModifierForAnnotationMemberType", SKIP); + expectedProblemAttributes.put("IllegalModifierForAnnotationMethod", SKIP); + expectedProblemAttributes.put("IllegalModifierForAnnotationType", SKIP); + expectedProblemAttributes.put("IllegalModifierForArgument", SKIP); expectedProblemAttributes.put("IllegalModifierForClass", SKIP); + expectedProblemAttributes.put("IllegalModifierForConstructor", SKIP); + expectedProblemAttributes.put("IllegalModifierForEnum", SKIP); + expectedProblemAttributes.put("IllegalModifierForEnumConstant", SKIP); + expectedProblemAttributes.put("IllegalModifierForEnumConstructor", SKIP); + expectedProblemAttributes.put("IllegalModifierForField", SKIP); expectedProblemAttributes.put("IllegalModifierForInterface", SKIP); + expectedProblemAttributes.put("IllegalModifierForInterfaceField", SKIP); + expectedProblemAttributes.put("IllegalModifierForInterfaceMethod", SKIP); + expectedProblemAttributes.put("IllegalModifierForLocalClass", SKIP); + expectedProblemAttributes.put("IllegalModifierForLocalEnum", SKIP); expectedProblemAttributes.put("IllegalModifierForMemberClass", SKIP); + expectedProblemAttributes.put("IllegalModifierForMemberEnum", SKIP); expectedProblemAttributes.put("IllegalModifierForMemberInterface", SKIP); - expectedProblemAttributes.put("IllegalModifierForLocalClass", SKIP); - expectedProblemAttributes.put("ForbiddenReference", new ProblemAttributes(JavaCore.COMPILER_PB_FORBIDDEN_REFERENCE)); - expectedProblemAttributes.put("IllegalModifierCombinationFinalAbstractForClass", SKIP); - expectedProblemAttributes.put("IllegalVisibilityModifierForInterfaceMemberType", SKIP); - expectedProblemAttributes.put("IllegalVisibilityModifierCombinationForMemberType", SKIP); + expectedProblemAttributes.put("IllegalModifierForMethod", SKIP); + expectedProblemAttributes.put("IllegalModifierForVariable", SKIP); + expectedProblemAttributes.put("IllegalPrimitiveOrArrayTypeForEnclosingInstance", SKIP); + expectedProblemAttributes.put("IllegalQualifiedEnumConstantLabel", SKIP); + expectedProblemAttributes.put("IllegalQualifiedParameterizedTypeAllocation", SKIP); expectedProblemAttributes.put("IllegalStaticModifierForMemberType", SKIP); - expectedProblemAttributes.put("SuperclassMustBeAClass", SKIP); - expectedProblemAttributes.put("ClassExtendFinalClass", SKIP); - expectedProblemAttributes.put("DuplicateSuperInterface", SKIP); - expectedProblemAttributes.put("SuperInterfaceMustBeAnInterface", SKIP); - expectedProblemAttributes.put("HierarchyCircularitySelfReference", SKIP); - expectedProblemAttributes.put("HierarchyCircularity", SKIP); - expectedProblemAttributes.put("HidingEnclosingType", SKIP); - expectedProblemAttributes.put("DuplicateNestedType", SKIP); - expectedProblemAttributes.put("CannotThrowType", SKIP); - expectedProblemAttributes.put("PackageCollidesWithType", SKIP); - expectedProblemAttributes.put("TypeCollidesWithPackage", SKIP); - expectedProblemAttributes.put("DuplicateTypes", SKIP); - expectedProblemAttributes.put("IsClassPathCorrect", SKIP); - expectedProblemAttributes.put("PublicClassMustMatchFileName", SKIP); - expectedProblemAttributes.put("MustSpecifyPackage", SKIP); - expectedProblemAttributes.put("HierarchyHasProblems", SKIP); - expectedProblemAttributes.put("PackageIsNotExpectedPackage", SKIP); - expectedProblemAttributes.put("ObjectCannotHaveSuperTypes", SKIP); - expectedProblemAttributes.put("ObjectMustBeClass", SKIP); - expectedProblemAttributes.put("RedundantSuperinterface", new ProblemAttributes(JavaCore.COMPILER_PB_REDUNDANT_SUPERINTERFACE)); - expectedProblemAttributes.put("ShouldImplementHashcode", new ProblemAttributes(JavaCore.COMPILER_PB_MISSING_HASHCODE_METHOD)); - expectedProblemAttributes.put("AbstractMethodsInConcreteClass", SKIP); - expectedProblemAttributes.put("AbstractMethodInEnum", SKIP); - expectedProblemAttributes.put("SuperclassNotFound", SKIP); - expectedProblemAttributes.put("SuperclassNotVisible", new ProblemAttributes(JavaCore.COMPILER_PB_REDUNDANT_SUPERINTERFACE)); - expectedProblemAttributes.put("SuperclassAmbiguous", SKIP); - expectedProblemAttributes.put("SuperclassInternalNameProvided", SKIP); - expectedProblemAttributes.put("SuperclassInheritedNameHidesEnclosingName", SKIP); - expectedProblemAttributes.put("InterfaceNotFound", SKIP); - expectedProblemAttributes.put("InterfaceNotVisible", SKIP); - expectedProblemAttributes.put("InterfaceAmbiguous", SKIP); - expectedProblemAttributes.put("InterfaceInternalNameProvided", SKIP); - expectedProblemAttributes.put("InterfaceInheritedNameHidesEnclosingName", SKIP); - expectedProblemAttributes.put("DuplicateField", SKIP); - expectedProblemAttributes.put("DuplicateModifierForField", SKIP); - expectedProblemAttributes.put("IllegalModifierForField", SKIP); - expectedProblemAttributes.put("IllegalModifierForInterfaceField", SKIP); + expectedProblemAttributes.put("IllegalTypeVariableSuperReference", SKIP); + expectedProblemAttributes.put("IllegalUsageOfQualifiedTypeReference", SKIP); + expectedProblemAttributes.put("IllegalVararg", SKIP); expectedProblemAttributes.put("IllegalVisibilityModifierCombinationForField", SKIP); - expectedProblemAttributes.put("IllegalModifierCombinationFinalVolatileForField", SKIP); - expectedProblemAttributes.put("UnexpectedStaticModifierForField", SKIP); - expectedProblemAttributes.put("FieldTypeNotFound", SKIP); - expectedProblemAttributes.put("FieldTypeNotVisible", SKIP); - expectedProblemAttributes.put("FieldTypeAmbiguous", SKIP); - expectedProblemAttributes.put("FieldTypeInternalNameProvided", SKIP); - expectedProblemAttributes.put("FieldTypeInheritedNameHidesEnclosingName", SKIP); - expectedProblemAttributes.put("DuplicateMethod", SKIP); - expectedProblemAttributes.put("IllegalModifierForArgument", SKIP); - expectedProblemAttributes.put("DuplicateModifierForMethod", SKIP); - expectedProblemAttributes.put("IllegalModifierForMethod", SKIP); - expectedProblemAttributes.put("IllegalModifierForInterfaceMethod", SKIP); + expectedProblemAttributes.put("IllegalVisibilityModifierCombinationForMemberType", SKIP); expectedProblemAttributes.put("IllegalVisibilityModifierCombinationForMethod", SKIP); - expectedProblemAttributes.put("UnexpectedStaticModifierForMethod", SKIP); - expectedProblemAttributes.put("IllegalAbstractModifierCombinationForMethod", SKIP); - expectedProblemAttributes.put("AbstractMethodInAbstractClass", SKIP); - expectedProblemAttributes.put("ArgumentTypeCannotBeVoid", SKIP); - expectedProblemAttributes.put("ArgumentTypeCannotBeVoidArray", SKIP); - expectedProblemAttributes.put("ReturnTypeCannotBeVoidArray", SKIP); - expectedProblemAttributes.put("NativeMethodsCannotBeStrictfp", SKIP); - expectedProblemAttributes.put("DuplicateModifierForArgument", SKIP); - expectedProblemAttributes.put("IllegalModifierForConstructor", SKIP); - expectedProblemAttributes.put("ArgumentTypeNotFound", SKIP); - expectedProblemAttributes.put("ArgumentTypeNotVisible", SKIP); - expectedProblemAttributes.put("ArgumentTypeAmbiguous", SKIP); - expectedProblemAttributes.put("ArgumentTypeInternalNameProvided", SKIP); - expectedProblemAttributes.put("ArgumentTypeInheritedNameHidesEnclosingName", SKIP); - expectedProblemAttributes.put("ExceptionTypeNotFound", SKIP); - expectedProblemAttributes.put("ExceptionTypeNotVisible", SKIP); - expectedProblemAttributes.put("ExceptionTypeAmbiguous", SKIP); - expectedProblemAttributes.put("ExceptionTypeInternalNameProvided", SKIP); - expectedProblemAttributes.put("ExceptionTypeInheritedNameHidesEnclosingName", SKIP); - expectedProblemAttributes.put("ReturnTypeNotFound", SKIP); - expectedProblemAttributes.put("ReturnTypeNotVisible", SKIP); - expectedProblemAttributes.put("ReturnTypeAmbiguous", SKIP); - expectedProblemAttributes.put("ReturnTypeInternalNameProvided", SKIP); - expectedProblemAttributes.put("ReturnTypeInheritedNameHidesEnclosingName", SKIP); - expectedProblemAttributes.put("ConflictingImport", SKIP); - expectedProblemAttributes.put("DuplicateImport", SKIP); - expectedProblemAttributes.put("CannotImportPackage", SKIP); - expectedProblemAttributes.put("UnusedImport", new ProblemAttributes(JavaCore.COMPILER_PB_UNUSED_IMPORT)); - expectedProblemAttributes.put("ImportNotFound", SKIP); - expectedProblemAttributes.put("ImportNotVisible", SKIP); + expectedProblemAttributes.put("IllegalVisibilityModifierForInterfaceMemberType", SKIP); expectedProblemAttributes.put("ImportAmbiguous", SKIP); - expectedProblemAttributes.put("ImportInternalNameProvided", SKIP); expectedProblemAttributes.put("ImportInheritedNameHidesEnclosingName", SKIP); - expectedProblemAttributes.put("InvalidTypeForStaticImport", SKIP); - expectedProblemAttributes.put("DuplicateModifierForVariable", SKIP); - expectedProblemAttributes.put("IllegalModifierForVariable", SKIP); - expectedProblemAttributes.put("LocalVariableCannotBeNull", SKIP); - expectedProblemAttributes.put("LocalVariableCanOnlyBeNull", SKIP); - expectedProblemAttributes.put("LocalVariableMayBeNull", SKIP); - expectedProblemAttributes.put("AbstractMethodMustBeImplemented", SKIP); - expectedProblemAttributes.put("FinalMethodCannotBeOverridden", SKIP); - expectedProblemAttributes.put("IncompatibleExceptionInThrowsClause", SKIP); + expectedProblemAttributes.put("ImportInternalNameProvided", SKIP); + expectedProblemAttributes.put("ImportNotFound", SKIP); + expectedProblemAttributes.put("ImportNotVisible", SKIP); expectedProblemAttributes.put("IncompatibleExceptionInInheritedMethodThrowsClause", SKIP); + expectedProblemAttributes.put("IncompatibleExceptionInThrowsClause", SKIP); + expectedProblemAttributes.put("IncompatibleExceptionInThrowsClauseForNonInheritedInterfaceMethod", new ProblemAttributes(JavaCore.COMPILER_PB_INCOMPATIBLE_NON_INHERITED_INTERFACE_METHOD)); expectedProblemAttributes.put("IncompatibleReturnType", SKIP); - expectedProblemAttributes.put("InheritedMethodReducesVisibility", SKIP); - expectedProblemAttributes.put("CannotOverrideAStaticMethodWithAnInstanceMethod", SKIP); - expectedProblemAttributes.put("CannotHideAnInstanceMethodWithAStaticMethod", SKIP); - expectedProblemAttributes.put("StaticInheritedMethodConflicts", SKIP); - expectedProblemAttributes.put("MethodReducesVisibility", SKIP); - expectedProblemAttributes.put("OverridingNonVisibleMethod", new ProblemAttributes(JavaCore.COMPILER_PB_OVERRIDING_PACKAGE_DEFAULT_METHOD)); - expectedProblemAttributes.put("AbstractMethodCannotBeOverridden", SKIP); - expectedProblemAttributes.put("OverridingDeprecatedMethod", new ProblemAttributes(JavaCore.COMPILER_PB_DEPRECATION)); expectedProblemAttributes.put("IncompatibleReturnTypeForNonInheritedInterfaceMethod", new ProblemAttributes(JavaCore.COMPILER_PB_INCOMPATIBLE_NON_INHERITED_INTERFACE_METHOD)); - expectedProblemAttributes.put("IncompatibleExceptionInThrowsClauseForNonInheritedInterfaceMethod", new ProblemAttributes(JavaCore.COMPILER_PB_INCOMPATIBLE_NON_INHERITED_INTERFACE_METHOD)); - expectedProblemAttributes.put("IllegalVararg", SKIP); - expectedProblemAttributes.put("OverridingMethodWithoutSuperInvocation", new ProblemAttributes(JavaCore.COMPILER_PB_OVERRIDING_METHOD_WITHOUT_SUPER_INVOCATION)); - expectedProblemAttributes.put("MissingSynchronizedModifierInInheritedMethod", new ProblemAttributes(JavaCore.COMPILER_PB_MISSING_SYNCHRONIZED_ON_INHERITED_METHOD)); - expectedProblemAttributes.put("AbstractMethodMustBeImplementedOverConcreteMethod", SKIP); + expectedProblemAttributes.put("IncompatibleTypesInConditionalOperator", SKIP); + expectedProblemAttributes.put("IncompatibleTypesInEqualityOperator", SKIP); + expectedProblemAttributes.put("IncompatibleTypesInForeach", SKIP); + expectedProblemAttributes.put("IncorrectArityForParameterizedConstructor", SKIP); + expectedProblemAttributes.put("IncorrectArityForParameterizedMethod", SKIP); + expectedProblemAttributes.put("IncorrectArityForParameterizedType", SKIP); + expectedProblemAttributes.put("IncorrectEnclosingInstanceReference", SKIP); + expectedProblemAttributes.put("IncorrectSwitchType", SKIP); + expectedProblemAttributes.put("IndirectAccessToStaticField", new ProblemAttributes(JavaCore.COMPILER_PB_INDIRECT_STATIC_ACCESS)); + expectedProblemAttributes.put("IndirectAccessToStaticMethod", new ProblemAttributes(JavaCore.COMPILER_PB_INDIRECT_STATIC_ACCESS)); + expectedProblemAttributes.put("IndirectAccessToStaticType", new ProblemAttributes(JavaCore.COMPILER_PB_INDIRECT_STATIC_ACCESS)); + expectedProblemAttributes.put("InheritedFieldHidesEnclosingName", SKIP); expectedProblemAttributes.put("InheritedIncompatibleReturnType", SKIP); - expectedProblemAttributes.put("CodeSnippetMissingClass", SKIP); - expectedProblemAttributes.put("CodeSnippetMissingMethod", SKIP); - expectedProblemAttributes.put("CannotUseSuperInCodeSnippet", SKIP); - expectedProblemAttributes.put("TooManyConstantsInConstantPool", SKIP); - expectedProblemAttributes.put("TooManyBytesForStringConstant", SKIP); - expectedProblemAttributes.put("TooManyFields", SKIP); - expectedProblemAttributes.put("TooManyMethods", SKIP); - expectedProblemAttributes.put("UseAssertAsAnIdentifier", new ProblemAttributes(JavaCore.COMPILER_PB_ASSERT_IDENTIFIER)); - expectedProblemAttributes.put("UseEnumAsAnIdentifier", new ProblemAttributes(JavaCore.COMPILER_PB_ENUM_IDENTIFIER)); - expectedProblemAttributes.put("EnumConstantsCannotBeSurroundedByParenthesis", SKIP); - expectedProblemAttributes.put("Task", SKIP); - expectedProblemAttributes.put("NullLocalVariableReference", new ProblemAttributes(JavaCore.COMPILER_PB_NULL_REFERENCE)); - expectedProblemAttributes.put("PotentialNullLocalVariableReference", new ProblemAttributes(JavaCore.COMPILER_PB_POTENTIAL_NULL_REFERENCE)); - expectedProblemAttributes.put("RedundantNullCheckOnNullLocalVariable", new ProblemAttributes(JavaCore.COMPILER_PB_REDUNDANT_NULL_CHECK)); - expectedProblemAttributes.put("NullLocalVariableComparisonYieldsFalse", new ProblemAttributes(JavaCore.COMPILER_PB_REDUNDANT_NULL_CHECK)); - expectedProblemAttributes.put("RedundantLocalVariableNullAssignment", new ProblemAttributes(JavaCore.COMPILER_PB_REDUNDANT_NULL_CHECK)); - expectedProblemAttributes.put("NullLocalVariableInstanceofYieldsFalse", new ProblemAttributes(JavaCore.COMPILER_PB_REDUNDANT_NULL_CHECK)); - expectedProblemAttributes.put("RedundantNullCheckOnNonNullLocalVariable", new ProblemAttributes(JavaCore.COMPILER_PB_REDUNDANT_NULL_CHECK)); - expectedProblemAttributes.put("NonNullLocalVariableComparisonYieldsFalse", new ProblemAttributes(JavaCore.COMPILER_PB_REDUNDANT_NULL_CHECK)); - expectedProblemAttributes.put("UndocumentedEmptyBlock", new ProblemAttributes(JavaCore.COMPILER_PB_UNDOCUMENTED_EMPTY_BLOCK)); - expectedProblemAttributes.put("JavadocInvalidSeeUrlReference", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocMissingTagDescription", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("InheritedMethodHidesEnclosingName", SKIP); + expectedProblemAttributes.put("InheritedMethodReducesVisibility", SKIP); + expectedProblemAttributes.put("InheritedTypeHidesEnclosingName", SKIP); + expectedProblemAttributes.put("InitializerMustCompleteNormally", SKIP); + expectedProblemAttributes.put("InstanceFieldDuringConstructorInvocation", SKIP); + expectedProblemAttributes.put("InstanceMethodDuringConstructorInvocation", SKIP); + expectedProblemAttributes.put("InterfaceAmbiguous", SKIP); + expectedProblemAttributes.put("InterfaceCannotHaveConstructors", SKIP); + expectedProblemAttributes.put("InterfaceCannotHaveInitializers", SKIP); + expectedProblemAttributes.put("InterfaceInheritedNameHidesEnclosingName", SKIP); + expectedProblemAttributes.put("InterfaceInternalNameProvided", SKIP); + expectedProblemAttributes.put("InterfaceNotFound", SKIP); + expectedProblemAttributes.put("InterfaceNotVisible", SKIP); + expectedProblemAttributes.put("InternalTypeNameProvided", SKIP); + expectedProblemAttributes.put("InvalidAnnotationMemberType", SKIP); + expectedProblemAttributes.put("InvalidBreak", SKIP); + expectedProblemAttributes.put("InvalidCatchBlockSequence", SKIP); + expectedProblemAttributes.put("InvalidCharacterConstant", SKIP); + expectedProblemAttributes.put("InvalidClassInstantiation", SKIP); + expectedProblemAttributes.put("InvalidContinue", SKIP); + expectedProblemAttributes.put("InvalidDigit", SKIP); + expectedProblemAttributes.put("InvalidEncoding", SKIP); + expectedProblemAttributes.put("InvalidEscape", SKIP); + expectedProblemAttributes.put("InvalidExplicitConstructorCall", SKIP); + expectedProblemAttributes.put("InvalidExpressionAsStatement", SKIP); + expectedProblemAttributes.put("InvalidFileNameForPackageAnnotations", SKIP); + expectedProblemAttributes.put("InvalidFloat", SKIP); + expectedProblemAttributes.put("InvalidHexa", SKIP); + expectedProblemAttributes.put("InvalidHighSurrogate", SKIP); + expectedProblemAttributes.put("InvalidInput", SKIP); + expectedProblemAttributes.put("InvalidLowSurrogate", SKIP); + expectedProblemAttributes.put("InvalidNullToSynchronized", SKIP); + expectedProblemAttributes.put("InvalidOctal", SKIP); + expectedProblemAttributes.put("InvalidOperator", SKIP); + expectedProblemAttributes.put("InvalidParameterizedExceptionType", SKIP); + expectedProblemAttributes.put("InvalidParenthesizedExpression", SKIP); + expectedProblemAttributes.put("InvalidTypeExpression", SKIP); + expectedProblemAttributes.put("InvalidTypeForCollection", SKIP); + expectedProblemAttributes.put("InvalidTypeForStaticImport", SKIP); + expectedProblemAttributes.put("InvalidTypeToSynchronized", SKIP); + expectedProblemAttributes.put("InvalidTypeVariableExceptionType", SKIP); + expectedProblemAttributes.put("InvalidUnaryExpression", SKIP); + expectedProblemAttributes.put("InvalidUnicodeEscape", SKIP); + expectedProblemAttributes.put("InvalidUsageOfAnnotationDeclarations", SKIP); + expectedProblemAttributes.put("InvalidUsageOfAnnotations", SKIP); + expectedProblemAttributes.put("InvalidUsageOfEnumDeclarations", SKIP); + expectedProblemAttributes.put("InvalidUsageOfForeachStatements", SKIP); + expectedProblemAttributes.put("InvalidUsageOfStaticImports", SKIP); + expectedProblemAttributes.put("InvalidUsageOfTypeArguments", SKIP); + expectedProblemAttributes.put("InvalidUsageOfTypeParameters", SKIP); + expectedProblemAttributes.put("InvalidUsageOfTypeParametersForAnnotationDeclaration", SKIP); + expectedProblemAttributes.put("InvalidUsageOfTypeParametersForEnumDeclaration", SKIP); + expectedProblemAttributes.put("InvalidUsageOfVarargs", SKIP); + expectedProblemAttributes.put("InvalidUsageOfWildcard", SKIP); + expectedProblemAttributes.put("InvalidVoidExpression", SKIP); + expectedProblemAttributes.put("IsClassPathCorrect", SKIP); + expectedProblemAttributes.put("JavadocAmbiguousConstructor", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocAmbiguousField", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocAmbiguousMethod", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocAmbiguousMethodReference", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocAmbiguousType", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocDuplicateParamName", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocDuplicateReturnTag", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); expectedProblemAttributes.put("JavadocDuplicateTag", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocDuplicateThrowsClassName", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocEmptyReturnTag", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocGenericConstructorTypeArgumentMismatch", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocGenericMethodTypeArgumentMismatch", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); expectedProblemAttributes.put("JavadocHiddenReference", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocIncorrectArityForParameterizedConstructor", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocIncorrectArityForParameterizedMethod", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocInheritedFieldHidesEnclosingName", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocInheritedMethodHidesEnclosingName", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocInheritedNameHidesEnclosingTypeName", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocInternalTypeNameProvided", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); expectedProblemAttributes.put("JavadocInvalidMemberTypeQualification", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocMissingIdentifier", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocNonStaticTypeFromStaticInvocation", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocInvalidParamTagTypeParameter", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocUnexpectedTag", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocMissingParamTag", new ProblemAttributes(JavaCore.COMPILER_PB_MISSING_JAVADOC_TAGS)); - expectedProblemAttributes.put("JavadocMissingParamName", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocDuplicateParamName", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); expectedProblemAttributes.put("JavadocInvalidParamName", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocMissingReturnTag", new ProblemAttributes(JavaCore.COMPILER_PB_MISSING_JAVADOC_TAGS)); - expectedProblemAttributes.put("JavadocDuplicateReturnTag", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocMissingThrowsTag", new ProblemAttributes(JavaCore.COMPILER_PB_MISSING_JAVADOC_TAGS)); - expectedProblemAttributes.put("JavadocMissingThrowsClassName", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocInvalidParamTagName", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocInvalidParamTagTypeParameter", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocInvalidSeeArgs", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocInvalidSeeHref", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocInvalidSeeReference", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocInvalidSeeUrlReference", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocInvalidTag", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); expectedProblemAttributes.put("JavadocInvalidThrowsClass", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocDuplicateThrowsClassName", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); expectedProblemAttributes.put("JavadocInvalidThrowsClassName", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocMissingSeeReference", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocInvalidSeeReference", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocInvalidSeeHref", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocInvalidSeeArgs", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocInvalidValueReference", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocMalformedSeeReference", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocMessagePrefix", SKIP); expectedProblemAttributes.put("JavadocMissing", new ProblemAttributes(JavaCore.COMPILER_PB_MISSING_JAVADOC_COMMENTS)); - expectedProblemAttributes.put("JavadocInvalidTag", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocUndefinedField", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocNotVisibleField", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocAmbiguousField", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocUsingDeprecatedField", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocUndefinedConstructor", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocMissingHashCharacter", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocMissingIdentifier", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocMissingParamName", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocMissingParamTag", new ProblemAttributes(JavaCore.COMPILER_PB_MISSING_JAVADOC_TAGS)); + expectedProblemAttributes.put("JavadocMissingReturnTag", new ProblemAttributes(JavaCore.COMPILER_PB_MISSING_JAVADOC_TAGS)); + expectedProblemAttributes.put("JavadocMissingSeeReference", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocMissingTagDescription", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocMissingThrowsClassName", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocMissingThrowsTag", new ProblemAttributes(JavaCore.COMPILER_PB_MISSING_JAVADOC_TAGS)); + expectedProblemAttributes.put("JavadocNoMessageSendOnArrayType", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocNoMessageSendOnBaseType", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocNonGenericConstructor", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocNonGenericMethod", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocNonStaticTypeFromStaticInvocation", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); expectedProblemAttributes.put("JavadocNotVisibleConstructor", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocAmbiguousConstructor", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocUsingDeprecatedConstructor", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocUndefinedMethod", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocNotVisibleField", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); expectedProblemAttributes.put("JavadocNotVisibleMethod", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocAmbiguousMethod", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocUsingDeprecatedMethod", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocNoMessageSendOnBaseType", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocNotVisibleType", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocParameterizedConstructorArgumentTypeMismatch", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocParameterizedMethodArgumentTypeMismatch", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); expectedProblemAttributes.put("JavadocParameterMismatch", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocNoMessageSendOnArrayType", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocTypeArgumentsForRawGenericConstructor", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocTypeArgumentsForRawGenericMethod", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocUndefinedConstructor", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocUndefinedField", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocUndefinedMethod", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); expectedProblemAttributes.put("JavadocUndefinedType", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocNotVisibleType", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocAmbiguousType", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocUsingDeprecatedType", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocInternalTypeNameProvided", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocInheritedMethodHidesEnclosingName", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocInheritedFieldHidesEnclosingName", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocInheritedNameHidesEnclosingTypeName", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocAmbiguousMethodReference", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocUnterminatedInlineTag", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocMalformedSeeReference", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocMessagePrefix", SKIP); - expectedProblemAttributes.put("JavadocMissingHashCharacter", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocEmptyReturnTag", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocInvalidValueReference", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocUnexpectedTag", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); expectedProblemAttributes.put("JavadocUnexpectedText", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocInvalidParamTagName", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("DuplicateTypeVariable", SKIP); - expectedProblemAttributes.put("IllegalTypeVariableSuperReference", SKIP); + expectedProblemAttributes.put("JavadocUnterminatedInlineTag", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocUsingDeprecatedConstructor", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocUsingDeprecatedField", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocUsingDeprecatedMethod", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("JavadocUsingDeprecatedType", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); + expectedProblemAttributes.put("LocalVariableCannotBeNull", SKIP); + expectedProblemAttributes.put("LocalVariableCanOnlyBeNull", SKIP); + expectedProblemAttributes.put("LocalVariableHidingField", new ProblemAttributes(JavaCore.COMPILER_PB_LOCAL_VARIABLE_HIDING)); + expectedProblemAttributes.put("LocalVariableHidingLocalVariable", new ProblemAttributes(JavaCore.COMPILER_PB_LOCAL_VARIABLE_HIDING)); + expectedProblemAttributes.put("LocalVariableIsNeverUsed", new ProblemAttributes(JavaCore.COMPILER_PB_UNUSED_LOCAL)); + expectedProblemAttributes.put("LocalVariableMayBeNull", SKIP); + expectedProblemAttributes.put("MaskedCatch", new ProblemAttributes(JavaCore.COMPILER_PB_HIDDEN_CATCH_BLOCK)); + expectedProblemAttributes.put("MethodButWithConstructorName", new ProblemAttributes(JavaCore.COMPILER_PB_METHOD_WITH_CONSTRUCTOR_NAME)); + expectedProblemAttributes.put("MethodMissingDeprecatedAnnotation", new ProblemAttributes(JavaCore.COMPILER_PB_MISSING_DEPRECATED_ANNOTATION)); + expectedProblemAttributes.put("MethodMustOverride", SKIP); + expectedProblemAttributes.put("MethodMustOverrideOrImplement", SKIP); + expectedProblemAttributes.put("MethodNameClash", SKIP); + expectedProblemAttributes.put("MethodReducesVisibility", SKIP); + expectedProblemAttributes.put("MethodRequiresBody", SKIP); + expectedProblemAttributes.put("MethodReturnsVoid", SKIP); + expectedProblemAttributes.put("MethodVarargsArgumentNeedCast", new ProblemAttributes(JavaCore.COMPILER_PB_VARARGS_ARGUMENT_NEED_CAST)); + expectedProblemAttributes.put("MissingArgumentsForParameterizedMemberType", SKIP); + expectedProblemAttributes.put("MissingEnclosingInstance", SKIP); + expectedProblemAttributes.put("MissingEnclosingInstanceForConstructorCall", SKIP); + expectedProblemAttributes.put("MissingEnumConstantCase", new ProblemAttributes(JavaCore.COMPILER_PB_INCOMPLETE_ENUM_SWITCH)); + expectedProblemAttributes.put("MissingOverrideAnnotation", new ProblemAttributes(JavaCore.COMPILER_PB_MISSING_OVERRIDE_ANNOTATION)); + expectedProblemAttributes.put("MissingOverrideAnnotationForInterfaceMethodImplementation", SKIP); + expectedProblemAttributes.put("MissingReturnType", SKIP); + expectedProblemAttributes.put("MissingSemiColon", SKIP); + expectedProblemAttributes.put("MissingSerialVersion", new ProblemAttributes(JavaCore.COMPILER_PB_MISSING_SERIAL_VERSION)); + expectedProblemAttributes.put("MissingSynchronizedModifierInInheritedMethod", new ProblemAttributes(JavaCore.COMPILER_PB_MISSING_SYNCHRONIZED_ON_INHERITED_METHOD)); + expectedProblemAttributes.put("MissingTypeInConstructor", SKIP); + expectedProblemAttributes.put("MissingTypeInMethod", SKIP); + expectedProblemAttributes.put("MissingValueForAnnotationMember", SKIP); + expectedProblemAttributes.put("MustDefineEitherDimensionExpressionsOrInitializer", SKIP); + expectedProblemAttributes.put("MustSpecifyPackage", SKIP); + expectedProblemAttributes.put("NativeMethodsCannotBeStrictfp", SKIP); + expectedProblemAttributes.put("NeedToEmulateConstructorAccess", new ProblemAttributes(JavaCore.COMPILER_PB_SYNTHETIC_ACCESS_EMULATION)); + expectedProblemAttributes.put("NeedToEmulateFieldReadAccess", new ProblemAttributes(JavaCore.COMPILER_PB_SYNTHETIC_ACCESS_EMULATION)); + expectedProblemAttributes.put("NeedToEmulateFieldWriteAccess", new ProblemAttributes(JavaCore.COMPILER_PB_SYNTHETIC_ACCESS_EMULATION)); + expectedProblemAttributes.put("NeedToEmulateMethodAccess", new ProblemAttributes(JavaCore.COMPILER_PB_SYNTHETIC_ACCESS_EMULATION)); + expectedProblemAttributes.put("NoAdditionalBoundAfterTypeVariable", SKIP); + expectedProblemAttributes.put("NoFieldOnBaseType", SKIP); + expectedProblemAttributes.put("NoImplicitStringConversionForCharArrayExpression", new ProblemAttributes(JavaCore.COMPILER_PB_CHAR_ARRAY_IN_STRING_CONCATENATION)); + expectedProblemAttributes.put("NoMessageSendOnArrayType", SKIP); + expectedProblemAttributes.put("NoMessageSendOnBaseType", SKIP); + expectedProblemAttributes.put("NonBlankFinalLocalAssignment", SKIP); + expectedProblemAttributes.put("NonConstantExpression", SKIP); + expectedProblemAttributes.put("NonExternalizedStringLiteral", new ProblemAttributes(JavaCore.COMPILER_PB_NON_NLS_STRING_LITERAL)); + expectedProblemAttributes.put("NonGenericConstructor", SKIP); + expectedProblemAttributes.put("NonGenericMethod", SKIP); + expectedProblemAttributes.put("NonGenericType", SKIP); + expectedProblemAttributes.put("NonNullLocalVariableComparisonYieldsFalse", new ProblemAttributes(JavaCore.COMPILER_PB_REDUNDANT_NULL_CHECK)); + expectedProblemAttributes.put("NonStaticAccessToStaticField", new ProblemAttributes(JavaCore.COMPILER_PB_STATIC_ACCESS_RECEIVER)); + expectedProblemAttributes.put("NonStaticAccessToStaticMethod", new ProblemAttributes(JavaCore.COMPILER_PB_STATIC_ACCESS_RECEIVER)); + expectedProblemAttributes.put("NonStaticContextForEnumMemberType", SKIP); + expectedProblemAttributes.put("NonStaticFieldFromStaticInvocation", SKIP); expectedProblemAttributes.put("NonStaticTypeFromStaticInvocation", SKIP); + expectedProblemAttributes.put("NotVisibleConstructor", SKIP); + expectedProblemAttributes.put("NotVisibleConstructorInDefaultConstructor", SKIP); + expectedProblemAttributes.put("NotVisibleConstructorInImplicitConstructorCall", SKIP); + expectedProblemAttributes.put("NotVisibleField", SKIP); + expectedProblemAttributes.put("NotVisibleMethod", SKIP); + expectedProblemAttributes.put("NotVisibleType", SKIP); + expectedProblemAttributes.put("NullLocalVariableComparisonYieldsFalse", new ProblemAttributes(JavaCore.COMPILER_PB_REDUNDANT_NULL_CHECK)); + expectedProblemAttributes.put("NullLocalVariableInstanceofYieldsFalse", new ProblemAttributes(JavaCore.COMPILER_PB_REDUNDANT_NULL_CHECK)); + expectedProblemAttributes.put("NullLocalVariableReference", new ProblemAttributes(JavaCore.COMPILER_PB_NULL_REFERENCE)); + expectedProblemAttributes.put("NullSourceString", SKIP); + expectedProblemAttributes.put("NumericValueOutOfRange", SKIP); expectedProblemAttributes.put("ObjectCannotBeGeneric", SKIP); - expectedProblemAttributes.put("NonGenericType", SKIP); - expectedProblemAttributes.put("IncorrectArityForParameterizedType", SKIP); - expectedProblemAttributes.put("TypeArgumentMismatch", SKIP); - expectedProblemAttributes.put("DuplicateMethodErasure", SKIP); - expectedProblemAttributes.put("ReferenceToForwardTypeVariable", SKIP); - expectedProblemAttributes.put("BoundMustBeAnInterface", SKIP); - expectedProblemAttributes.put("UnsafeRawConstructorInvocation", new ProblemAttributes(JavaCore.COMPILER_PB_UNCHECKED_TYPE_OPERATION)); - expectedProblemAttributes.put("UnsafeRawMethodInvocation", new ProblemAttributes(JavaCore.COMPILER_PB_UNCHECKED_TYPE_OPERATION)); - expectedProblemAttributes.put("UnsafeTypeConversion", new ProblemAttributes(JavaCore.COMPILER_PB_UNCHECKED_TYPE_OPERATION)); - expectedProblemAttributes.put("InvalidTypeVariableExceptionType", SKIP); - expectedProblemAttributes.put("InvalidParameterizedExceptionType", SKIP); - expectedProblemAttributes.put("IllegalGenericArray", SKIP); - expectedProblemAttributes.put("UnsafeRawFieldAssignment", new ProblemAttributes(JavaCore.COMPILER_PB_UNCHECKED_TYPE_OPERATION)); - expectedProblemAttributes.put("FinalBoundForTypeVariable", new ProblemAttributes(JavaCore.COMPILER_PB_FINAL_PARAMETER_BOUND)); - expectedProblemAttributes.put("UndefinedTypeVariable", SKIP); - expectedProblemAttributes.put("SuperInterfacesCollide", SKIP); - expectedProblemAttributes.put("WildcardConstructorInvocation", SKIP); - expectedProblemAttributes.put("WildcardMethodInvocation", SKIP); - expectedProblemAttributes.put("WildcardFieldAssignment", SKIP); - expectedProblemAttributes.put("GenericMethodTypeArgumentMismatch", SKIP); - expectedProblemAttributes.put("GenericConstructorTypeArgumentMismatch", SKIP); - expectedProblemAttributes.put("UnsafeGenericCast", new ProblemAttributes(JavaCore.COMPILER_PB_UNCHECKED_TYPE_OPERATION)); - expectedProblemAttributes.put("IllegalInstanceofParameterizedType", SKIP); - expectedProblemAttributes.put("IllegalInstanceofTypeParameter", SKIP); - expectedProblemAttributes.put("NonGenericMethod", SKIP); - expectedProblemAttributes.put("IncorrectArityForParameterizedMethod", SKIP); - expectedProblemAttributes.put("ParameterizedMethodArgumentTypeMismatch", SKIP); - expectedProblemAttributes.put("NonGenericConstructor", SKIP); - expectedProblemAttributes.put("IncorrectArityForParameterizedConstructor", SKIP); + expectedProblemAttributes.put("ObjectCannotHaveSuperTypes", SKIP); + expectedProblemAttributes.put("ObjectHasNoSuperclass", SKIP); + expectedProblemAttributes.put("ObjectMustBeClass", SKIP); + expectedProblemAttributes.put("OuterLocalMustBeFinal", SKIP); + expectedProblemAttributes.put("OverridingDeprecatedMethod", new ProblemAttributes(JavaCore.COMPILER_PB_DEPRECATION)); + expectedProblemAttributes.put("OverridingMethodWithoutSuperInvocation", new ProblemAttributes(JavaCore.COMPILER_PB_OVERRIDING_METHOD_WITHOUT_SUPER_INVOCATION)); + expectedProblemAttributes.put("OverridingNonVisibleMethod", new ProblemAttributes(JavaCore.COMPILER_PB_OVERRIDING_PACKAGE_DEFAULT_METHOD)); + expectedProblemAttributes.put("PackageCollidesWithType", SKIP); + expectedProblemAttributes.put("PackageIsNotExpectedPackage", SKIP); + expectedProblemAttributes.put("ParameterAssignment", new ProblemAttributes(JavaCore.COMPILER_PB_PARAMETER_ASSIGNMENT)); expectedProblemAttributes.put("ParameterizedConstructorArgumentTypeMismatch", SKIP); - expectedProblemAttributes.put("TypeArgumentsForRawGenericMethod", SKIP); - expectedProblemAttributes.put("TypeArgumentsForRawGenericConstructor", SKIP); - expectedProblemAttributes.put("SuperTypeUsingWildcard", SKIP); - expectedProblemAttributes.put("GenericTypeCannotExtendThrowable", SKIP); - expectedProblemAttributes.put("IllegalClassLiteralForTypeVariable", SKIP); - expectedProblemAttributes.put("UnsafeReturnTypeOverride", new ProblemAttributes(JavaCore.COMPILER_PB_UNCHECKED_TYPE_OPERATION)); - expectedProblemAttributes.put("MethodNameClash", SKIP); + expectedProblemAttributes.put("ParameterizedMethodArgumentTypeMismatch", SKIP); + expectedProblemAttributes.put("ParameterMismatch", SKIP); + expectedProblemAttributes.put("ParsingError", SKIP); + expectedProblemAttributes.put("ParsingErrorDeleteToken", SKIP); + expectedProblemAttributes.put("ParsingErrorDeleteTokens", SKIP); + expectedProblemAttributes.put("ParsingErrorInsertToComplete", SKIP); + expectedProblemAttributes.put("ParsingErrorInsertToCompletePhrase", SKIP); + expectedProblemAttributes.put("ParsingErrorInsertToCompleteScope", SKIP); + expectedProblemAttributes.put("ParsingErrorInsertTokenAfter", SKIP); + expectedProblemAttributes.put("ParsingErrorInsertTokenBefore", SKIP); + expectedProblemAttributes.put("ParsingErrorInvalidToken", SKIP); + expectedProblemAttributes.put("ParsingErrorMergeTokens", SKIP); + expectedProblemAttributes.put("ParsingErrorMisplacedConstruct", SKIP); + expectedProblemAttributes.put("ParsingErrorNoSuggestion", SKIP); + expectedProblemAttributes.put("ParsingErrorNoSuggestionForTokens", SKIP); + expectedProblemAttributes.put("ParsingErrorOnKeyword", SKIP); + expectedProblemAttributes.put("ParsingErrorOnKeywordNoSuggestion", SKIP); + expectedProblemAttributes.put("ParsingErrorReplaceTokens", SKIP); + expectedProblemAttributes.put("ParsingErrorUnexpectedEOF", SKIP); + expectedProblemAttributes.put("PossibleAccidentalBooleanAssignment", new ProblemAttributes(JavaCore.COMPILER_PB_POSSIBLE_ACCIDENTAL_BOOLEAN_ASSIGNMENT)); + expectedProblemAttributes.put("PotentialNullLocalVariableReference", new ProblemAttributes(JavaCore.COMPILER_PB_POTENTIAL_NULL_REFERENCE)); + expectedProblemAttributes.put("PublicClassMustMatchFileName", SKIP); expectedProblemAttributes.put("RawMemberTypeCannotBeParameterized", SKIP); - expectedProblemAttributes.put("MissingArgumentsForParameterizedMemberType", SKIP); - expectedProblemAttributes.put("StaticMemberOfParameterizedType", SKIP); - expectedProblemAttributes.put("BoundHasConflictingArguments", SKIP); - expectedProblemAttributes.put("DuplicateParameterizedMethods", SKIP); - expectedProblemAttributes.put("IllegalQualifiedParameterizedTypeAllocation", SKIP); - expectedProblemAttributes.put("DuplicateBounds", SKIP); - expectedProblemAttributes.put("BoundCannotBeArray", SKIP); - expectedProblemAttributes.put("UnsafeRawGenericConstructorInvocation", new ProblemAttributes(JavaCore.COMPILER_PB_UNCHECKED_TYPE_OPERATION)); - expectedProblemAttributes.put("UnsafeRawGenericMethodInvocation", new ProblemAttributes(JavaCore.COMPILER_PB_UNCHECKED_TYPE_OPERATION)); - expectedProblemAttributes.put("TypeParameterHidingType", new ProblemAttributes(JavaCore.COMPILER_PB_TYPE_PARAMETER_HIDING)); expectedProblemAttributes.put("RawTypeReference", new ProblemAttributes(JavaCore.COMPILER_PB_RAW_TYPE_REFERENCE)); - expectedProblemAttributes.put("NoAdditionalBoundAfterTypeVariable", SKIP); - expectedProblemAttributes.put("UnsafeGenericArrayForVarargs", new ProblemAttributes(JavaCore.COMPILER_PB_UNCHECKED_TYPE_OPERATION)); - expectedProblemAttributes.put("IllegalAccessFromTypeVariable", SKIP); - expectedProblemAttributes.put("TypeHidingTypeParameterFromType", new ProblemAttributes(JavaCore.COMPILER_PB_TYPE_PARAMETER_HIDING)); + expectedProblemAttributes.put("RecursiveConstructorInvocation", SKIP); + expectedProblemAttributes.put("RedefinedArgument", SKIP); + expectedProblemAttributes.put("RedefinedLocal", SKIP); + expectedProblemAttributes.put("RedundantLocalVariableNullAssignment", new ProblemAttributes(JavaCore.COMPILER_PB_REDUNDANT_NULL_CHECK)); + expectedProblemAttributes.put("RedundantNullCheckOnNonNullLocalVariable", new ProblemAttributes(JavaCore.COMPILER_PB_REDUNDANT_NULL_CHECK)); + expectedProblemAttributes.put("RedundantNullCheckOnNullLocalVariable", new ProblemAttributes(JavaCore.COMPILER_PB_REDUNDANT_NULL_CHECK)); + expectedProblemAttributes.put("RedundantSuperinterface", new ProblemAttributes(JavaCore.COMPILER_PB_REDUNDANT_SUPERINTERFACE)); + expectedProblemAttributes.put("ReferenceToForwardField", SKIP); + expectedProblemAttributes.put("ReferenceToForwardTypeVariable", SKIP); + expectedProblemAttributes.put("ReturnTypeAmbiguous", SKIP); + expectedProblemAttributes.put("ReturnTypeCannotBeVoidArray", SKIP); + expectedProblemAttributes.put("ReturnTypeInheritedNameHidesEnclosingName", SKIP); + expectedProblemAttributes.put("ReturnTypeInternalNameProvided", SKIP); + expectedProblemAttributes.put("ReturnTypeNotFound", SKIP); + expectedProblemAttributes.put("ReturnTypeNotVisible", SKIP); + expectedProblemAttributes.put("ShouldImplementHashcode", new ProblemAttributes(JavaCore.COMPILER_PB_MISSING_HASHCODE_METHOD)); + expectedProblemAttributes.put("ShouldReturnValue", SKIP); + expectedProblemAttributes.put("StaticInheritedMethodConflicts", SKIP); + expectedProblemAttributes.put("StaticMemberOfParameterizedType", SKIP); + expectedProblemAttributes.put("StaticMethodRequested", SKIP); + expectedProblemAttributes.put("StringConstantIsExceedingUtf8Limit", SKIP); + expectedProblemAttributes.put("SuperclassAmbiguous", SKIP); + expectedProblemAttributes.put("SuperclassInheritedNameHidesEnclosingName", SKIP); + expectedProblemAttributes.put("SuperclassInternalNameProvided", SKIP); + expectedProblemAttributes.put("SuperclassMustBeAClass", SKIP); + expectedProblemAttributes.put("SuperclassNotFound", SKIP); + expectedProblemAttributes.put("SuperclassNotVisible", new ProblemAttributes(JavaCore.COMPILER_PB_REDUNDANT_SUPERINTERFACE)); + expectedProblemAttributes.put("SuperfluousSemicolon", new ProblemAttributes(JavaCore.COMPILER_PB_EMPTY_STATEMENT)); + expectedProblemAttributes.put("SuperInterfaceMustBeAnInterface", SKIP); + expectedProblemAttributes.put("SuperInterfacesCollide", SKIP); + expectedProblemAttributes.put("SuperTypeUsingWildcard", SKIP); + expectedProblemAttributes.put("Task", SKIP); + expectedProblemAttributes.put("ThisInStaticContext", SKIP); + expectedProblemAttributes.put("ThisSuperDuringConstructorInvocation", SKIP); + expectedProblemAttributes.put("TooManyArgumentSlots", SKIP); + expectedProblemAttributes.put("TooManyArrayDimensions", SKIP); + expectedProblemAttributes.put("TooManyBytesForStringConstant", SKIP); + expectedProblemAttributes.put("TooManyConstantsInConstantPool", SKIP); + expectedProblemAttributes.put("TooManyFields", SKIP); + expectedProblemAttributes.put("TooManyLocalVariableSlots", SKIP); + expectedProblemAttributes.put("TooManyMethods", SKIP); + expectedProblemAttributes.put("TooManySyntheticArgumentSlots", SKIP); + expectedProblemAttributes.put("TypeArgumentMismatch", SKIP); + expectedProblemAttributes.put("TypeArgumentsForRawGenericConstructor", SKIP); + expectedProblemAttributes.put("TypeArgumentsForRawGenericMethod", SKIP); + expectedProblemAttributes.put("TypeCollidesWithPackage", SKIP); + expectedProblemAttributes.put("TypeHidingType", new ProblemAttributes(JavaCore.COMPILER_PB_TYPE_PARAMETER_HIDING)); expectedProblemAttributes.put("TypeHidingTypeParameterFromMethod", new ProblemAttributes(JavaCore.COMPILER_PB_TYPE_PARAMETER_HIDING)); - expectedProblemAttributes.put("InvalidUsageOfWildcard", SKIP); - expectedProblemAttributes.put("UnusedTypeArgumentsForMethodInvocation", new ProblemAttributes(JavaCore.COMPILER_PB_UNUSED_TYPE_ARGUMENTS_FOR_METHOD_INVOCATION)); - expectedProblemAttributes.put("IncompatibleTypesInForeach", SKIP); - expectedProblemAttributes.put("InvalidTypeForCollection", SKIP); - expectedProblemAttributes.put("InvalidUsageOfTypeParameters", SKIP); - expectedProblemAttributes.put("InvalidUsageOfStaticImports", SKIP); - expectedProblemAttributes.put("InvalidUsageOfForeachStatements", SKIP); - expectedProblemAttributes.put("InvalidUsageOfTypeArguments", SKIP); - expectedProblemAttributes.put("InvalidUsageOfEnumDeclarations", SKIP); - expectedProblemAttributes.put("InvalidUsageOfVarargs", SKIP); - expectedProblemAttributes.put("InvalidUsageOfAnnotations", SKIP); - expectedProblemAttributes.put("InvalidUsageOfAnnotationDeclarations", SKIP); - expectedProblemAttributes.put("InvalidUsageOfTypeParametersForAnnotationDeclaration", SKIP); - expectedProblemAttributes.put("InvalidUsageOfTypeParametersForEnumDeclaration", SKIP); - expectedProblemAttributes.put("IllegalModifierForAnnotationMethod", SKIP); - expectedProblemAttributes.put("IllegalExtendedDimensions", SKIP); - expectedProblemAttributes.put("InvalidFileNameForPackageAnnotations", SKIP); - expectedProblemAttributes.put("IllegalModifierForAnnotationType", SKIP); - expectedProblemAttributes.put("IllegalModifierForAnnotationMemberType", SKIP); - expectedProblemAttributes.put("InvalidAnnotationMemberType", SKIP); - expectedProblemAttributes.put("AnnotationCircularitySelfReference", SKIP); - expectedProblemAttributes.put("AnnotationCircularity", SKIP); - expectedProblemAttributes.put("DuplicateAnnotation", SKIP); - expectedProblemAttributes.put("MissingValueForAnnotationMember", SKIP); - expectedProblemAttributes.put("DuplicateAnnotationMember", SKIP); - expectedProblemAttributes.put("UndefinedAnnotationMember", SKIP); - expectedProblemAttributes.put("AnnotationValueMustBeClassLiteral", SKIP); - expectedProblemAttributes.put("AnnotationValueMustBeConstant", SKIP); - expectedProblemAttributes.put("AnnotationFieldNeedConstantInitialization", SKIP); - expectedProblemAttributes.put("IllegalModifierForAnnotationField", SKIP); - expectedProblemAttributes.put("AnnotationCannotOverrideMethod", SKIP); - expectedProblemAttributes.put("AnnotationMembersCannotHaveParameters", SKIP); - expectedProblemAttributes.put("AnnotationMembersCannotHaveTypeParameters", SKIP); - expectedProblemAttributes.put("AnnotationTypeDeclarationCannotHaveSuperclass", SKIP); - expectedProblemAttributes.put("AnnotationTypeDeclarationCannotHaveSuperinterfaces", SKIP); - expectedProblemAttributes.put("DuplicateTargetInTargetAnnotation", SKIP); - expectedProblemAttributes.put("DisallowedTargetForAnnotation", SKIP); - expectedProblemAttributes.put("MethodMustOverride", SKIP); - expectedProblemAttributes.put("AnnotationTypeDeclarationCannotHaveConstructor", SKIP); - expectedProblemAttributes.put("AnnotationValueMustBeAnnotation", SKIP); - expectedProblemAttributes.put("AnnotationTypeUsedAsSuperInterface", new ProblemAttributes(JavaCore.COMPILER_PB_ANNOTATION_SUPER_INTERFACE)); - expectedProblemAttributes.put("MissingOverrideAnnotation", new ProblemAttributes(JavaCore.COMPILER_PB_MISSING_OVERRIDE_ANNOTATION)); - expectedProblemAttributes.put("FieldMissingDeprecatedAnnotation", new ProblemAttributes(JavaCore.COMPILER_PB_MISSING_DEPRECATED_ANNOTATION)); - expectedProblemAttributes.put("MethodMissingDeprecatedAnnotation", new ProblemAttributes(JavaCore.COMPILER_PB_MISSING_DEPRECATED_ANNOTATION)); + expectedProblemAttributes.put("TypeHidingTypeParameterFromType", new ProblemAttributes(JavaCore.COMPILER_PB_TYPE_PARAMETER_HIDING)); + expectedProblemAttributes.put("TypeMismatch", SKIP); expectedProblemAttributes.put("TypeMissingDeprecatedAnnotation", new ProblemAttributes(JavaCore.COMPILER_PB_MISSING_DEPRECATED_ANNOTATION)); + expectedProblemAttributes.put("TypeParameterHidingType", new ProblemAttributes(JavaCore.COMPILER_PB_TYPE_PARAMETER_HIDING)); + expectedProblemAttributes.put("UnboxingConversion", new ProblemAttributes(JavaCore.COMPILER_PB_AUTOBOXING)); + expectedProblemAttributes.put("UndefinedAnnotationMember", SKIP); + expectedProblemAttributes.put("UndefinedConstructor", SKIP); + expectedProblemAttributes.put("UndefinedConstructorInDefaultConstructor", SKIP); + expectedProblemAttributes.put("UndefinedConstructorInImplicitConstructorCall", SKIP); + expectedProblemAttributes.put("UndefinedField", SKIP); + expectedProblemAttributes.put("UndefinedLabel", SKIP); + expectedProblemAttributes.put("UndefinedMethod", SKIP); + expectedProblemAttributes.put("UndefinedName", SKIP); + expectedProblemAttributes.put("UndefinedType", SKIP); + expectedProblemAttributes.put("UndefinedTypeVariable", SKIP); + expectedProblemAttributes.put("UndocumentedEmptyBlock", new ProblemAttributes(JavaCore.COMPILER_PB_UNDOCUMENTED_EMPTY_BLOCK)); + expectedProblemAttributes.put("UnexpectedStaticModifierForField", SKIP); + expectedProblemAttributes.put("UnexpectedStaticModifierForMethod", SKIP); + expectedProblemAttributes.put("UnhandledException", SKIP); + expectedProblemAttributes.put("UnhandledExceptionInDefaultConstructor", SKIP); + expectedProblemAttributes.put("UnhandledExceptionInImplicitConstructorCall", SKIP); expectedProblemAttributes.put("UnhandledWarningToken", new ProblemAttributes(JavaCore.COMPILER_PB_UNHANDLED_WARNING_TOKEN)); - expectedProblemAttributes.put("AnnotationValueMustBeArrayInitializer", SKIP); - expectedProblemAttributes.put("AnnotationValueMustBeAnEnumConstant", SKIP); - expectedProblemAttributes.put("MethodMustOverrideOrImplement", SKIP); - expectedProblemAttributes.put("UnusedWarningToken", new ProblemAttributes(JavaCore.COMPILER_PB_UNUSED_WARNING_TOKEN)); + expectedProblemAttributes.put("UninitializedBlankFinalField", SKIP); + expectedProblemAttributes.put("UninitializedLocalVariable", SKIP); + expectedProblemAttributes.put("UnmatchedBracket", SKIP); + expectedProblemAttributes.put("UnnecessaryArgumentCast", SKIP); + expectedProblemAttributes.put("UnnecessaryCast", new ProblemAttributes(JavaCore.COMPILER_PB_UNNECESSARY_TYPE_CHECK)); + expectedProblemAttributes.put("UnnecessaryElse", new ProblemAttributes(JavaCore.COMPILER_PB_UNNECESSARY_ELSE)); + expectedProblemAttributes.put("UnnecessaryInstanceof", new ProblemAttributes(JavaCore.COMPILER_PB_UNNECESSARY_TYPE_CHECK)); + expectedProblemAttributes.put("UnnecessaryNLSTag", new ProblemAttributes(JavaCore.COMPILER_PB_NON_NLS_STRING_LITERAL)); + expectedProblemAttributes.put("UnqualifiedFieldAccess", new ProblemAttributes(JavaCore.COMPILER_PB_UNQUALIFIED_FIELD_ACCESS)); + expectedProblemAttributes.put("UnreachableCatch", SKIP); + expectedProblemAttributes.put("UnresolvedVariable", SKIP); + expectedProblemAttributes.put("UnsafeGenericArrayForVarargs", new ProblemAttributes(JavaCore.COMPILER_PB_UNCHECKED_TYPE_OPERATION)); + expectedProblemAttributes.put("UnsafeGenericCast", new ProblemAttributes(JavaCore.COMPILER_PB_UNCHECKED_TYPE_OPERATION)); + expectedProblemAttributes.put("UnsafeRawConstructorInvocation", new ProblemAttributes(JavaCore.COMPILER_PB_UNCHECKED_TYPE_OPERATION)); + expectedProblemAttributes.put("UnsafeRawFieldAssignment", new ProblemAttributes(JavaCore.COMPILER_PB_UNCHECKED_TYPE_OPERATION)); + expectedProblemAttributes.put("UnsafeRawGenericConstructorInvocation", new ProblemAttributes(JavaCore.COMPILER_PB_UNCHECKED_TYPE_OPERATION)); + expectedProblemAttributes.put("UnsafeRawGenericMethodInvocation", new ProblemAttributes(JavaCore.COMPILER_PB_UNCHECKED_TYPE_OPERATION)); + expectedProblemAttributes.put("UnsafeRawMethodInvocation", new ProblemAttributes(JavaCore.COMPILER_PB_UNCHECKED_TYPE_OPERATION)); + expectedProblemAttributes.put("UnsafeReturnTypeOverride", new ProblemAttributes(JavaCore.COMPILER_PB_UNCHECKED_TYPE_OPERATION)); + expectedProblemAttributes.put("UnsafeTypeConversion", new ProblemAttributes(JavaCore.COMPILER_PB_UNCHECKED_TYPE_OPERATION)); + expectedProblemAttributes.put("UnterminatedComment", SKIP); + expectedProblemAttributes.put("UnterminatedString", SKIP); + expectedProblemAttributes.put("UnusedConstructorDeclaredThrownException", new ProblemAttributes(JavaCore.COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_WHEN_OVERRIDING)); + expectedProblemAttributes.put("UnusedImport", new ProblemAttributes(JavaCore.COMPILER_PB_UNUSED_IMPORT)); + expectedProblemAttributes.put("UnusedLabel", new ProblemAttributes(JavaCore.COMPILER_PB_UNUSED_LABEL)); + expectedProblemAttributes.put("UnusedMethodDeclaredThrownException", new ProblemAttributes(JavaCore.COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_WHEN_OVERRIDING)); + expectedProblemAttributes.put("UnusedPrivateConstructor", new ProblemAttributes(JavaCore.COMPILER_PB_UNUSED_PRIVATE_MEMBER)); + expectedProblemAttributes.put("UnusedPrivateField", new ProblemAttributes(JavaCore.COMPILER_PB_UNUSED_PRIVATE_MEMBER)); + expectedProblemAttributes.put("UnusedPrivateMethod", new ProblemAttributes(JavaCore.COMPILER_PB_UNUSED_PRIVATE_MEMBER)); + expectedProblemAttributes.put("UnusedPrivateType", new ProblemAttributes(JavaCore.COMPILER_PB_UNUSED_PRIVATE_MEMBER)); expectedProblemAttributes.put("UnusedTypeArgumentsForConstructorInvocation", new ProblemAttributes(JavaCore.COMPILER_PB_UNUSED_TYPE_ARGUMENTS_FOR_METHOD_INVOCATION)); - expectedProblemAttributes.put("CorruptedSignature", SKIP); - expectedProblemAttributes.put("InvalidEncoding", SKIP); - expectedProblemAttributes.put("CannotReadSource", SKIP); - expectedProblemAttributes.put("BoxingConversion", new ProblemAttributes(JavaCore.COMPILER_PB_AUTOBOXING)); - expectedProblemAttributes.put("UnboxingConversion", new ProblemAttributes(JavaCore.COMPILER_PB_AUTOBOXING)); - expectedProblemAttributes.put("IllegalModifierForEnum", SKIP); - expectedProblemAttributes.put("IllegalModifierForEnumConstant", SKIP); - expectedProblemAttributes.put("IllegalModifierForLocalEnum", SKIP); - expectedProblemAttributes.put("IllegalModifierForMemberEnum", SKIP); - expectedProblemAttributes.put("CannotDeclareEnumSpecialMethod", SKIP); - expectedProblemAttributes.put("IllegalQualifiedEnumConstantLabel", SKIP); - expectedProblemAttributes.put("CannotExtendEnum", SKIP); - expectedProblemAttributes.put("CannotInvokeSuperConstructorInEnum", SKIP); - expectedProblemAttributes.put("EnumAbstractMethodMustBeImplemented", SKIP); - expectedProblemAttributes.put("EnumSwitchCannotTargetField", SKIP); - expectedProblemAttributes.put("IllegalModifierForEnumConstructor", SKIP); - expectedProblemAttributes.put("MissingEnumConstantCase", new ProblemAttributes(JavaCore.COMPILER_PB_INCOMPLETE_ENUM_SWITCH)); - expectedProblemAttributes.put("EnumStaticFieldInInInitializerContext", SKIP); - expectedProblemAttributes.put("EnumConstantMustImplementAbstractMethod", SKIP); - expectedProblemAttributes.put("EnumConstantCannotDefineAbstractMethod", SKIP); - expectedProblemAttributes.put("IllegalExtendedDimensionsForVarArgs", SKIP); - expectedProblemAttributes.put("MethodVarargsArgumentNeedCast", new ProblemAttributes(JavaCore.COMPILER_PB_VARARGS_ARGUMENT_NEED_CAST)); - expectedProblemAttributes.put("ConstructorVarargsArgumentNeedCast", new ProblemAttributes(JavaCore.COMPILER_PB_VARARGS_ARGUMENT_NEED_CAST)); + expectedProblemAttributes.put("UnusedTypeArgumentsForMethodInvocation", new ProblemAttributes(JavaCore.COMPILER_PB_UNUSED_TYPE_ARGUMENTS_FOR_METHOD_INVOCATION)); + expectedProblemAttributes.put("UnusedWarningToken", new ProblemAttributes(JavaCore.COMPILER_PB_UNUSED_WARNING_TOKEN)); + expectedProblemAttributes.put("UseAssertAsAnIdentifier", new ProblemAttributes(JavaCore.COMPILER_PB_ASSERT_IDENTIFIER)); + expectedProblemAttributes.put("UseEnumAsAnIdentifier", new ProblemAttributes(JavaCore.COMPILER_PB_ENUM_IDENTIFIER)); + expectedProblemAttributes.put("UsingDeprecatedConstructor", new ProblemAttributes(JavaCore.COMPILER_PB_DEPRECATION)); + expectedProblemAttributes.put("UsingDeprecatedField", new ProblemAttributes(JavaCore.COMPILER_PB_DEPRECATION)); + expectedProblemAttributes.put("UsingDeprecatedMethod", new ProblemAttributes(JavaCore.COMPILER_PB_DEPRECATION)); + expectedProblemAttributes.put("UsingDeprecatedType", new ProblemAttributes(JavaCore.COMPILER_PB_DEPRECATION)); expectedProblemAttributes.put("VarargsConflict", SKIP); - expectedProblemAttributes.put("JavadocGenericMethodTypeArgumentMismatch", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocNonGenericMethod", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocIncorrectArityForParameterizedMethod", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocParameterizedMethodArgumentTypeMismatch", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocTypeArgumentsForRawGenericMethod", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocGenericConstructorTypeArgumentMismatch", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocNonGenericConstructor", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocIncorrectArityForParameterizedConstructor", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocParameterizedConstructorArgumentTypeMismatch", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("JavadocTypeArgumentsForRawGenericConstructor", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC)); - expectedProblemAttributes.put("ExternalProblemNotFixable", SKIP); - expectedProblemAttributes.put("ExternalProblemFixable", SKIP); + expectedProblemAttributes.put("VariableTypeCannotBeVoid", SKIP); + expectedProblemAttributes.put("VariableTypeCannotBeVoidArray", SKIP); + expectedProblemAttributes.put("VoidMethodReturnsValue", SKIP); + expectedProblemAttributes.put("WildcardConstructorInvocation", SKIP); + expectedProblemAttributes.put("WildcardFieldAssignment", SKIP); + expectedProblemAttributes.put("WildcardMethodInvocation", SKIP); Map constantNamesIndex = new HashMap(); Field[] fields = JavaCore.class.getFields(); for (int i = 0, length = fields.length; i < length; i++) { @@ -1506,15 +1510,16 @@ public void test012_compiler_problems_tuning() { if (field.getType() == Integer.TYPE) { int problemId = field.getInt(null), maskedProblemId = problemId & IProblem.IgnoreCategoriesMask; if (maskedProblemId != 0 && maskedProblemId != IProblem.IgnoreCategoriesMask) { - ProblemAttributes expectedAttributes = (ProblemAttributes) expectedProblemAttributes.get(field.getName()); + String name = field.getName(); + ProblemAttributes expectedAttributes = (ProblemAttributes) expectedProblemAttributes.get(name); String actualTuningOption = JavaCore.getOptionForConfigurableSeverity(problemId); if (expectedAttributes == null) { - failures.append("missing expected problem attributes for problem " + field.getName() + "\n"); + failures.append("missing expected problem attributes for problem " + name + "\n"); } else if (!expectedAttributes.skip && !expectedAttributes.option.equals(actualTuningOption)) { - failures.append("tuning option mismatch for problem " + field.getName() + " (expected " + expectedAttributes.option + ", got " + actualTuningOption + ")\n"); + failures.append("tuning option mismatch for problem " + name + " (expected " + expectedAttributes.option + ", got " + actualTuningOption + ")\n"); } String optionFieldName = (String) constantNamesIndex.get(actualTuningOption); - correctResult.append("\t\texpectedProblemAttributes.put(\"" + field.getName() + "\", " + + correctResult.append("\t\texpectedProblemAttributes.put(\"" + name + "\", " + (optionFieldName != null ? "new ProblemAttributes(JavaCore." + optionFieldName + ")" : "SKIP") + ");\n"); } diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/DeprecatedTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/DeprecatedTest.java index df26b2b480..0e0b93203e 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/DeprecatedTest.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/DeprecatedTest.java @@ -593,7 +593,7 @@ public void test015() { "----------\n" + /* expected compiler log */ "1. ERROR in p\\M1.java (at line 4)\n" + " a.N1.N2.N3 m = null;\n" + - " ^^^^^^^^^^\n" + + " ^^^^^^^\n" + "The type N1.N2 is deprecated\n" + "----------\n" + "2. ERROR in p\\M1.java (at line 4)\n" + @@ -644,7 +644,7 @@ public void test016() { "----------\n" + /* expected compiler log */ "1. ERROR in p\\M1.java (at line 4)\n" + " a.N1.N2.N3 m = null;\n" + - " ^^^^^^^^^^\n" + + " ^^^^^^^\n" + "The type N1.N2 is deprecated\n" + "----------\n" + "2. ERROR in p\\M1.java (at line 4)\n" + @@ -739,7 +739,7 @@ public void test018() { "----------\n" + /* expected compiler log */ "1. ERROR in p\\M1.java (at line 4)\n" + " a.N1.N2.N3 m = null;\n" + - " ^^^^^^^^^^\n" + + " ^^^^^^^\n" + "The type N1.N2 is deprecated\n" + "----------\n" + "2. ERROR in p\\M1.java (at line 4)\n" + diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java index 72c7e4b9d9..b61f7e7548 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java @@ -33,7 +33,7 @@ public class EnumTest extends AbstractComparableTest { // All specified tests which does not belong to the class are skipped... static { // TESTS_NAMES = new String[] { "test000" }; -// TESTS_NUMBERS = new int[] { 176, 177, 178, 179 }; +// TESTS_NUMBERS = new int[] { 180 }; // TESTS_RANGE = new int[] { 21, 50 }; } public static Test suite() { @@ -52,6 +52,7 @@ public class EnumTest extends AbstractComparableTest { options.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsVisibility, CompilerOptions.PRIVATE); options.put(CompilerOptions.OPTION_ReportMissingJavadocTags, CompilerOptions.ERROR); options.put(CompilerOptions.OPTION_ReportMissingJavadocTagsVisibility, CompilerOptions.PRIVATE); + options.put(CompilerOptions.OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation, CompilerOptions.DISABLED); if (this.reportMissingJavadocComments != null) options.put(CompilerOptions.OPTION_ReportMissingJavadocComments, this.reportMissingJavadocComments); return options; @@ -5035,17 +5036,17 @@ public void test145() { true /* flush output directory */, new String[] { /* test files */ "EnumA.java", - "public enum EnumA {\r\n" + - " B1,\r\n" + - " B2;\r\n" + - " public void foo(){}\r\n" + + "public enum EnumA {\n" + + " B1,\n" + + " B2;\n" + + " public void foo(){}\n" + "}", "ClassC.java", - "public class ClassC {\r\n" + - " void bar() {\r\n" + - " EnumA.B1.B1.foo();\r\n" + - " EnumA.B1.B2.foo();\r\n" + - " }\r\n" + + "public class ClassC {\n" + + " void bar() {\n" + + " EnumA.B1.B1.foo();\n" + + " EnumA.B1.B2.foo();\n" + + " }\n" + "}" }, // compiler options @@ -6472,4 +6473,55 @@ public void test179() { "", null); } +//https://bugs.eclipse.org/bugs/show_bug.cgi?id=289892 +public void test180() { + this.runConformTest( + new String[] { + "p/package-info.java", + "@p.Annot(state=p.MyEnum.BROKEN)\n" + + "package p;", + "p/Annot.java", + "package p;\n" + + "@Annot(state=MyEnum.KO)\n" + + "public @interface Annot {\n" + + " MyEnum state() default MyEnum.KO;\n" + + "}", + "p/MyEnum.java", + "package p;\n" + + "@Annot(state=MyEnum.KO)\n" + + "public enum MyEnum {\n" + + " WORKS, OK, KO, BROKEN, ;\n" + + "}", + "test180/package-info.java", + "@p.Annot(state=p.MyEnum.OK)\n" + + "package test180;", + "test180/Test.java", + "package test180;\n" + + "import p.MyEnum;\n" + + "import p.Annot;\n" + + "@Annot(state=MyEnum.OK)\n" + + "public class Test {}", + }, + "" + ); + Map options = getCompilerOptions(); + options.put(CompilerOptions.OPTION_Process_Annotations, CompilerOptions.ENABLED); + this.runConformTest( + false, + new String[] { + "X.java", + "import test180.Test;\n" + + "public class X {\n" + + " public static void main(String[] args) {\n" + + " System.out.println(Test.class);\n" + + " }\n" + + "}" + }, + null, + options, + "", + "class test180.Test", + "", + null); +} } diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java index d62ed4267f..fefabc8097 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java @@ -43,6 +43,12 @@ public class MethodVerifyTest extends AbstractComparableTest { return MethodVerifyTest.class; } + protected Map getCompilerOptions() { + Map compilerOptions = super.getCompilerOptions(); + compilerOptions.put(CompilerOptions.OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation, CompilerOptions.DISABLED); + return compilerOptions; + } + String mustOverrideMessage(String method, String type) { return "The method " + method + " of type " + type + (new CompilerOptions(getCompilerOptions()).sourceLevel < ClassFileConstants.JDK1_6 @@ -2035,14 +2041,22 @@ public class MethodVerifyTest extends AbstractComparableTest { new String[] { "X.java", "interface I { String foo(); }\n" + - "class A { public Object foo() { return null; } }" + - "public class X<T extends A&I> {}\n" + "class A { public Object foo() { return null; } }\n" + + "public class X<T extends A&I> {}\n" + + "interface J extends I { Object foo(); }\n" + + "class Y<T extends I&J> {}\n" + + "class Z<T extends J&I> {}" }, - "----------\n" + - "1. ERROR in X.java (at line 2)\r\n" + - " class A { public Object foo() { return null; } }public class X<T extends A&I> {}\r\n" + - " ^\n" + - "The return types are incompatible for the inherited methods I.foo(), A.foo()\n" + + "----------\n" + + "1. ERROR in X.java (at line 3)\n" + + " public class X<T extends A&I> {}\n" + + " ^\n" + + "The return types are incompatible for the inherited methods I.foo(), A.foo()\n" + + "----------\n" + + "2. ERROR in X.java (at line 4)\n" + + " interface J extends I { Object foo(); }\n" + + " ^^^^^^\n" + + "The return type is incompatible with I.foo()\n" + "----------\n" // foo() in A cannot implement foo() in I; attempting to use incompatible return type ); @@ -7987,27 +8001,23 @@ public void _test124() { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=150655 // variant public void test125() { - this.runNegativeTest( + this.runConformTest( new String[] { "X.java", "public class X {\n" + " public static <T> String choose(String one, String two) {\n" + - " return one + X.<String>choose(one, two);\n" + + " return one;\n" + " }\n" + " public static <T> T choose(T one, T two) {\n" + " return two;\n" + " }\n" + " public static void main(String args[]) {\n" + - " System.out.println(choose(\"a\", \"b\"));\n" + + " System.out.println(choose(\"a\", \"b\") + X.<String>choose(\"a\", \"b\"));\n" + " }\n" + - "}"}, - "----------\n" + - "1. ERROR in X.java (at line 3)\n" + - " return one + X.<String>choose(one, two);\n" + - " ^^^^^^\n" + - "The method choose(String, String) is ambiguous for the type X\n" + - "----------\n", - JavacTestOptions.EclipseHasABug.EclipseBug207935); + "}" + }, + "aa" + ); } // https://bugs.eclipse.org/bugs/show_bug.cgi?id=150655 // variant @@ -10621,4 +10631,57 @@ X.java:4: foo(Collection) is already defined in X 1 error */ } +//https://bugs.eclipse.org/bugs/show_bug.cgi?id=286228 +public void test201() { + this.runConformTest( + new String[] { + "A.java", + "interface I {}\n" + + "interface J<T1> { J<T1> get(); }\n" + + "interface K<T2 extends J<? extends I>> { T2 get(); }\n" + + "interface A<T3 extends K<T3> & J<? extends I>> extends J<I> {}\n" + + "interface B<T4 extends J<? extends I> & K<T4>> extends J<I> {}" + }, + "" + ); +} +//https://bugs.eclipse.org/bugs/show_bug.cgi?id=284280 +public void test202() { + this.runConformTest( + new String[] { + "SubClass.java", + "interface MyInterface <T0 extends Object> {\n" + + " String testMe(T0 t);\n" + + "}\n" + + "abstract class AbstractSuperClass<T1 extends AbstractSuperClass> implements MyInterface<T1> {\n" + + " public String testMe(T1 o) { return null; }\n" + + "}\n" + + "class SubClass extends AbstractSuperClass<SubClass> {\n" + + " @Override public String testMe(SubClass o) {\n" + + " return super.testMe(o);\n" + + " }\n" + + "}" + }, + "" + ); +} +//https://bugs.eclipse.org/bugs/show_bug.cgi?id=292240 +public void test203() { + this.runConformTest( + new String[] { + "X.java", + "interface I {}\n" + + "interface Y<T extends I> extends java.util.Comparator<T> {\n" + + " public int compare(T o1, T o2);\n" + + "}\n" + + "class X implements Y {\n" + + " public int compare(Object o1, Object o2) {\n" + + " return compare((I) o1, (I) o2);\n" + + " }\n" + + " public int compare(I o1, I o2) { return 0; }\n" + + "}" + }, + "" + ); +} } diff --git a/org.eclipse.jdt.core.tests.model/META-INF/MANIFEST.MF b/org.eclipse.jdt.core.tests.model/META-INF/MANIFEST.MF index b45887b930..b6740db541 100644 --- a/org.eclipse.jdt.core.tests.model/META-INF/MANIFEST.MF +++ b/org.eclipse.jdt.core.tests.model/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName -Bundle-SymbolicName: org.eclipse.jdt.core.tests.model; singleton:=true +Bundle-SymbolicName: org.eclipse.jdt.core.tests.model;singleton:=true Bundle-Version: 3.3.100.qualifier Bundle-ClassPath: jdtcoretestsmodel.jar Bundle-Vendor: %providerName @@ -16,7 +16,7 @@ Export-Package: org.eclipse.jdt.core.tests, Require-Bundle: org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)", org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)", org.eclipse.jdt.core;bundle-version="[3.3.0,4.0.0)", - org.junit, + org.junit;bundle-version="3.8.1", org.eclipse.test.performance;bundle-version="[3.1.0,4.0.0)", org.eclipse.jdt.core.tests.compiler;bundle-version="[3.3.0,4.0.0)", org.eclipse.jdt.core.tests.builder;bundle-version="[3.3.0,4.0.0)", diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsBugsTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsBugsTest.java index 41e42c6e26..fa6a3ad27a 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsBugsTest.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsBugsTest.java @@ -26,7 +26,9 @@ public class FormatterCommentsBugsTest extends FormatterCommentsTests { public static Test suite() { return buildModelTestSuite(FormatterCommentsBugsTest.class); } - +static { + //TESTS_NAMES = new String[] { "testBug287833b" } ; +} public FormatterCommentsBugsTest(String name) { super(name); } @@ -4848,4 +4850,88 @@ public void testBug280616() throws JavaModelException { ); } +/** + * @bug 287833: [formatter] Formatter removes the first character after the * in the <pre> tag + * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=287833" + */ +public void testBug287833a() { + String source = + "public class test1 {\n" + + "/**\n"+ + "* <pre>\n"+ + "*void foo() {\n"+ + "*}\n"+ + "* </pre>\n"+ + "*/\n"+ + "void foo() {\n"+ + "}\n"+ + "}\n"; + + formatSource(source, + "public class test1 {\n"+ + " /**\n"+ + " * <pre>\n"+ + " * void foo() {\n"+ + " * }\n"+ + " * </pre>\n"+ + " */\n"+ + " void foo() {\n"+ + " }\n" + + "}\n"); +} +public void testBug287833b() { + String source = + "public class test1 {\n" + + "/**\n"+ + "* <pre>\n"+ + "* void foo() {\n"+ + "*\r\n"+ + "* }\n"+ + "* </pre>\n"+ + "*/ \n"+ + "void foo() {\n"+ + "}\n"+ + "}\n"; + + formatSource(source, + "public class test1 {\n"+ + " /**\n"+ + " * <pre>\n"+ + " * void foo() {\n"+ + " * \r\n" + + " * }\n"+ + " * </pre>\n"+ + " */\n"+ + " void foo() {\n"+ + " }\n" + + "}\n"); +} +public void testBug287833c() { + String source = + "public class test1 {\n" + + "/**\n"+ + "* <pre>\n"+ + "* void foo() {\n"+ + "*\n"+ + "* }\n"+ + "* </pre>\n"+ + "*/ \n"+ + "void foo() {\n"+ + "}\n"+ + "}\n"; + + formatSource(source, + "public class test1 {\n"+ + " /**\n"+ + " * <pre>\n"+ + " * void foo() {\n"+ + " * \n" + + " * }\n"+ + " * </pre>\n"+ + " */\n"+ + " void foo() {\n"+ + " }\n" + + "}\n"); +} + } diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsMassiveTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsMassiveTests.java deleted file mode 100644 index 7a53abded6..0000000000 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsMassiveTests.java +++ /dev/null @@ -1,664 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jdt.core.tests.formatter; - -import java.io.File; -import java.io.FileFilter; -import java.io.IOException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.StringTokenizer; - -import junit.framework.AssertionFailedError; -import junit.framework.ComparisonFailure; -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.jdt.core.formatter.CodeFormatter; -import org.eclipse.jdt.core.tests.model.ModelTestsUtil; -import org.eclipse.jdt.core.tests.util.Util; -import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; -import org.eclipse.jdt.internal.formatter.DefaultCodeFormatter; -import org.eclipse.jdt.internal.formatter.DefaultCodeFormatterOptions; -import org.eclipse.text.edits.TextEdit; - -/** - * Comment formatter test suite for massive tests at a given location. - * <p> - * This test suite has only one generic test. The tests are dynamically defined by - * getting all compilation units located at the running workspace or at the - * directory specified using the "dir" system property and create - * one test per unit. - * </p><p> - * The test consists in first format the compilation unit using the new comments - * formatter (i.e. since bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=102780 - * has been fixed) and second eventually compare it with the output that the - * previous comments formatter would have done. - * </p><p> - * So, if no comparison is done, the test only insure that the new formatter does - * not blow up while formatting the files found at the given location and that the - * second formatting gives the same output than the first one. - * </p><p> - * TODO See how fix the remaining failing tests when comparing the - * formatting of JUnit 3.8.2 files: - * <ul> - * <li>0 error</li> - * <li>0 failure</li> - * <li>0 file has different line leading spaces than old formatter</li> - * <li>23 files have spaces differences with old formatter</li> - * </ul> - * </p><p> - * TODO Fix failures while running on workspaces without comparing. - * - * It is not possible to continue to compare the entire files after 2 formatting - * as the code formatter cannot handle properly following snippet: - * <pre> - * public class X02 { - * int field; // This is a long comment that should be split in multiple line comments in case the line comment formatting is enabled - * } - * </pre> - * Which is formatted as: - * <pre> - * public class X02 { - * int field; // This is a long comment that should be split in multiple line - * // comments in case the line comment formatting is enabled - * } - * </pre> - * But got a different output if formatted again: - * <pre> - * public class X02 { - * int field; // This is a long comment that should be split in multiple line - * // comments in case the line comment formatting is enabled - * } - * </pre> - * - * So, we're now obliged to ignore some whitespaces using the system property - * <code>ignoreWhitespaces</code> while running a launch config on this - * test suite on big workspaces as full source perfs 3.0 or ganymede. - * - * Here are the results when setting the system property to - * <code>linesLeading</code> (e.g. ignore white spaces at the beginning of the - * lines, including the star inside javadoc or block comments): - * <ul> - * <li>JUnit 3.8.2 workspace (71 units): - * <ul> - * <li>0 error</li> - * <li>0 failures</li> - * <li>0 failures due to old formatter</li> - * <li>8 files have different lines leading spaces</li> - * <li>0 files have different spaces</li> - * </ul></li> - * <li>Eclipse 3.0 performance workspace (9951 units): - * <ul> - * <li>0 error</li> - * <li>1 failures</li> - * <li>8 failures due to old formatter</li> - * <li>722 files have different lines leading spaces</li> - * <li>9 files have different spaces</li> - * </ul></li> - * <li>Eclipse 3.4 workspace (17890 units): - * <ul> - * <li>0 error</li> - * <li>17 failures</li> - * <li>21 failures due to old formatter</li> - * <li>1372 files have different lines leading spaces</li> - * <li>12 files have different spaces</li> - * </ul></li> - * <li>ganymede workspace (33190 units): - * <ul> - * <li>1 error</li> - * <li>21 failures due to different output while reformatting!</li> - * <li>21 failures due to old formatter</li> - * <li>1780 files have different line leading spaces when reformatting!</li> - * <li>20 files have different spaces when reformatting!</li> - * </ul></li> - * </ul> - */ -public class FormatterCommentsMassiveTests extends FormatterRegressionTests { - - final File file; - final IPath path; - boolean hasSpaceFailure; - private DefaultCodeFormatterOptions preferences; - private final static File INPUT_DIR = new File(System.getProperty("inputDir")); - private final static File OUTPUT_DIR; - private final static File WRITE_DIR; - private final static boolean COMPARE; - static { - String dir = System.getProperty("outputDir"); //$NON-NLS-1$ - File outputDir = null, writeDir = null; - boolean compare = true; - if (dir != null) { - StringTokenizer tokenizer = new StringTokenizer(dir, ","); - outputDir = new File(tokenizer.nextToken()); - boolean removed = false; - while (tokenizer.hasMoreTokens()) { - String arg = tokenizer.nextToken(); - if (arg.equals("clean")) { - removed = true; - if (outputDir.exists()) { - System.out.print("Removing all output files located in "+outputDir+"..."); - Util.delete(outputDir); - System.out.println("done"); - System.out.println("There won't be any comparison, but the formatted files will be written there instead."); - } else { - System.out.println(outputDir+" does not exist, hence no comparison will be done, but the formatted files will be written there instead."); - } - } - } - if (outputDir.exists()) { - System.out.println("Comparison done with output files located in "+outputDir); - } else { - writeDir = outputDir; - compare = false; - if (!removed) { - System.err.println("WARNING: The output directory "+outputDir+" does not exist..."); - System.err.println("=> NO comparison could be done!"); - } - try { - Thread.sleep(1000); - } catch (InterruptedException e) { - // skip - } - } - } - if (writeDir == null) { - String wdir = System.getProperty("writeDir"); //$NON-NLS-1$ - if (wdir != null) { - writeDir = new File(wdir); - if (writeDir.exists()) { - Util.delete(writeDir); - } - writeDir.mkdirs(); - System.out.println("The formatted files will be written in "+writeDir); - } - } - OUTPUT_DIR = outputDir; - WRITE_DIR = writeDir; - COMPARE = compare; - } - private final static int FORMAT_REPEAT = Integer.parseInt(System.getProperty("repeat", "2")); - private final static boolean NO_COMMENTS = System.getProperty("no_comments", "false").equals("true"); - - // Failures management - int failureIndex; - final static int UNEXPECTED_FAILURE = 0; - final static int NO_OUTPUT_FAILURE = 1; - final static int COMPARISON_FAILURE = 2; - final static int REFORMATTING_FAILURE = 3; - final static int REFORMATTING_LEADING_FAILURE = 5; - final static int REFORMATTING_WHITESPACES_FAILURE = 6; - final static int REFORMATTING_EXPECTED_FAILURE = 4; - class FormattingFailure { - String msg; - int kind; - List failures = new ArrayList(); - public FormattingFailure(int kind) { - this.kind = kind; - } - public FormattingFailure(int kind, String msg) { - this(kind); - this.msg = msg; - } - public String toString() { - switch (this.kind) { - case UNEXPECTED_FAILURE: - return "unexpected failure while formatting"; - case NO_OUTPUT_FAILURE: - return "no output while formatting"; - case COMPARISON_FAILURE: - return "different output while comparing with previous version"; - default: - return "different output while "+this.msg; - } - } - - } - final static FormattingFailure[] FAILURES = new FormattingFailure[REFORMATTING_WHITESPACES_FAILURE+1]; - { - for (int i=UNEXPECTED_FAILURE; i<=COMPARISON_FAILURE; i++) { - FAILURES[i] = new FormattingFailure(i); - } - FAILURES[REFORMATTING_FAILURE] = new FormattingFailure(REFORMATTING_FAILURE, "reformatting twice"); - FAILURES[REFORMATTING_LEADING_FAILURE] = new FormattingFailure(REFORMATTING_LEADING_FAILURE, "reformatting twice but only by leading whitespaces"); - FAILURES[REFORMATTING_WHITESPACES_FAILURE] = new FormattingFailure(REFORMATTING_WHITESPACES_FAILURE, "reformatting twice but only by whitespaces"); - FAILURES[REFORMATTING_EXPECTED_FAILURE] = new FormattingFailure(REFORMATTING_EXPECTED_FAILURE, "reformatting twice but was expected"); - } - private static final int MAX_FAILURES = Integer.parseInt(System.getProperty("maxFailures", "100")); // Max failures using string comparison - private static boolean ASSERT_EQUALS_STRINGS = MAX_FAILURES > 0; - private final static IPath[] EXPECTED_FAILURES = INPUT_DIR.getPath().indexOf("v34") < 0 - ? new IPath[] { - new Path("org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java"), - new Path("org/eclipse/jdt/internal/eval/CodeSnippetSingleNameReference.java"), - new Path("org/eclipse/jdt/internal/core/DeltaProcessor.java"), - new Path("org/eclipse/jdt/internal/core/JavaProject.java"), - new Path("org/eclipse/jdt/internal/core/search/indexing/IndexManager.java"), - new Path("org/eclipse/team/internal/ccvs/ui/AnnotateView.java"), - new Path("org/eclipse/team/internal/ccvs/ui/HistoryView.java"), - new Path("org/eclipse/team/internal/ccvs/ui/wizards/UpdateWizard.java"), - } - : new IPath[] { - // Eclipse - new Path("org/eclipse/equinox/internal/p2/director/NewDependencyExpander.java"), - new Path("org/eclipse/jdt/core/JavaCore.java"), - new Path("org/eclipse/jdt/internal/codeassist/CompletionEngine.java"), - new Path("org/eclipse/jdt/internal/codeassist/SelectionEngine.java"), - new Path("org/eclipse/jdt/internal/compiler/ast/Expression.java"), - new Path("org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java"), - new Path("org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java"), - new Path("org/eclipse/jdt/internal/eval/CodeSnippetSingleNameReference.java"), - new Path("org/eclipse/jdt/internal/compiler/lookup/WildcardBinding.java"), - new Path("org/eclipse/jdt/internal/compiler/batch/Main.java"), - new Path("org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding.java"), - new Path("org/eclipse/jdt/internal/core/CompilationUnit.java"), - new Path("org/eclipse/jdt/internal/core/ExternalJavaProject.java"), - new Path("org/eclipse/jdt/internal/core/hierarchy/HierarchyResolver.java"), - new Path("org/eclipse/jdt/internal/core/hierarchy/TypeHierarchy.java"), - new Path("org/eclipse/jdt/internal/core/search/indexing/IndexAllProject.java"), - new Path("org/eclipse/jdt/internal/core/search/JavaSearchScope.java"), - new Path("org/eclipse/jdt/internal/eval/EvaluationContext.java"), - new Path("org/eclipse/jdt/internal/ui/text/javadoc/JavadocContentAccess2.java"), - new Path("org/eclipse/jdt/internal/apt/pluggable/core/filer/IdeJavaSourceOutputStream.java"), - new Path("org/eclipse/team/internal/ccvs/ui/mappings/WorkspaceSubscriberContext.java"), - // Ganymede - new Path("com/ibm/icu/text/Collator.java"), - new Path("org/apache/lucene/analysis/ISOLatin1AccentFilter.java"), - }; - -public static Test suite() { - TestSuite suite = new Suite(FormatterCommentsMassiveTests.class.getName()); - try { - FileFilter filter = new FileFilter() { - public boolean accept(File pathname) { - return pathname.isDirectory() || pathname.getPath().endsWith(".java"); - } - }; - long start = System.currentTimeMillis(); - SimpleDateFormat format = new SimpleDateFormat(); - Date now = new Date(start); - System.out.println("Date of test: "+format.format(now)); - System.out.print("Get all Java files located in "+INPUT_DIR+"..."); - File[] allFiles = ModelTestsUtil.getAllFiles(INPUT_DIR, filter); - int length = allFiles.length; - System.out.println(length+" found in " + (System.currentTimeMillis() - start) + "ms"); - for (int i=0; i<length; i++) { - suite.addTest(new FormatterCommentsMassiveTests(allFiles[i])); - } - } catch (Exception e) { - // skip - } - return suite; -} - -public FormatterCommentsMassiveTests(File file) { - super("testCompare"); - this.file = file; - this.path = new Path(file.getPath().substring(INPUT_DIR.getPath().length()+1)); -} - -/* (non-Javadoc) - * @see junit.framework.TestCase#getName() - */ -public String getName() { - return super.getName()+" - " + this.path; -} - -/* (non-Javadoc) - * @see org.eclipse.jdt.core.tests.formatter.FormatterRegressionTests#setUpSuite() - */ -public void setUp() throws Exception { - super.setUp(); - this.hasSpaceFailure = false; - this.preferences = DefaultCodeFormatterOptions.getEclipseDefaultSettings(); - if (NO_COMMENTS) { - this.preferences.comment_format_javadoc_comment = false; - this.preferences.comment_format_block_comment = false; - this.preferences.comment_format_line_comment = false; - } -} - -/* (non-Javadoc) - * @see org.eclipse.jdt.core.tests.formatter.FormatterRegressionTests#setUpSuite() - */ -public void setUpSuite() throws Exception { - // skip standard model suite set up -} - -/* (non-Javadoc) - * @see org.eclipse.jdt.core.tests.formatter.FormatterRegressionTests#tearDown() - */ -public void tearDown() throws Exception { - // skip standard model tear down -} - -/* (non-Javadoc) - * @see org.eclipse.jdt.core.tests.formatter.FormatterRegressionTests#tearDownSuite() - */ -public void tearDownSuite() throws Exception { - // skip standard model suite tear down - System.out.println(); - int max = FAILURES.length; - for (int i=0; i<max; i++) { - List failures = FAILURES[i].failures; - int size = failures.size(); - if (size > 0) { - System.out.print(size); - System.out.print(" file"); - if (size == 1) { - System.out.print(" has "); - } else { - System.out.print("s have "); - } - System.out.print(FAILURES[i]); - System.out.println('!'); - } - } - System.out.println(); - for (int i=0; i<max; i++) { - List failures = FAILURES[i].failures; - int size = failures.size(); - if (size > 0) { - System.out.println("List of file(s) with "+FAILURES[i]+":"); - for (int j=0; j<size; j++) { - System.out.println(" - "+failures.get(j)); - } - } - } -} - -/* - * Asserts that the given actual source (usually coming from a file content) is equal to the expected one. - * Note that 'expected' is assumed to have the '\n' line separator. - * The line separators in 'actual' are converted to '\n' before the comparison. - */ -protected void assertSourceEquals(String message, String expected, String actual) { - if (expected == null) { - assertNull(message, actual); - return; - } - if (actual == null) { - assertEquals(message, expected, null); - return; - } - expected = Util.convertToIndependantLineDelimiter(expected); - actual = Util.convertToIndependantLineDelimiter(actual); - if (ASSERT_EQUALS_STRINGS) { - assertEquals(message, expected, actual); - } else { - assertTrue(message, actual.equals(expected)); - } -} - -DefaultCodeFormatter codeFormatter() { - DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(this.preferences, getDefaultCompilerOptions()); - return codeFormatter; -} - -void compareFormattedSource() throws IOException, Exception { - String source = new String(org.eclipse.jdt.internal.compiler.util.Util.getFileCharContent(this.file, null)); - try { - // Format the source - String actualResult = runFormatter(codeFormatter(), source, CodeFormatter.K_COMPILATION_UNIT | CodeFormatter.F_INCLUDE_COMMENTS, 0, 0, source.length(), null, true); - - // Look for output to compare with - File outputFile = new Path(OUTPUT_DIR.getPath()).append(this.path).toFile(); - if (COMPARE) { - String expectedResult = new String(org.eclipse.jdt.internal.compiler.util.Util.getFileCharContent(outputFile, null)); - try { - assertSourceEquals("Unexpected format output!", expectedResult, actualResult); - } - catch (ComparisonFailure cf) { - this.failureIndex = COMPARISON_FAILURE; - throw cf; - } - catch (AssertionFailedError afe) { - this.failureIndex = COMPARISON_FAILURE; - throw afe; - } - } - if (WRITE_DIR != null) { - File writtenFile = new Path(WRITE_DIR.getPath()).append(this.path).toFile(); - writtenFile.getParentFile().mkdirs(); - Util.writeToFile(actualResult, writtenFile.getAbsolutePath()); - } - } - catch (Exception e) { - System.err.println(e.getMessage()+" occurred in "+getName()); - throw e; - } -} - -private String counterToString(int count) { - int reminder = count%10; - StringBuffer buffer = new StringBuffer(); - buffer.append(count); - switch (reminder) { - case 1: - buffer.append("st"); - break; - case 2: - buffer.append("nd"); - break; - case 3: - buffer.append("rd"); - break; - default: - buffer.append("th"); - break; - } - return buffer.toString(); -} - -private Map getDefaultCompilerOptions() { - Map optionsMap = new HashMap(30); - optionsMap.put(CompilerOptions.OPTION_LocalVariableAttribute, CompilerOptions.DO_NOT_GENERATE); - optionsMap.put(CompilerOptions.OPTION_LineNumberAttribute, CompilerOptions.DO_NOT_GENERATE); - optionsMap.put(CompilerOptions.OPTION_SourceFileAttribute, CompilerOptions.DO_NOT_GENERATE); - optionsMap.put(CompilerOptions.OPTION_PreserveUnusedLocal, CompilerOptions.PRESERVE); - optionsMap.put(CompilerOptions.OPTION_DocCommentSupport, CompilerOptions.DISABLED); - optionsMap.put(CompilerOptions.OPTION_ReportMethodWithConstructorName, CompilerOptions.IGNORE); - optionsMap.put(CompilerOptions.OPTION_ReportOverridingPackageDefaultMethod, CompilerOptions.IGNORE); - optionsMap.put(CompilerOptions.OPTION_ReportOverridingMethodWithoutSuperInvocation, CompilerOptions.IGNORE); - optionsMap.put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.IGNORE); - optionsMap.put(CompilerOptions.OPTION_ReportDeprecationInDeprecatedCode, CompilerOptions.DISABLED); - optionsMap.put(CompilerOptions.OPTION_ReportDeprecationWhenOverridingDeprecatedMethod, CompilerOptions.DISABLED); - optionsMap.put(CompilerOptions.OPTION_ReportHiddenCatchBlock, CompilerOptions.IGNORE); - optionsMap.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.IGNORE); - optionsMap.put(CompilerOptions.OPTION_ReportUnusedParameter, CompilerOptions.IGNORE); - optionsMap.put(CompilerOptions.OPTION_ReportUnusedImport, CompilerOptions.IGNORE); - optionsMap.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, CompilerOptions.IGNORE); - optionsMap.put(CompilerOptions.OPTION_ReportNoEffectAssignment, CompilerOptions.IGNORE); - optionsMap.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.IGNORE); - optionsMap.put(CompilerOptions.OPTION_ReportNoImplicitStringConversion, CompilerOptions.IGNORE); - optionsMap.put(CompilerOptions.OPTION_ReportNonStaticAccessToStatic, CompilerOptions.IGNORE); - optionsMap.put(CompilerOptions.OPTION_ReportIndirectStaticAccess, CompilerOptions.IGNORE); - optionsMap.put(CompilerOptions.OPTION_ReportIncompatibleNonInheritedInterfaceMethod, CompilerOptions.IGNORE); - optionsMap.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE); - optionsMap.put(CompilerOptions.OPTION_ReportLocalVariableHiding, CompilerOptions.IGNORE); - optionsMap.put(CompilerOptions.OPTION_ReportFieldHiding, CompilerOptions.IGNORE); - optionsMap.put(CompilerOptions.OPTION_ReportPossibleAccidentalBooleanAssignment, CompilerOptions.IGNORE); - optionsMap.put(CompilerOptions.OPTION_ReportEmptyStatement, CompilerOptions.IGNORE); - optionsMap.put(CompilerOptions.OPTION_ReportAssertIdentifier, CompilerOptions.IGNORE); - optionsMap.put(CompilerOptions.OPTION_ReportEnumIdentifier, CompilerOptions.IGNORE); - optionsMap.put(CompilerOptions.OPTION_ReportUndocumentedEmptyBlock, CompilerOptions.IGNORE); - optionsMap.put(CompilerOptions.OPTION_ReportUnnecessaryTypeCheck, CompilerOptions.IGNORE); - optionsMap.put(CompilerOptions.OPTION_ReportInvalidJavadoc, CompilerOptions.IGNORE); - optionsMap.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsVisibility, CompilerOptions.PUBLIC); - optionsMap.put(CompilerOptions.OPTION_ReportInvalidJavadocTags, CompilerOptions.DISABLED); - optionsMap.put(CompilerOptions.OPTION_ReportMissingJavadocTagDescription, CompilerOptions.RETURN_TAG); - optionsMap.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsDeprecatedRef, CompilerOptions.DISABLED); - optionsMap.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsNotVisibleRef, CompilerOptions.DISABLED); - optionsMap.put(CompilerOptions.OPTION_ReportMissingJavadocTags, CompilerOptions.IGNORE); - optionsMap.put(CompilerOptions.OPTION_ReportMissingJavadocTagsVisibility, CompilerOptions.PUBLIC); - optionsMap.put(CompilerOptions.OPTION_ReportMissingJavadocTagsOverriding, CompilerOptions.DISABLED); - optionsMap.put(CompilerOptions.OPTION_ReportMissingJavadocComments, CompilerOptions.IGNORE); - optionsMap.put(CompilerOptions.OPTION_ReportMissingJavadocCommentsVisibility, CompilerOptions.IGNORE); - optionsMap.put(CompilerOptions.OPTION_ReportMissingJavadocCommentsOverriding, CompilerOptions.DISABLED); - optionsMap.put(CompilerOptions.OPTION_ReportFinallyBlockNotCompletingNormally, CompilerOptions.IGNORE); - optionsMap.put(CompilerOptions.OPTION_ReportUnusedDeclaredThrownException, CompilerOptions.IGNORE); - optionsMap.put(CompilerOptions.OPTION_ReportUnusedDeclaredThrownExceptionWhenOverriding, CompilerOptions.DISABLED); - optionsMap.put(CompilerOptions.OPTION_ReportUnqualifiedFieldAccess, CompilerOptions.IGNORE); - optionsMap.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_6); - optionsMap.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_6); - optionsMap.put(CompilerOptions.OPTION_TaskTags, ""); //$NON-NLS-1$ - optionsMap.put(CompilerOptions.OPTION_TaskPriorities, ""); //$NON-NLS-1$ - optionsMap.put(CompilerOptions.OPTION_TaskCaseSensitive, CompilerOptions.DISABLED); - optionsMap.put(CompilerOptions.OPTION_ReportUnusedParameterWhenImplementingAbstract, CompilerOptions.DISABLED); - optionsMap.put(CompilerOptions.OPTION_ReportUnusedParameterWhenOverridingConcrete, CompilerOptions.DISABLED); - optionsMap.put(CompilerOptions.OPTION_ReportSpecialParameterHidingField, CompilerOptions.DISABLED); - optionsMap.put(CompilerOptions.OPTION_MaxProblemPerUnit, String.valueOf(100)); - optionsMap.put(CompilerOptions.OPTION_InlineJsr, CompilerOptions.DISABLED); - optionsMap.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_6); - return optionsMap; -} - -private boolean isExpectedFailure() { - int length = EXPECTED_FAILURES.length; - for (int i=0; i<length; i++) { - IPath expectedFailure= EXPECTED_FAILURES[i]; - if (this.path.toString().indexOf(expectedFailure.toString()) >= 0) { - this.failureIndex = REFORMATTING_EXPECTED_FAILURE; - FAILURES[REFORMATTING_EXPECTED_FAILURE].failures.add(this.path); - return true; - } - } - return false; -} - -/* -private boolean runFormatterWithoutComments(CodeFormatter codeFormatter, String source, int kind, int indentationLevel, int offset, int length, String lineSeparator) { - DefaultCodeFormatterOptions preferencesWithoutComment = DefaultCodeFormatterOptions.getEclipseDefaultSettings(); - preferencesWithoutComment.comment_format_line_comment = false; - preferencesWithoutComment.comment_format_block_comment = false; - preferencesWithoutComment.comment_format_javadoc_comment = false; - DefaultCodeFormatter codeFormatterWithoutComment = new DefaultCodeFormatter(preferencesWithoutComment); - - TextEdit edit = codeFormatterWithoutComment.format(kind, source, offset, length, indentationLevel, lineSeparator);//$NON-NLS-1$ - if (edit == null) return false; - String initialResult = org.eclipse.jdt.internal.core.util.Util.editedString(source, edit); - - int count = 1; - String result = initialResult; - String previousResult = result; - while (count++ < FORMAT_REPEAT) { - edit = codeFormatterWithoutComment.format(kind, result, 0, result.length(), indentationLevel, lineSeparator);//$NON-NLS-1$ - if (edit == null) return false; - previousResult = result; - result = org.eclipse.jdt.internal.core.util.Util.editedString(result, edit); - } - return previousResult.equals(result); -} -*/ - -String runFormatter(CodeFormatter codeFormatter, String source, int kind, int indentationLevel, int offset, int length, String lineSeparator, boolean repeat) { - TextEdit edit = codeFormatter.format(kind, source, offset, length, indentationLevel, lineSeparator);//$NON-NLS-1$ - try { - assertNotNull("Formatted source should not be null!", edit); - } - catch (ComparisonFailure cf) { - this.failureIndex = NO_OUTPUT_FAILURE; - throw cf; - } - catch (AssertionFailedError afe) { - this.failureIndex = NO_OUTPUT_FAILURE; - throw afe; - } - String initialResult = org.eclipse.jdt.internal.core.util.Util.editedString(source, edit); - - int count = 1; - String result = initialResult; - String previousResult = result; - while (count++ < FORMAT_REPEAT) { - edit = codeFormatter.format(kind, result, 0, result.length(), indentationLevel, lineSeparator);//$NON-NLS-1$ - if (edit == null) return null; - previousResult = result; - result = org.eclipse.jdt.internal.core.util.Util.editedString(result, edit); - } - if (!previousResult.equals(result)) { - - // Try to compare without leading spaces - String trimmedExpected = ModelTestsUtil.trimLinesLeadingWhitespaces(previousResult); - String trimmedActual= ModelTestsUtil.trimLinesLeadingWhitespaces(result); - if (trimmedExpected.equals(trimmedActual)) { - this.failureIndex = REFORMATTING_LEADING_FAILURE; - FAILURES[REFORMATTING_LEADING_FAILURE].failures.add(this.path); - this.hasSpaceFailure = true; - return initialResult; - } - - // Try to compare without spaces at all - if (ModelTestsUtil.removeWhiteSpace(previousResult).equals(ModelTestsUtil.removeWhiteSpace(result))) { - this.failureIndex = REFORMATTING_WHITESPACES_FAILURE; - FAILURES[REFORMATTING_WHITESPACES_FAILURE].failures.add(this.path); - this.hasSpaceFailure = true; - return initialResult; - } - - /* - // Try to see if the formatting also fails without comments - if (!runFormatterWithoutComments(null, source, kind, indentationLevel, offset, length, lineSeparator)) { - return initialResult; - } - - // format without comments is OK => there's a problem with comment formatting - String counterString = counterToString(count-1); - assertSourceEquals(counterString+" formatting is different from first one!", previousResult, result); - */ - if (!isExpectedFailure()) { - String counterString = counterToString(count-1); - try { - assertSourceEquals(counterString+" formatting is different from first one!", previousResult, result); - } - catch (ComparisonFailure cf) { - this.failureIndex = REFORMATTING_FAILURE; - throw cf; - } - catch (AssertionFailedError afe) { - this.failureIndex = REFORMATTING_FAILURE; - throw afe; - } - } - } - return initialResult; -} - -public void testCompare() throws IOException, Exception { - try { - compareFormattedSource(); - } - catch (ComparisonFailure cf) { - if (this.failureIndex == -1) { - FAILURES[UNEXPECTED_FAILURE].failures.add(this.path); - } else { - FAILURES[this.failureIndex].failures.add(this.path); - } - throw cf; - } - catch (AssertionFailedError afe) { - if (this.failureIndex == -1) { - FAILURES[UNEXPECTED_FAILURE].failures.add(this.path); - } else { - FAILURES[this.failureIndex].failures.add(this.path); - } - throw afe; - } - catch (Exception ex) { - FAILURES[UNEXPECTED_FAILURE].failures.add(this.path); - throw ex; - } -} -} diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterMassiveRegressionTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterMassiveRegressionTests.java new file mode 100644 index 0000000000..341abce51b --- /dev/null +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterMassiveRegressionTests.java @@ -0,0 +1,1321 @@ +/******************************************************************************* + * Copyright (c) 2000, 2009 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.jdt.core.tests.formatter; + +import java.io.BufferedOutputStream; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileFilter; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.PrintStream; +import java.net.URL; +import java.text.NumberFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import junit.framework.AssertionFailedError; +import junit.framework.ComparisonFailure; +import junit.framework.Test; +import junit.framework.TestSuite; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.FileLocator; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.Path; +import org.eclipse.core.runtime.Platform; +import org.eclipse.jdt.core.compiler.CategorizedProblem; +import org.eclipse.jdt.core.formatter.CodeFormatter; +import org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants; +import org.eclipse.jdt.core.tests.model.ModelTestsUtil; +import org.eclipse.jdt.core.tests.util.Util; +import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; +import org.eclipse.jdt.internal.compiler.problem.DefaultProblem; +import org.eclipse.jdt.internal.core.util.CodeSnippetParsingUtil; +import org.eclipse.jdt.internal.formatter.DefaultCodeFormatter; +import org.eclipse.jdt.internal.formatter.DefaultCodeFormatterOptions; +import org.eclipse.text.edits.TextEdit; +import com.ibm.icu.util.StringTokenizer; + +/** + * Comment formatter test suite for massive tests at a given location. + * <p> + * This test suite has only one generic test. The tests are dynamically defined by + * getting all compilation units located at the running workspace or at the + * directory specified using the "dir" system property and create + * one test per unit. + * </p><p> + * The test consists in first format the compilation unit using the new comments + * formatter (i.e. since bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=102780 + * has been fixed) and second eventually compare it with the output that the + * previous comments formatter would have done. + * </p><p> + * So, if no comparison is done, the test only insure that the new formatter does + * not blow up while formatting the files found at the given location and that the + * second formatting gives the same output than the first one. + * </p><p> + * TODO See how fix the remaining failing tests when comparing the + * formatting of JUnit 3.8.2 files: + * <ul> + * <li>0 error</li> + * <li>0 failure</li> + * <li>0 file has different line leading spaces than old formatter</li> + * <li>23 files have spaces differences with old formatter</li> + * </ul> + * </p><p> + * TODO Fix failures while running on workspaces without comparing. + * + * It is not possible to continue to compare the entire files after 2 formatting + * as the code formatter cannot handle properly following snippet: + * <pre> + * public class X02 { + * int field; // This is a long comment that should be split in multiple line comments in case the line comment formatting is enabled + * } + * </pre> + * Which is formatted as: + * <pre> + * public class X02 { + * int field; // This is a long comment that should be split in multiple line + * // comments in case the line comment formatting is enabled + * } + * </pre> + * But got a different output if formatted again: + * <pre> + * public class X02 { + * int field; // This is a long comment that should be split in multiple line + * // comments in case the line comment formatting is enabled + * } + * </pre> + * + * So, we're now obliged to ignore some whitespaces using the system property + * <code>ignoreWhitespaces</code> while running a launch config on this + * test suite on big workspaces as full source perfs 3.0 or ganymede. + * + * Here are the results when setting the system property to + * <code>linesLeading</code> (e.g. ignore white spaces at the beginning of the + * lines, including the star inside javadoc or block comments): + * <ul> + * <li>JUnit 3.8.2 workspace (71 units): + * <ul> + * <li>0 error</li> + * <li>0 failures</li> + * <li>0 failures due to old formatter</li> + * <li>8 files have different lines leading spaces</li> + * <li>0 files have different spaces</li> + * </ul> + * </li> + * <li>Eclipse 3.0 performance workspace (9951 units): + * <ul> + * <li>1 file has no output while formatting!</li> + * <li>8 files have different output while reformatting twice but was expected!</li> + * <li>714 files have different output while reformatting twice but only by leading whitespaces!</li> + * <li>7 files have different output while reformatting twice but only by whitespaces!</li> + * </ul> + * </li> + * <li>Galileo workspace (41881 units): + * <ul> + * <li>3 files have no output while formatting!</li> + * <li>47 files have different output while reformatting twice!</li> + * <li>2 files have different output while reformatting twice but was expected!</li> + * <li>2384 files have different output while reformatting twice but only by leading whitespaces!</li> + * <li>14 files have different output while reformatting twice but only by whitespaces!</li> + * </ul> + * </li> + * <li>JDKs workspace (29069 units): + * <ul> + * <li>4 files have unexpected failure while formatting!</li> + * <li>1 file has no output while formatting!</li> + * <li>115 files have different output while reformatting twice!</li> + * <li>1148 files have different output while reformatting twice but only by leading whitespaces!</li> + * <li>43 files have different output while reformatting twice but only by whitespaces!</li> + * </ul> + * </li> + * </ul> + */ +public class FormatterMassiveRegressionTests extends FormatterRegressionTests { + + final File file; + final IPath path; + private DefaultCodeFormatterOptions preferences; + + // Directories + private final static File INPUT_DIR = new File(System.getProperty("inputDir")); + private static File OUTPUT_DIR; // use static to minimize data consumption + private static File WRITE_DIR; + + // Files + final static String FILES_FILTER = System.getProperty("filesFilter"); + final static int FILES_FILTER_KIND; + static { + int kind = 0; // No filter + if (FILES_FILTER != null) { + int length = FILES_FILTER.length(); + int idxQM = FILES_FILTER.indexOf('?'); + int idxS = FILES_FILTER.indexOf('*'); + if (idxQM >= 0 && idxS >= 0) { + kind = 4; // Pure pattern match + } else if (idxQM >= 0) { + while (idxQM < length && FILES_FILTER.charAt(idxQM) == '?') { + idxQM++; + } + if (idxQM == length) { + kind = 3; // Starts with + same length + } else { + kind = 4; // Pure pattern match + } + } else if (idxS >= 0) { + while (idxS < length && FILES_FILTER.charAt(idxQM) == '*') { + idxS++; + } + if (idxS == length) { + kind = 2; // Starts with + } else { + kind = 4; // Pure pattern match + } + } else { + kind = 1; // Equals + } + } + FILES_FILTER_KIND = kind; + } + + // Log + private static File LOG_FILE; + private static PrintStream LOG_STREAM; + + // Comparison + private static boolean CLEAN = false; + private static boolean CAN_COMPARE = true; + private final boolean canCompare; + private final int testIndex; + + // Cleaning + private final File[] inputFiles; + private static int MAX_FILES, MAX_DIGITS; + + // Formatting behavior + final static int FORMAT_REPEAT = Integer.parseInt(System.getProperty("repeat", "2")); + private final static boolean NO_COMMENTS = System.getProperty("no_comments", "false").equals("true"); + private static String JOIN_LINES = System.getProperty("join_lines", null); + private static String BRACES = System.getProperty("braces", null); + + // Time measuring + static class TimeMeasuring { + long[] formatting = new long[FORMAT_REPEAT]; + int [] occurences = new int[FORMAT_REPEAT]; + int [] null_output = new int[FORMAT_REPEAT]; + } + private static TimeMeasuring TIME_MEASURES = new TimeMeasuring(); + private static final int ONE_MINUTE = 60000; + private static final long ONE_HOUR = 3600000L; + + // Failures management + int failureIndex; + final static int UNEXPECTED_FAILURE = 0; + final static int NO_OUTPUT_FAILURE = 1; + final static int COMPILATION_ERRORS_FAILURE = 2; + final static int COMPARISON_FAILURE = 3; + final static int REFORMATTING_FAILURE = 4; + final static int REFORMATTING_EXPECTED_FAILURE = 5; + final static int REFORMATTING_LEADING_FAILURE = 6; + final static int REFORMATTING_WHITESPACES_FAILURE = 7; + static class FormattingFailure { + String msg; + int kind; + List failures = new ArrayList(); + public FormattingFailure(int kind) { + this.kind = kind; + } + public FormattingFailure(int kind, String msg) { + this(kind); + this.msg = msg; + } + int size() { + return this.failures.size(); + } + public String toString() { + switch (this.kind) { + case UNEXPECTED_FAILURE: + return "unexpected failure while formatting"; + case NO_OUTPUT_FAILURE: + return "no output while formatting"; + case COMPILATION_ERRORS_FAILURE: + return "compilation errors which prevent the formatter to proceed"; + case COMPARISON_FAILURE: + return "different output while comparing with previous version"; + default: + return "different output while "+this.msg; + } + } + + } + static FormattingFailure[] FAILURES; + private static final int MAX_FAILURES = Integer.parseInt(System.getProperty("maxFailures", "100")); // Max failures using string comparison + private static boolean ASSERT_EQUALS_STRINGS = MAX_FAILURES > 0; + private static String ECLIPSE_VERSION; + private static String ECLIPSE_MILESTONE; + private static String JDT_CORE_VERSION; + private static String PATCH_BUG, PATCH_VERSION; + private static boolean JDT_CORE_HEAD; + private final static IPath[] EXPECTED_FAILURES = INPUT_DIR.getPath().indexOf("v34") < 0 + ? new IPath[] { + new Path("org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java"), + new Path("org/eclipse/jdt/internal/eval/CodeSnippetSingleNameReference.java"), + new Path("org/eclipse/jdt/internal/core/DeltaProcessor.java"), + new Path("org/eclipse/jdt/internal/core/JavaProject.java"), + new Path("org/eclipse/jdt/internal/core/search/indexing/IndexManager.java"), + new Path("org/eclipse/team/internal/ccvs/ui/AnnotateView.java"), + new Path("org/eclipse/team/internal/ccvs/ui/HistoryView.java"), + new Path("org/eclipse/team/internal/ccvs/ui/wizards/UpdateWizard.java"), + } + : new IPath[] { + // Eclipse + new Path("org/eclipse/equinox/internal/p2/director/NewDependencyExpander.java"), + new Path("org/eclipse/jdt/core/JavaCore.java"), + new Path("org/eclipse/jdt/internal/codeassist/CompletionEngine.java"), + new Path("org/eclipse/jdt/internal/codeassist/SelectionEngine.java"), + new Path("org/eclipse/jdt/internal/compiler/ast/Expression.java"), + new Path("org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java"), + new Path("org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java"), + new Path("org/eclipse/jdt/internal/eval/CodeSnippetSingleNameReference.java"), + new Path("org/eclipse/jdt/internal/compiler/lookup/WildcardBinding.java"), + new Path("org/eclipse/jdt/internal/compiler/batch/Main.java"), + new Path("org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding.java"), + new Path("org/eclipse/jdt/internal/core/CompilationUnit.java"), + new Path("org/eclipse/jdt/internal/core/ExternalJavaProject.java"), + new Path("org/eclipse/jdt/internal/core/hierarchy/HierarchyResolver.java"), + new Path("org/eclipse/jdt/internal/core/hierarchy/TypeHierarchy.java"), + new Path("org/eclipse/jdt/internal/core/search/indexing/IndexAllProject.java"), + new Path("org/eclipse/jdt/internal/core/search/JavaSearchScope.java"), + new Path("org/eclipse/jdt/internal/eval/EvaluationContext.java"), + new Path("org/eclipse/jdt/internal/ui/text/javadoc/JavadocContentAccess2.java"), + new Path("org/eclipse/jdt/internal/apt/pluggable/core/filer/IdeJavaSourceOutputStream.java"), + new Path("org/eclipse/team/internal/ccvs/ui/mappings/WorkspaceSubscriberContext.java"), + // Ganymede + new Path("com/ibm/icu/text/Collator.java"), + new Path("org/apache/lucene/analysis/ISOLatin1AccentFilter.java"), + }; + +public static Test suite() { + + TestSuite suite = new Suite(FormatterMassiveRegressionTests.class.getName()); + try { + // Init version + StringBuffer buffer = new StringBuffer(); + initVersion(buffer); + + // Init profiles + initProfiles(buffer); + + // Log date of test + long start = System.currentTimeMillis(); + SimpleDateFormat format = new SimpleDateFormat(); + Date now = new Date(start); + buffer.append("Test date : "); + buffer.append(format.format(now)); + buffer.append(LINE_SEPARATOR); + + // Get input dir + buffer.append("Input dir : "); + buffer.append(INPUT_DIR); + + // Output to console to show startup + String firstBuffer = buffer.toString(); + System.out.println(firstBuffer); + buffer.setLength(0); + + // Get files from input dir + FileFilter filter = new FileFilter() { + public boolean accept(File pathname) { + String path = pathname.getPath(); + if (pathname.isDirectory()) { + String dirName = path.substring(path.lastIndexOf(File.separatorChar)+1); + return !dirName.equals("bin"); + } + if (path.endsWith(".java")) { + if (FILES_FILTER_KIND > 0) { + String fileName = path.substring(path.lastIndexOf(File.separatorChar)+1); + switch (FILES_FILTER_KIND) { + case 1: // Equals + return fileName.equals(FILES_FILTER); + case 2: // Starts with + return fileName.startsWith(FILES_FILTER); + case 3: // Starts with + same length + return fileName.startsWith(FILES_FILTER) && fileName.length() == FILES_FILTER.length(); + case 4: // Pattern + return fileName.matches(FILES_FILTER); + } + } else { + return true; + } + } + return false; + } + }; + File[] allFiles = ModelTestsUtil.getAllFiles(INPUT_DIR, filter); + MAX_FILES = allFiles.length; + MAX_DIGITS = (int) (Math.log(MAX_FILES)/Math.log(10)); + buffer.append(" "); + buffer.append(MAX_FILES); + buffer.append(" java files found"); + buffer.append(LINE_SEPARATOR); + + // Init directories + initDirectories(buffer); + buffer.append("Compare vs: "); + if (CAN_COMPARE) { + if (CLEAN) { + buffer.append(JDT_CORE_VERSION); + } else { + File versionFile = new File(OUTPUT_DIR, "version.txt"); + if (versionFile.exists()) { + buffer.append(Util.fileContent(versionFile.getAbsolutePath())); + } else { + buffer.append("???"); + } + } + } else { + buffer.append("none"); + } + + // Write logs + System.out.println(buffer.toString()); + if (LOG_STREAM != null) { + LOG_STREAM.println(firstBuffer); + LOG_STREAM.println(buffer.toString()); + LOG_STREAM.flush(); + } + + // Add tests to clean the output directory and rebuild the references + if (CLEAN) { + suite.addTest(new FormatterMassiveRegressionTests()); + suite.addTest(new FormatterMassiveRegressionTests(allFiles)); + } + + // Add one test per found file + for (int i=0; i<MAX_FILES; i++) { + suite.addTest(new FormatterMassiveRegressionTests(allFiles[i], i, CAN_COMPARE)); + } + } catch (Exception e) { + // skip + } + return suite; +} + +private static void initProfiles(StringBuffer buffer) { + boolean profile = NO_COMMENTS; + if (JOIN_LINES != null) { + if (!JOIN_LINES.equals("never") && + !JOIN_LINES.equals("only_comments") && + !JOIN_LINES.equals("only_code")) { + JOIN_LINES = null; + } else { + profile = true; + } + } + if (BRACES != null) { + if (!BRACES.equals(DefaultCodeFormatterConstants.NEXT_LINE) && + !BRACES.equals(DefaultCodeFormatterConstants.NEXT_LINE_ON_WRAP) && + !BRACES.equals(DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED)) { + BRACES = null; + } else { + profile = true; + } + } + if (profile) { + buffer.append("Profiles : "); + String separator = ""; + if (JOIN_LINES != null) { + buffer.append("join_lines="+JOIN_LINES); + separator = ", "; + } + if (NO_COMMENTS) { + buffer.append(separator+"no_comments"); + separator = ", "; + } + if (BRACES != null) { + buffer.append(separator+"braces="+BRACES); + } + buffer.append(LINE_SEPARATOR); + } +} + +private static void initDirectories(StringBuffer buffer) { + + // Verify input directory + if (!INPUT_DIR.exists() && !INPUT_DIR.isDirectory()) { + throw new RuntimeException(INPUT_DIR+" does not exist or is not a directory!"); + } + + // Get output dir and clean it if specified + String dir = System.getProperty("outputDir"); //$NON-NLS-1$ + if (dir != null) { + int idx = dir.indexOf(','); + if (idx < 0) { + setOutputDir(dir, buffer); + } else { + setOutputDir(dir.substring(0, idx), buffer); + if (dir.substring(idx+1).equals("clean")) { + CLEAN = true; + } + } + if (CLEAN) { + if (PATCH_BUG != null || JDT_CORE_HEAD) { + throw new RuntimeException("Reference can only be updated using a version (i.e. with a closed buildnotes_jdt-core.html)!"); + } + } else if (!OUTPUT_DIR.exists()) { + System.err.println(" WARNING: The output directory "+OUTPUT_DIR+" does not exist..."); + System.err.println(" => NO comparison could be done!"); + CAN_COMPARE = false; + } + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + // skip + } + } + + // Get log dir + try { + setLogDir(buffer); + } catch (CoreException e) { + e.printStackTrace(); + } + + // Get write dir + String wdir = System.getProperty("writeDir"); //$NON-NLS-1$ + if (wdir != null) { + WRITE_DIR = new File(wdir); + if (WRITE_DIR.exists()) { + Util.delete(WRITE_DIR); + } + WRITE_DIR.mkdirs(); + buffer.append("Write dir : "); + buffer.append(WRITE_DIR); + buffer.append(LINE_SEPARATOR); + } +} + +private static void setLogDir(StringBuffer buffer) throws CoreException { + + // Compute log dir +// IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); +// IProject project = root.getProject("Bugs"); +// IFolder rootFolder = project.getFolder("Formatter"); + File logDir = new File(System.getProperty("logDir")); + if (!logDir.exists()) { + return; + } + + // Compute log sub-directories depending on profiles + logDir = new File(logDir, ECLIPSE_VERSION); +// IFolder folder = rootFolder.getFolder(ECLIPSE_VERSION); +// if (!folder.exists()) folder.create(true, true, null); + if (PATCH_BUG != null) { + logDir = new File(logDir, "tests"); + logDir = new File(logDir, PATCH_BUG); + logDir = new File(logDir, PATCH_VERSION); +// folder = folder.getFolder("tests"); +// if (!folder.exists()) folder.create(true, true, null); +// folder = folder.getFolder(PATCH_BUG); +// if (!folder.exists()) folder.create(true, true, null); +// folder = folder.getFolder(PATCH_VERSION); +// if (!folder.exists()) folder.create(true, true, null); + } else if (JDT_CORE_HEAD) { + logDir = new File(logDir, "HEAD"); +// folder = folder.getFolder("HEAD"); +// if (!folder.exists()) folder.create(true, true, null); + } else { + logDir = new File(logDir, ECLIPSE_MILESTONE); + logDir = new File(logDir, JDT_CORE_VERSION); +// folder = folder.getFolder(ECLIPSE_MILESTONE); +// if (!folder.exists()) folder.create(true, true, null); +// folder = folder.getFolder(JDT_CORE_VERSION); +// if (!folder.exists()) folder.create(true, true, null); + } + if (NO_COMMENTS || BRACES != null || JOIN_LINES != null) { + logDir = new File(logDir, "profiles"); +// folder = folder.getFolder("profiles"); +// if (!folder.exists()) folder.create(true, true, null); + if (JOIN_LINES != null) { + logDir = new File(new File(logDir, "join_lines"), JOIN_LINES); +// folder = folder.getFolder("join_lines"); +// if (!folder.exists()) folder.create(true, true, null); +// folder = folder.getFolder(JOIN_LINES); +// if (!folder.exists()) folder.create(true, true, null); + } + if (NO_COMMENTS) { + logDir = new File(logDir, "no_comments"); +// folder = folder.getFolder("no_comments"); +// if (!folder.exists()) folder.create(true, true, null); + } + if (BRACES != null) { + logDir = new File(new File(logDir, "braces"), BRACES); +// folder = folder.getFolder("braces"); +// if (!folder.exists()) folder.create(true, true, null); +// folder = folder.getFolder(BRACES); +// if (!folder.exists()) folder.create(true, true, null); + } + } + + if (FILES_FILTER_KIND > 0) { + logDir = new File(new File(logDir, "filter"), FILES_FILTER.replace('?', '_').replace('*', '%')); + } + + // Create log stream + logDir.mkdirs(); + String filePrefix = INPUT_DIR.getName().replaceAll("\\.", ""); + String logFileName = filePrefix+".txt"; + LOG_FILE = new File(logDir, logFileName); + if (LOG_FILE.exists()) { + File saveDir = new File(logDir, "save"); + saveDir.mkdir(); + int i=0; + while (true) { + String newFileName = filePrefix+"_"; + if (i<10) newFileName += "0"; + newFileName += i+".txt"; + File renamedFile = new File(saveDir, newFileName); + if (LOG_FILE.renameTo(renamedFile)) break; + i++; + } + } +// LOG_RESOURCE = folder.getFile(logFileName); + buffer.append("Log file : "); + buffer.append(LOG_FILE); +// buffer.append(LOG_RESOURCE.getFullPath()); + buffer.append(LINE_SEPARATOR); + try { + LOG_STREAM = new PrintStream(new BufferedOutputStream(new FileOutputStream(LOG_FILE))); + LOG_STREAM.flush(); + } + catch (FileNotFoundException fnfe) { + System.err.println("Can't create log file"+LOG_FILE); //$NON-NLS-1$ + } +// if (LOG_RESOURCE.exists()) { +// Util.delete(LOG_RESOURCE); +// } +// LOG_BUFFER = new StringBuffer(); +} +private static void setOutputDir(String dir, StringBuffer buffer) { + + // Find the root of the output directory + OUTPUT_DIR = new File(dir); + if (OUTPUT_DIR.getName().equals(INPUT_DIR.getName())) { + OUTPUT_DIR = OUTPUT_DIR.getParentFile(); + } + if (OUTPUT_DIR.getName().equals(ECLIPSE_VERSION)) { + OUTPUT_DIR = OUTPUT_DIR.getParentFile(); + } + + // Compute output sub-directories depending on profiles + if (NO_COMMENTS || BRACES != null || JOIN_LINES != null) { + OUTPUT_DIR = new File(OUTPUT_DIR, "profiles"); + if (JOIN_LINES != null) { + OUTPUT_DIR = new File(new File(OUTPUT_DIR, "join_lines"), JOIN_LINES); + } + if (NO_COMMENTS) { + OUTPUT_DIR = new File(OUTPUT_DIR, "no_comments"); + } + if (BRACES != null) { + OUTPUT_DIR = new File(new File(OUTPUT_DIR, "braces"), BRACES); + } + } + + // Compute the final output dir + OUTPUT_DIR = new File(new File(OUTPUT_DIR, ECLIPSE_VERSION), INPUT_DIR.getName()); + buffer.append("Output dir: "); + buffer.append(OUTPUT_DIR); + buffer.append(LINE_SEPARATOR); +} + +private static void initFailures() { + FAILURES = new FormattingFailure[REFORMATTING_WHITESPACES_FAILURE+1]; + for (int i=UNEXPECTED_FAILURE; i<=COMPARISON_FAILURE; i++) { + FAILURES[i] = new FormattingFailure(i); + } + FAILURES[REFORMATTING_FAILURE] = new FormattingFailure(REFORMATTING_FAILURE, "reformatting twice"); + FAILURES[REFORMATTING_LEADING_FAILURE] = new FormattingFailure(REFORMATTING_LEADING_FAILURE, "reformatting twice but only by leading whitespaces"); + FAILURES[REFORMATTING_WHITESPACES_FAILURE] = new FormattingFailure(REFORMATTING_WHITESPACES_FAILURE, "reformatting twice but only by whitespaces"); + FAILURES[REFORMATTING_EXPECTED_FAILURE] = new FormattingFailure(REFORMATTING_EXPECTED_FAILURE, "reformatting twice but was expected"); +} + +/* + * Read JDT/Core build notes file to see what version is currently running. + */ +private static void initVersion(StringBuffer buffer) { + BufferedReader buildnotesReader; + try { + URL platformURL = Platform.getBundle("org.eclipse.jdt.core").getEntry("/"); + String path = new File(FileLocator.toFileURL(platformURL).getFile(), "buildnotes_jdt-core.html").getAbsolutePath(); + buildnotesReader = new BufferedReader(new InputStreamReader(new FileInputStream(path))); + } catch (IOException ioe) { + ioe.printStackTrace(); + return; + } + String line; + String patch_line = null; + JDT_CORE_HEAD = true; + try { + while ((line = buildnotesReader.readLine()) != null) { + if (line.startsWith("<a name=\"")) { + boolean first = JDT_CORE_VERSION == null; + JDT_CORE_VERSION = line.substring(line.indexOf('"')+1, line.lastIndexOf('"')); + if (!first) break; + } else if (line.startsWith("Eclipse SDK ")) { + StringTokenizer tokenizer = new StringTokenizer(line); + tokenizer.nextToken(); // 'Eclipse' + tokenizer.nextToken(); // 'SDK' + String milestone = tokenizer.nextToken(); + ECLIPSE_VERSION = "v"+milestone.charAt(0)+milestone.charAt(2); + ECLIPSE_MILESTONE = milestone.substring(3); + tokenizer.nextToken(); // '-' + JDT_CORE_HEAD = tokenizer.nextToken().equals("%date%"); + } else if (line.startsWith("<h2>What's new")) { + line = buildnotesReader.readLine(); + if (line.startsWith("Patch")) { + patch_line = line; + StringTokenizer tokenizer = new StringTokenizer(line); + tokenizer.nextToken(); // 'Patch' + PATCH_VERSION = tokenizer.nextToken(); + while (tokenizer.hasMoreTokens()) { + PATCH_BUG = tokenizer.nextToken(); + } + try { + Integer.parseInt(PATCH_BUG); + } + catch (NumberFormatException nfe) { + System.err.println("Invalid patch bug number noticed in JDT/Core buildnotes: "+PATCH_BUG); + } + } + if (!JDT_CORE_HEAD) break; + } + } + } catch (Exception e) { + try { + buildnotesReader.close(); + } catch (IOException ioe) { + ioe.printStackTrace(); + } + } + + // Log version info + buffer.append("Version : "); + if (PATCH_BUG != null) { + buffer.append('\''); + buffer.append(patch_line); + buffer.append("' applied on "); + } + if (JDT_CORE_HEAD) { + buffer.append("HEAD on top of "); + } + buffer.append(JDT_CORE_VERSION); + buffer.append(LINE_SEPARATOR); +} + +/* + * Constructor used to clean the output directory. + */ +public FormatterMassiveRegressionTests() { + super("testDeleteOutputDir"); + this.canCompare = false; + this.file = null; + this.inputFiles = null; + this.testIndex = -1; + this.path = new Path(OUTPUT_DIR.getPath()); +} + +/* + * Constructor used to dump references in the output directory. + */ +public FormatterMassiveRegressionTests(File[] files) { + super("testMakeReferences"); + assertNotNull("This test needs some files to proceed!", files); + this.canCompare = false; + this.file = null; + this.inputFiles = files; + this.testIndex = -1; + this.path = new Path(OUTPUT_DIR.getPath()); +} + +/* + * Contructor used to compare outputs. + */ +public FormatterMassiveRegressionTests(File file, int index, boolean compare) { + super("testCompare"); + this.canCompare = compare; + this.file = file; + this.inputFiles = null; + this.testIndex = index; + this.path = new Path(file.getPath().substring(INPUT_DIR.getPath().length()+1)); +} + +/* (non-Javadoc) + * @see junit.framework.TestCase#getName() + */ +public String getName() { + StringBuffer name = new StringBuffer(super.getName()); + if (this.testIndex >= 0) { + int n = this.testIndex == 0 ? 0 : (int) (Math.log(this.testIndex)/Math.log(10)); + for (int i=n; i<MAX_DIGITS; i++) { + name.append('0'); + } + name.append(this.testIndex); + } + name.append(" - "); + name.append(this.path); + return name.toString(); +} + +/* (non-Javadoc) + * @see org.eclipse.jdt.core.tests.formatter.FormatterRegressionTests#setUpSuite() + */ +public void setUp() throws Exception { + super.setUp(); + this.preferences = DefaultCodeFormatterOptions.getEclipseDefaultSettings(); + if (NO_COMMENTS) { + this.preferences.comment_format_javadoc_comment = false; + this.preferences.comment_format_block_comment = false; + this.preferences.comment_format_line_comment = false; + } + if (JOIN_LINES != null) { + if (!JOIN_LINES.equals("only_comments")) { + this.preferences.join_lines_in_comments = false; + } + if (!JOIN_LINES.equals("only_code")) { + this.preferences.join_wrapped_lines = false; + } + } + if (BRACES != null) { + this.preferences.brace_position_for_annotation_type_declaration = BRACES; + this.preferences.brace_position_for_anonymous_type_declaration = BRACES; + this.preferences.brace_position_for_array_initializer = BRACES; + this.preferences.brace_position_for_block = BRACES; + this.preferences.brace_position_for_block_in_case = BRACES; + this.preferences.brace_position_for_constructor_declaration = BRACES; + this.preferences.brace_position_for_enum_constant = BRACES; + this.preferences.brace_position_for_enum_declaration = BRACES; + this.preferences.brace_position_for_method_declaration = BRACES; + this.preferences.brace_position_for_switch = BRACES; + this.preferences.brace_position_for_type_declaration = BRACES; + } +} + +/* (non-Javadoc) + * @see org.eclipse.jdt.core.tests.formatter.FormatterRegressionTests#setUpSuite() + */ +public void setUpSuite() throws Exception { + // skip standard model suite set up +} + +/* (non-Javadoc) + * @see org.eclipse.jdt.core.tests.formatter.FormatterRegressionTests#tearDown() + */ +public void tearDown() throws Exception { + // verify whether the max failures has been reached or not + if (ASSERT_EQUALS_STRINGS && FAILURES != null) { + ASSERT_EQUALS_STRINGS = FAILURES[COMPARISON_FAILURE].size() < MAX_FAILURES; + } +} + +/* (non-Javadoc) + * @see org.eclipse.jdt.core.tests.formatter.FormatterRegressionTests#tearDownSuite() + */ +public void tearDownSuite() throws Exception { + + // Display time measures + StringBuffer buffer1 = new StringBuffer(); + buffer1.append("Time measures:"); + if (CLEAN) { + buffer1.append(" cannot be done as the directory was cleaned!"); + buffer1.append(LINE_SEPARATOR); + } else { + buffer1.append(LINE_SEPARATOR); + for (int i=0; i<FORMAT_REPEAT; i++) { + buffer1.append(" - "+counterToString(i+1)).append(" format:").append(LINE_SEPARATOR); + buffer1.append(" + elapsed = "+timeString(TIME_MEASURES.formatting[i])).append(LINE_SEPARATOR); + buffer1.append(" + occurrences = "+TIME_MEASURES.occurences[i]).append(LINE_SEPARATOR); + buffer1.append(" + null output = "+TIME_MEASURES.null_output[i]).append(LINE_SEPARATOR); + } + } + buffer1.append(LINE_SEPARATOR); + + // Display stored failures + int max = FAILURES.length; + for (int i=0; i<max; i++) { + List failures = FAILURES[i].failures; + int size = failures.size(); + if (size > 0) { + buffer1.append(size); + buffer1.append(" file"); + if (size == 1) { + buffer1.append(" has "); + } else { + buffer1.append("s have "); + } + buffer1.append(FAILURES[i]); + buffer1.append('!'); + buffer1.append(LINE_SEPARATOR); + } + } + buffer1.append(LINE_SEPARATOR); + StringBuffer buffer2 = new StringBuffer(LINE_SEPARATOR); + for (int i=0; i<max; i++) { + List failures = FAILURES[i].failures; + int size = failures.size(); + if (size > 0) { + buffer2.append("List of file(s) with "); + buffer2.append(FAILURES[i]); + buffer2.append(':'); + buffer2.append(LINE_SEPARATOR); + for (int j=0; j<size; j++) { + buffer2.append(" - "); + buffer2.append(failures.get(j)); + buffer2.append(LINE_SEPARATOR); + } + } + } + + // Log failures + System.out.println(buffer1.toString()); + if (LOG_STREAM == null) { + System.out.println(buffer2.toString()); + } else { + LOG_STREAM.print(buffer1.toString()); + LOG_STREAM.print(buffer2.toString()); + LOG_STREAM.close(); + } +// LOG_BUFFER.append(buffer1.toString()); +// LOG_BUFFER.append(buffer2.toString()); +// InputStream stream= new InputStream() { +// private Reader reader= new StringReader(LOG_BUFFER.toString()); +// public int read() throws IOException { +// return this.reader.read(); +// } +// }; +// if (LOG_RESOURCE.exists()) { +// LOG_RESOURCE.setContents( +// stream, +// IResource.FORCE | IResource.KEEP_HISTORY, +// null); +// } else { +// LOG_RESOURCE.create(stream, IResource.FORCE, null); +// } +} + +/* + * Asserts that the given actual source (usually coming from a file content) is equal to the expected one. + * Note that 'expected' is assumed to have the '\n' line separator. + * The line separators in 'actual' are converted to '\n' before the comparison. + */ +protected void assertSourceEquals(String message, String expected, String actual) { + if (expected == null) { + assertNull(message, actual); + return; + } + if (actual == null) { + assertEquals(message, expected, null); + return; + } + expected = Util.convertToIndependantLineDelimiter(expected); + actual = Util.convertToIndependantLineDelimiter(actual); + if (ASSERT_EQUALS_STRINGS) { + assertEquals(message, expected, actual); + } else { + assertTrue(message, actual.equals(expected)); + } +} + +DefaultCodeFormatter codeFormatter() { + DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(this.preferences, getDefaultCompilerOptions()); + return codeFormatter; +} + +void compareFormattedSource() throws IOException, Exception { + String source = new String(org.eclipse.jdt.internal.compiler.util.Util.getFileCharContent(this.file, null)); + String actualResult = null; + try { + // Format the source + actualResult = runFormatter(codeFormatter(), source, CodeFormatter.K_COMPILATION_UNIT | CodeFormatter.F_INCLUDE_COMMENTS, 0, 0, source.length(), null, true); + + // Look for output to compare with + File outputFile = new Path(OUTPUT_DIR.getPath()).append(this.path).toFile(); + if (actualResult != null && FAILURES != null && this.canCompare) { + String expectedResult = new String(org.eclipse.jdt.internal.compiler.util.Util.getFileCharContent(outputFile, null)); + try { + assertSourceEquals("Unexpected format output!", expectedResult, actualResult); + } + catch (ComparisonFailure cf) { + this.failureIndex = COMPARISON_FAILURE; + throw cf; + } + catch (AssertionFailedError afe) { + this.failureIndex = COMPARISON_FAILURE; + throw afe; + } + } + } + catch (Exception e) { +// System.err.println(e.getMessage()+" occurred in "+getName()); + throw e; + } + finally { + // Write file + if (actualResult != null) { + if (WRITE_DIR != null) { + File writtenFile = new Path(WRITE_DIR.getPath()).append(this.path).toFile(); + writtenFile.getParentFile().mkdirs(); + Util.writeToFile(actualResult, writtenFile.getAbsolutePath()); + } + } + } +} + +private String counterToString(int count) { + int reminder = count%10; + StringBuffer buffer = new StringBuffer(); + buffer.append(count); + switch (reminder) { + case 1: + buffer.append("st"); + break; + case 2: + buffer.append("nd"); + break; + case 3: + buffer.append("rd"); + break; + default: + buffer.append("th"); + break; + } + return buffer.toString(); +} + +private Map getDefaultCompilerOptions() { + Map optionsMap = new HashMap(30); + optionsMap.put(CompilerOptions.OPTION_LocalVariableAttribute, CompilerOptions.DO_NOT_GENERATE); + optionsMap.put(CompilerOptions.OPTION_LineNumberAttribute, CompilerOptions.DO_NOT_GENERATE); + optionsMap.put(CompilerOptions.OPTION_SourceFileAttribute, CompilerOptions.DO_NOT_GENERATE); + optionsMap.put(CompilerOptions.OPTION_PreserveUnusedLocal, CompilerOptions.PRESERVE); + optionsMap.put(CompilerOptions.OPTION_DocCommentSupport, CompilerOptions.DISABLED); + optionsMap.put(CompilerOptions.OPTION_ReportMethodWithConstructorName, CompilerOptions.IGNORE); + optionsMap.put(CompilerOptions.OPTION_ReportOverridingPackageDefaultMethod, CompilerOptions.IGNORE); + optionsMap.put(CompilerOptions.OPTION_ReportOverridingMethodWithoutSuperInvocation, CompilerOptions.IGNORE); + optionsMap.put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.IGNORE); + optionsMap.put(CompilerOptions.OPTION_ReportDeprecationInDeprecatedCode, CompilerOptions.DISABLED); + optionsMap.put(CompilerOptions.OPTION_ReportDeprecationWhenOverridingDeprecatedMethod, CompilerOptions.DISABLED); + optionsMap.put(CompilerOptions.OPTION_ReportHiddenCatchBlock, CompilerOptions.IGNORE); + optionsMap.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.IGNORE); + optionsMap.put(CompilerOptions.OPTION_ReportUnusedParameter, CompilerOptions.IGNORE); + optionsMap.put(CompilerOptions.OPTION_ReportUnusedImport, CompilerOptions.IGNORE); + optionsMap.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, CompilerOptions.IGNORE); + optionsMap.put(CompilerOptions.OPTION_ReportNoEffectAssignment, CompilerOptions.IGNORE); + optionsMap.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.IGNORE); + optionsMap.put(CompilerOptions.OPTION_ReportNoImplicitStringConversion, CompilerOptions.IGNORE); + optionsMap.put(CompilerOptions.OPTION_ReportNonStaticAccessToStatic, CompilerOptions.IGNORE); + optionsMap.put(CompilerOptions.OPTION_ReportIndirectStaticAccess, CompilerOptions.IGNORE); + optionsMap.put(CompilerOptions.OPTION_ReportIncompatibleNonInheritedInterfaceMethod, CompilerOptions.IGNORE); + optionsMap.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE); + optionsMap.put(CompilerOptions.OPTION_ReportLocalVariableHiding, CompilerOptions.IGNORE); + optionsMap.put(CompilerOptions.OPTION_ReportFieldHiding, CompilerOptions.IGNORE); + optionsMap.put(CompilerOptions.OPTION_ReportPossibleAccidentalBooleanAssignment, CompilerOptions.IGNORE); + optionsMap.put(CompilerOptions.OPTION_ReportEmptyStatement, CompilerOptions.IGNORE); + optionsMap.put(CompilerOptions.OPTION_ReportAssertIdentifier, CompilerOptions.IGNORE); + optionsMap.put(CompilerOptions.OPTION_ReportEnumIdentifier, CompilerOptions.IGNORE); + optionsMap.put(CompilerOptions.OPTION_ReportUndocumentedEmptyBlock, CompilerOptions.IGNORE); + optionsMap.put(CompilerOptions.OPTION_ReportUnnecessaryTypeCheck, CompilerOptions.IGNORE); + optionsMap.put(CompilerOptions.OPTION_ReportInvalidJavadoc, CompilerOptions.IGNORE); + optionsMap.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsVisibility, CompilerOptions.PUBLIC); + optionsMap.put(CompilerOptions.OPTION_ReportInvalidJavadocTags, CompilerOptions.DISABLED); + optionsMap.put(CompilerOptions.OPTION_ReportMissingJavadocTagDescription, CompilerOptions.RETURN_TAG); + optionsMap.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsDeprecatedRef, CompilerOptions.DISABLED); + optionsMap.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsNotVisibleRef, CompilerOptions.DISABLED); + optionsMap.put(CompilerOptions.OPTION_ReportMissingJavadocTags, CompilerOptions.IGNORE); + optionsMap.put(CompilerOptions.OPTION_ReportMissingJavadocTagsVisibility, CompilerOptions.PUBLIC); + optionsMap.put(CompilerOptions.OPTION_ReportMissingJavadocTagsOverriding, CompilerOptions.DISABLED); + optionsMap.put(CompilerOptions.OPTION_ReportMissingJavadocComments, CompilerOptions.IGNORE); + optionsMap.put(CompilerOptions.OPTION_ReportMissingJavadocCommentsVisibility, CompilerOptions.IGNORE); + optionsMap.put(CompilerOptions.OPTION_ReportMissingJavadocCommentsOverriding, CompilerOptions.DISABLED); + optionsMap.put(CompilerOptions.OPTION_ReportFinallyBlockNotCompletingNormally, CompilerOptions.IGNORE); + optionsMap.put(CompilerOptions.OPTION_ReportUnusedDeclaredThrownException, CompilerOptions.IGNORE); + optionsMap.put(CompilerOptions.OPTION_ReportUnusedDeclaredThrownExceptionWhenOverriding, CompilerOptions.DISABLED); + optionsMap.put(CompilerOptions.OPTION_ReportUnqualifiedFieldAccess, CompilerOptions.IGNORE); + optionsMap.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_6); + optionsMap.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_6); + optionsMap.put(CompilerOptions.OPTION_TaskTags, ""); //$NON-NLS-1$ + optionsMap.put(CompilerOptions.OPTION_TaskPriorities, ""); //$NON-NLS-1$ + optionsMap.put(CompilerOptions.OPTION_TaskCaseSensitive, CompilerOptions.DISABLED); + optionsMap.put(CompilerOptions.OPTION_ReportUnusedParameterWhenImplementingAbstract, CompilerOptions.DISABLED); + optionsMap.put(CompilerOptions.OPTION_ReportUnusedParameterWhenOverridingConcrete, CompilerOptions.DISABLED); + optionsMap.put(CompilerOptions.OPTION_ReportSpecialParameterHidingField, CompilerOptions.DISABLED); + optionsMap.put(CompilerOptions.OPTION_MaxProblemPerUnit, String.valueOf(100)); + optionsMap.put(CompilerOptions.OPTION_InlineJsr, CompilerOptions.DISABLED); + optionsMap.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_6); + return optionsMap; +} + +private boolean isExpectedFailure() { + int length = EXPECTED_FAILURES.length; + for (int i=0; i<length; i++) { + IPath expectedFailure= EXPECTED_FAILURES[i]; + if (this.path.toString().indexOf(expectedFailure.toString()) >= 0) { + this.failureIndex = REFORMATTING_EXPECTED_FAILURE; + FAILURES[REFORMATTING_EXPECTED_FAILURE].failures.add(this.path); + return true; + } + } + return false; +} + +/* +private boolean runFormatterWithoutComments(CodeFormatter codeFormatter, String source, int kind, int indentationLevel, int offset, int length, String lineSeparator) { + DefaultCodeFormatterOptions preferencesWithoutComment = DefaultCodeFormatterOptions.getEclipseDefaultSettings(); + preferencesWithoutComment.comment_format_line_comment = false; + preferencesWithoutComment.comment_format_block_comment = false; + preferencesWithoutComment.comment_format_javadoc_comment = false; + DefaultCodeFormatter codeFormatterWithoutComment = new DefaultCodeFormatter(preferencesWithoutComment); + + TextEdit edit = codeFormatterWithoutComment.format(kind, source, offset, length, indentationLevel, lineSeparator);//$NON-NLS-1$ + if (edit == null) return false; + String initialResult = org.eclipse.jdt.internal.core.util.Util.editedString(source, edit); + + int count = 1; + String result = initialResult; + String previousResult = result; + while (count++ < FORMAT_REPEAT) { + edit = codeFormatterWithoutComment.format(kind, result, 0, result.length(), indentationLevel, lineSeparator);//$NON-NLS-1$ + if (edit == null) return false; + previousResult = result; + result = org.eclipse.jdt.internal.core.util.Util.editedString(result, edit); + } + return previousResult.equals(result); +} +*/ + +private boolean sourceHasCompilationErrors(String source) { + CodeSnippetParsingUtil codeSnippetParsingUtil = new CodeSnippetParsingUtil(); + codeSnippetParsingUtil.parseCompilationUnit(source.toCharArray(), getDefaultCompilerOptions(), true); + if (codeSnippetParsingUtil.recordedParsingInformation != null) { + CategorizedProblem[] problems = codeSnippetParsingUtil.recordedParsingInformation.problems; + int length = problems == null ? 0 : problems.length; + for (int i=0; i<length; i++) { + if (((DefaultProblem)problems[i]).isError()) { + return true; + } + } + } + return false; +} + +String runFormatter(CodeFormatter codeFormatter, String source, int kind, int indentationLevel, int offset, int length, String lineSeparator, boolean repeat) { + long timeStart = System.currentTimeMillis(); + TextEdit edit = codeFormatter.format(kind, source, offset, length, indentationLevel, lineSeparator); + if (FAILURES != null) { // Comparison has started + TIME_MEASURES.formatting[0] += System.currentTimeMillis() - timeStart; + TIME_MEASURES.occurences[0]++; + if (edit == null) TIME_MEASURES.null_output[0]++; + } + if (edit == null) { + if (sourceHasCompilationErrors(source)) { + this.failureIndex = COMPILATION_ERRORS_FAILURE; + FAILURES[COMPILATION_ERRORS_FAILURE].failures.add(this.path); + return null; + } + this.failureIndex = NO_OUTPUT_FAILURE; + throw new AssertionFailedError("Formatted source should not be null!"); + } + String initialResult = org.eclipse.jdt.internal.core.util.Util.editedString(source, edit); + + int count = 0; + String result = initialResult; + String previousResult = result; + while (++count < FORMAT_REPEAT) { + timeStart = System.currentTimeMillis(); + edit = codeFormatter.format(kind, result, 0, result.length(), indentationLevel, lineSeparator); + if (FAILURES != null) { // Comparison has started + TIME_MEASURES.formatting[count] += System.currentTimeMillis() - timeStart; + TIME_MEASURES.occurences[count]++; + if (edit == null) TIME_MEASURES.null_output[count]++; + } + if (edit == null) return null; + previousResult = result; + result = org.eclipse.jdt.internal.core.util.Util.editedString(result, edit); + } + if (!previousResult.equals(result)) { + + if (FAILURES != null) { + // Try to compare without leading spaces + String trimmedExpected = ModelTestsUtil.trimLinesLeadingWhitespaces(previousResult); + String trimmedActual= ModelTestsUtil.trimLinesLeadingWhitespaces(result); + if (trimmedExpected.equals(trimmedActual)) { + this.failureIndex = REFORMATTING_LEADING_FAILURE; + FAILURES[REFORMATTING_LEADING_FAILURE].failures.add(this.path); + return initialResult; + } + + // Try to compare without spaces at all + if (ModelTestsUtil.removeWhiteSpace(previousResult).equals(ModelTestsUtil.removeWhiteSpace(result))) { + this.failureIndex = REFORMATTING_WHITESPACES_FAILURE; + FAILURES[REFORMATTING_WHITESPACES_FAILURE].failures.add(this.path); + return initialResult; + } + } + + /* + // Try to see if the formatting also fails without comments + if (!runFormatterWithoutComments(null, source, kind, indentationLevel, offset, length, lineSeparator)) { + return initialResult; + } + + // format without comments is OK => there's a problem with comment formatting + String counterString = counterToString(count-1); + assertSourceEquals(counterString+" formatting is different from first one!", previousResult, result); + */ + if (!isExpectedFailure()) { + String counterString = counterToString(count); + try { + assertSourceEquals(counterString+" formatting is different from first one!", previousResult, result); + } + catch (ComparisonFailure cf) { + this.failureIndex = REFORMATTING_FAILURE; + throw cf; + } + catch (AssertionFailedError afe) { + this.failureIndex = REFORMATTING_FAILURE; + throw afe; + } + } + } + return initialResult; +} + +/** + * Returns a string to display the given time as a duration + * formatted as: + * <ul> + * <li>"XXXms" if the duration is less than 0.1s (e.g. "543ms")</li> + * <li>"X.YYs" if the duration is less than 1s (e.g. "5.43s")</li> + * <li>"XX.Ys" if the duration is less than 1mn (e.g. "54.3s")</li> + * <li>"XXmn XXs" if the duration is less than 1h (e.g. "54mn 3s")</li> + * <li>"XXh XXmn XXs" if the duration is over than 1h (e.g. "5h 4mn 3s")</li> + * </ul> + * + * @param time The time to format as a long. + * @return The formatted string. + */ +public String timeString(long time) { + NumberFormat format = NumberFormat.getInstance(); + format.setMaximumFractionDigits(3); + StringBuffer buffer = new StringBuffer(); + if (time == 0) { + // print nothing + } else { + long h = time / ONE_HOUR; + if (h > 0) buffer.append(h).append("h "); //$NON-NLS-1$ + long remaining = time % ONE_HOUR; + long m = remaining / ONE_MINUTE; + if (h > 0 || m > 0) buffer.append(m).append("mn "); //$NON-NLS-1$ + remaining = remaining % ONE_MINUTE; + if ((remaining % 1000) == 0) { + buffer.append(remaining/1000); + } else { + buffer.append(format.format(remaining/1000.0)); + } + buffer.append("s"); //$NON-NLS-1$ + } + return buffer.toString(); +} + +/* + * Test to delete the output directory. + */ +public void testDeleteOutputDir() throws IOException, Exception { + Util.delete(OUTPUT_DIR); +} + +/* + * Test to fill the output directory with reference. + */ +public void testMakeReferences() throws IOException, Exception { + + // Dump the version + File versionFile = new Path(OUTPUT_DIR.getPath()).append("version.txt").toFile(); + OUTPUT_DIR.mkdirs(); + Util.writeToFile(JDT_CORE_VERSION, versionFile.getAbsolutePath()); + + // Format each file of the input dir and write the result to the output directory + assertNotNull("We should have got input files from "+INPUT_DIR, this.inputFiles); + DefaultCodeFormatter codeFormatter = codeFormatter(); + int length = this.inputFiles.length; + for (int i=0; i<length; i++) { + + // Get the source from file + String source = new String(org.eclipse.jdt.internal.compiler.util.Util.getFileCharContent(this.inputFiles[i], null)); + + try { + // Format the source + TextEdit edit = codeFormatter.format(CodeFormatter.K_COMPILATION_UNIT | CodeFormatter.F_INCLUDE_COMMENTS, source, 0, source.length(), 0, null); + + // Write the result + if (edit != null) { + String formatResult = org.eclipse.jdt.internal.core.util.Util.editedString(source, edit); + String inputPath = this.inputFiles[i].getPath().substring(INPUT_DIR.getPath().length()+1); + File writtenFile = new Path(OUTPUT_DIR.getPath()).append(inputPath).toFile(); + writtenFile.getParentFile().mkdirs(); + Util.writeToFile(formatResult, writtenFile.getAbsolutePath()); + } + } + catch (Exception ex) { + // skip silently + } + } +} + +/* + * Test to compare the formatter output with an existing file. + */ +public void testCompare() throws IOException, Exception { + if (FAILURES == null && this.canCompare) { + initFailures(); + } + try { + compareFormattedSource(); + } + catch (ComparisonFailure cf) { + if (this.failureIndex == -1) { + FAILURES[UNEXPECTED_FAILURE].failures.add(this.path); + } else { + FAILURES[this.failureIndex].failures.add(this.path); + } + throw cf; + } + catch (AssertionFailedError afe) { + if (this.failureIndex == -1) { + FAILURES[UNEXPECTED_FAILURE].failures.add(this.path); + } else { + FAILURES[this.failureIndex].failures.add(this.path); + } + throw afe; + } + catch (Exception ex) { + FAILURES[UNEXPECTED_FAILURE].failures.add(this.path); + throw ex; + } +} +} diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java index 6a23f05bff..cc37ec1725 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java @@ -20,10 +20,15 @@ import junit.framework.Test; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.IResourceChangeEvent; +import org.eclipse.core.resources.IResourceChangeListener; +import org.eclipse.core.resources.IResourceDelta; import org.eclipse.core.resources.IncrementalProjectBuilder; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Path; +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.content.IContentType; import org.eclipse.jdt.core.*; import org.eclipse.jdt.core.compiler.CharOperation; import org.eclipse.jdt.core.search.*; @@ -10808,4 +10813,217 @@ public void testBug266837() throws Exception { search("f266837", FIELD, DECLARATIONS, requestor); } +/** + * @bug 286379: [search] Problem while searching class + * @test Ensure that no IAE occurs when there is a change in JavaLikeNames. + * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=286379" + */ +public void testBug286379a() throws CoreException { + IContentType javaContentType = Platform.getContentTypeManager().getContentType(JavaCore.JAVA_SOURCE_CONTENT_TYPE); + ICompilationUnit cu = null; + try { + assertNotNull("We should have got a Java Source content type!", javaContentType); + javaContentType.addFileSpec("torem", IContentType.FILE_EXTENSION_SPEC); + createJavaProject("P"); + createFolder("/P/p"); + createFile( + "/P/p/Xtorem.torem", + "package p;\n" + + "public class Xtorem {\n" + + "}" + ); + waitUntilIndexesReady(); + cu = getCompilationUnit("/P/p/Xtorem.torem"); + cu.becomeWorkingCopy(null); + IType type = cu.getType("Xtorem"); + + // Ensure that the Xtorem class is really found + TestCollector collector = new TestCollector(); + new SearchEngine().search( + SearchPattern.createPattern(type, IJavaSearchConstants.DECLARATIONS), + new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()}, + SearchEngine.createWorkspaceScope(), + collector, + null + ); + assertSearchResults("p/Xtorem.torem p.Xtorem", collector); + + // Ensure that removal of the content type doesn't cause any further exception + // during the search and also ensure that the search doesn't return any result + javaContentType.removeFileSpec("torem", IContentType.FILE_EXTENSION_SPEC); + collector = new TestCollector(); + new SearchEngine().search( + SearchPattern.createPattern(type, IJavaSearchConstants.DECLARATIONS), + new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()}, + SearchEngine.createWorkspaceScope(), + collector, + null + ); + assertSearchResults("No results expected", "", collector); + } finally { + if (cu != null) + cu.discardWorkingCopy(); + if (javaContentType != null) + javaContentType.removeFileSpec("torem", IContentType.FILE_EXTENSION_SPEC); + deleteProject("P"); + } +} + +/** + * This is similar to testBug286379a, except that it ensures that IAE doesn't occur + * at a different place + */ +public void testBug286379b() throws CoreException { + IContentType javaContentType = Platform.getContentTypeManager().getContentType(JavaCore.JAVA_SOURCE_CONTENT_TYPE); + try { + assertNotNull("We should have got a Java Source a content type!", javaContentType); + javaContentType.addFileSpec("torem", IContentType.FILE_EXTENSION_SPEC); + createJavaProject("P"); + createFolder("/P/p"); + createFile( + "/P/p/Xtorem.torem", + "package p;\n" + + "public class Xtorem {\n" + + "}" + ); + + // Ensure that the class Xtorem is really found + TypeNameMatchCollector collector = new TypeNameMatchCollector(); + new SearchEngine().searchAllTypeNames( + null, + new char[][] {"Xtorem".toCharArray()}, + SearchEngine.createWorkspaceScope(), + collector, + IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, + null); + assertSearchResults("Xtorem (not open) [in Xtorem.torem [in p [in <project root> [in P]]]]", collector); + + // Ensure that removal of the content type doesn't cause any further exception + // during the search and also ensure that the search doesn't return any result + javaContentType.removeFileSpec("torem", IContentType.FILE_EXTENSION_SPEC); + collector = new TypeNameMatchCollector(); + new SearchEngine().searchAllTypeNames( + null, + new char[][] {"Xtorem".toCharArray()}, + SearchEngine.createWorkspaceScope(), + collector, + IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, + null); + assertSearchResults("No results expected", "", collector); + } finally { + if (javaContentType != null) + javaContentType.removeFileSpec("torem", IContentType.FILE_EXTENSION_SPEC); + deleteProject("P"); + } +} + +/** + * If any javaLikeNames are added, this ensures that such files can get searched + * at least on the restart of the workspace. + * If any javaLikeNames are deleted, this ensures that the index file is regenerated. + */ +public void testBug286379c() throws CoreException { + class TestResourceChangeListener implements IResourceChangeListener { + boolean valid = false; + public void resourceChanged(IResourceChangeEvent event) { + this.valid = validate(event.getDelta()); + } + /* + * Ensure that the listener receives a delta concerning the resource + * with the new extension... + */ + private boolean validate(IResourceDelta delta) { + IResourceDelta[] children = delta.getAffectedChildren(); + int length = children.length; + if (length == 0) { + IResource resource = delta.getResource(); + if (resource.getType() == IResource.FILE && + resource.getName().equals("Xtorem.torem")) { + return true; + } + } else { + for (int i=0; i<length; i++) { + if (validate(children[i])) return true; + } + } + return false; + } + } + + IContentType javaContentType = Platform.getContentTypeManager().getContentType(JavaCore.JAVA_SOURCE_CONTENT_TYPE); + TestResourceChangeListener changeListener = new TestResourceChangeListener(); + try { + // Create resource + createJavaProject("P"); + createFolder("/P/p"); + createFile( + "/P/p/Xtorem.torem", + "package p;\n" + + "public class Xtorem {\n" + + "}" + ); + + // Wait to be sure that indexes are ready after the resource creation + waitUntilIndexesReady(); + + // Add the resource listener + getWorkspace().addResourceChangeListener(changeListener, IResourceChangeEvent.POST_CHANGE); + + // Change the file extension + assertNotNull("We should have got a Java Source a content type!", javaContentType); + javaContentType.addFileSpec("torem", IContentType.FILE_EXTENSION_SPEC); + + // Wait for all the resource event before continuing + // Note that if we are not waiting for this event occurring then the search may + // fail as we don't get any specific event from the platform to refresh the indexes. + // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=118619 + int counter = 0; + while (!changeListener.valid) { + try { + Thread.sleep(100); + } + catch (InterruptedException ie) { + // skip + } + assertTrue("We should have got a resource event within a 10s delay!", counter++ < 100); + } + + // Search for the new type with new extension + TypeNameMatchCollector collector = new TypeNameMatchCollector(); + new SearchEngine().searchAllTypeNames( + null, + new char[][] {"Xtorem".toCharArray()}, + SearchEngine.createWorkspaceScope(), + collector, + IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, + null); + assertSearchResults("Unexpected search results!", + "Xtorem (not open) [in Xtorem.torem [in p [in <project root> [in P]]]]", + collector); + + // Delete the file specification + javaContentType.removeFileSpec("torem", IContentType.FILE_EXTENSION_SPEC); + + // Restarting should update the index file to remove the references of any .torem files + simulateExit(); + simulateRestart(); + waitUntilIndexesReady(); + + // Search for the new type with new extension + collector = new TypeNameMatchCollector(); + new SearchEngine().searchAllTypeNames( + null, + new char[][] {"Xtorem".toCharArray()}, + SearchEngine.createWorkspaceScope(), + collector, + IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, + null); + assertSearchResults("No search results expected", "", collector); + } finally { + getWorkspace().removeResourceChangeListener(changeListener); + if (javaContentType != null) + javaContentType.removeFileSpec("torem", IContentType.FILE_EXTENSION_SPEC); + deleteProject("P"); + } +} }
\ No newline at end of file diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchTests.java index e59ae7780f..a16684cab8 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchTests.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchTests.java @@ -7,6 +7,7 @@ * * Contributors: * IBM Corporation - initial API and implementation + * Stephan Herrmann - Contribution for bug 215139 *******************************************************************************/ package org.eclipse.jdt.core.tests.model; @@ -1355,6 +1356,7 @@ public void testMethodDeclaration03() throws CoreException { // was testInnerMet } /** * Method declaration in hierarchy test. + * Explicitly request behavior pre https://bugs.eclipse.org/bugs/show_bug.cgi?id=215139 */ public void testMethodDeclaration04() throws CoreException { // was testMethodDeclarationInHierarchyScope1 IType type = getCompilationUnit("JavaSearch", "src", "p", "X.java").getType("X"); @@ -1363,10 +1365,29 @@ public void testMethodDeclaration04() throws CoreException { // was testMethodDe "foo", METHOD, DECLARATIONS, + SearchEngine.createHierarchyScope(null, type, false, true, null), + this.resultCollector); + assertSearchResults( + "src/p/X.java void p.X.foo(int, String, X) [foo]\n" + + "src/p/Z.java void p.Z.foo(int, String, X) [foo]", + this.resultCollector); +} +/** + * Method declaration in hierarchy test. + * After https://bugs.eclipse.org/bugs/show_bug.cgi?id=215139 result contains more types. + */ +public void testMethodDeclaration04a() throws CoreException { // was testMethodDeclarationInHierarchyScope1 + IType type = getCompilationUnit("JavaSearch", "src", "p", "X.java").getType("X"); + + search( + "foo", + METHOD, + DECLARATIONS, SearchEngine.createHierarchyScope(type), this.resultCollector); assertSearchResults( "src/p/X.java void p.X.foo(int, String, X) [foo]\n" + + "src/p/X.java String p.X$Inner.foo() [foo]\n" + "src/p/Z.java void p.Z.foo(int, String, X) [foo]", this.resultCollector); } @@ -2422,6 +2443,227 @@ public void testSearchScope05() throws CoreException, IOException { // was testE } /** + * Hierarchy scope test. + * (test for enhancement bug 215139 encloses(): find only subtypes). + */ +public void testSearchScope06() throws CoreException { + ICompilationUnit cuB = this. getCompilationUnit("JavaSearch", "src", "a10", "B.java"); + ICompilationUnit cuC = this. getCompilationUnit("JavaSearch", "src", "a10", "C.java"); + IType type = cuC.getType("C"); + IJavaSearchScope scope = SearchEngine.createHierarchyScope(null, type, true, true, null); + + // don't include super-classes: + assertFalse("a10.A should not be included in hierarchy scope", scope.encloses(cuB.getType("A"))); + assertFalse("a10.B should not be included in hierarchy scope", scope.encloses(cuB.getType("B"))); + assertFalse("a10/B.java should not be included in hierarchy scope", scope.encloses(cuB.getUnderlyingResource().getFullPath().toString())); +} +/** + * Hierarchy scope test. + * (test for enhancement bug 215139 encloses(): find only subtypes). + */ +public void testSearchScope07() throws CoreException { + ICompilationUnit cuC = this. getCompilationUnit("JavaSearch", "src", "a10", "C.java"); + IType type = cuC.getType("C"); + IJavaSearchScope scope = SearchEngine.createHierarchyScope(null, type, true, true, null); + + // don't include focus type: + assertFalse("a10.C should be not included in hierarchy scope", scope.encloses(type)); + assertFalse("a10/C.java should be included in hierarchy scope", scope.encloses(cuC.getUnderlyingResource().getFullPath().toString())); +} +/** + * Hierarchy scope test. + * (test for enhancement bug 215139 encloses(): find only subtypes). + */ +public void testSearchScope08() throws CoreException { + ICompilationUnit cuC = this. getCompilationUnit("JavaSearch", "src", "a10", "C.java"); + ICompilationUnit cuD = this. getCompilationUnit("JavaSearch", "src", "a10", "D.java"); + ICompilationUnit cuE = this. getCompilationUnit("JavaSearch", "src", "a10", "E.java"); + IType type = cuC.getType("C"); + IJavaSearchScope scope = SearchEngine.createHierarchyScope(null, type, true, true, null); + + // regular sub-types: + assertTrue("a10.D should be included in hierarchy scope", scope.encloses(cuD.getType("D"))); + assertTrue("a10/D.java should be included in hierarchy scope", scope.encloses(cuD.getUnderlyingResource().getFullPath().toString())); + + assertTrue("a10.E should be included in hierarchy scope", scope.encloses(cuE.getType("E"))); + assertTrue("a10.F should be included in hierarchy scope", scope.encloses(cuE.getType("F"))); +} +/** + * Hierarchy scope test. + * (test for enhancement bug 215139 encloses(): find only subtypes). + */ +public void testSearchScope09() throws CoreException { + ICompilationUnit cuC = this. getCompilationUnit("JavaSearch", "src", "a10", "C.java"); + ICompilationUnit cuE = this. getCompilationUnit("JavaSearch", "src", "a10", "E.java"); + IType type = cuC.getType("C"); + IJavaSearchScope scope = SearchEngine.createHierarchyScope(null, type, true, true, null); + + // sub-type is a nested type: + assertTrue("a10.H$I should be included in hierarchy scope", scope.encloses(cuE.getType("H").getType("I"))); +} +/** + * Hierarchy scope test. + * (test for enhancement bug 215139 encloses(): find only subtypes). + */ +public void testSearchScope10() throws CoreException { + ICompilationUnit cuC = this. getCompilationUnit("JavaSearch", "src", "a10", "C.java"); + ICompilationUnit cuE = this. getCompilationUnit("JavaSearch", "src", "a10", "E.java"); + IType type = cuC.getType("C"); + IJavaSearchScope scope = SearchEngine.createHierarchyScope(null, type, true, true, null); + + // member of a sub-type: + assertFalse("a10.F$G should not be included in hierarchy scope", scope.encloses(cuE.getType("F").getType("G"))); +} +/** + * Hierarchy scope test. + * (test for enhancement bug 215139 encloses(): find only subtypes and their member types). + */ +public void testSearchScope11() throws CoreException { + ICompilationUnit cuC = this. getCompilationUnit("JavaSearch", "src", "a10", "C.java"); + ICompilationUnit cuE = this. getCompilationUnit("JavaSearch", "src", "a10", "E.java"); + IType type = cuC.getType("C"); + IJavaSearchScope scope = SearchEngine.createHierarchyScope(null, type, true, false, null); + + // member of a sub-type: + assertTrue("a10.F$G should be included in hierarchy scope", scope.encloses(cuE.getType("F").getType("G"))); +} +/** + * Hierarchy scope test. + * (test for enhancement bug 215139 encloses(): find only subtypes). + */ +public void testSearchScope12() throws CoreException { + ICompilationUnit cuC = this. getCompilationUnit("JavaSearch", "src", "a10", "C.java"); + ICompilationUnit cuE = this. getCompilationUnit("JavaSearch", "src", "a10", "E.java"); + IType type = cuC.getType("C"); + IJavaSearchScope scope = SearchEngine.createHierarchyScope(null, type, true, true, null); + + // enclosing of a sub-type: + assertFalse("a10.H should not be included in hierarchy scope", scope.encloses(cuE.getType("H"))); + assertTrue("a10/E.java should be included in hierarchy scope", scope.encloses(cuE.getUnderlyingResource().getFullPath().toString())); +} +/** + * Hierarchy scope test. + * (test for enhancement bug 215139 search: find only subtypes). + */ +public void testSearchScope13() throws CoreException { + ICompilationUnit cuC = this. getCompilationUnit("JavaSearch", "src", "a10", "C.java"); + IType type = cuC.getType("C"); + IJavaSearchScope scope = SearchEngine.createHierarchyScope(null, type, true, true, null); + + search("**", TYPE, DECLARATIONS, scope); + assertSearchResults( + "src/a10/D.java a10.D [D]\n" + + "src/a10/E.java a10.E [E]\n" + + "src/a10/E.java a10.F [F]\n" + + "src/a10/E.java a10.H$I [I]" + ); +} +/** + * Hierarchy scope test. + * (test for enhancement bug 215139 search: find only subtypes - disabled). + */ +public void testSearchScope14() throws CoreException { + ICompilationUnit cuC = this. getCompilationUnit("JavaSearch", "src", "a10", "C.java"); + IType type = cuC.getType("C"); + IJavaSearchScope scope = SearchEngine.createHierarchyScope(null, type, /*onlySubTypes*/false, true, null); + + search("**", TYPE, DECLARATIONS, scope); + assertSearchResults( + "src/a10/B.java a10.A [A]\n" + + "src/a10/B.java a10.B [B]\n" + + "src/a10/C.java a10.C [C]\n" + + "src/a10/D.java a10.D [D]\n" + + "src/a10/E.java a10.E [E]\n" + + "src/a10/E.java a10.F [F]\n" + + "src/a10/E.java a10.H$I [I]\n" + + getExternalJCLPathString() + " java.lang.Object" + ); +} +/** + * Hierarchy scope test. + * (test for enhancement bug 215139 search: find only subtypes - different call chain). + */ +public void testSearchScope15() throws CoreException { + ICompilationUnit cuC = this. getCompilationUnit("JavaSearch", "src", "a10", "C.java"); + IType type = cuC.getType("C"); + IJavaSearchScope scope = SearchEngine.createHierarchyScope(null, type, true, true, null); + TypeNameMatchCollector collector = new TypeNameMatchCollector() { + public String toString(){ + return toFullyQualifiedNamesString(); + } + }; + new SearchEngine().searchAllTypeNames( + null, + null, + scope, + collector, + IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, + null); + String expected = + "a10.D\n" + + "a10.E\n" + + "a10.F\n" + + "a10.H$I"; + assertTrue("We should get some types!", collector.size() > 0); + assertEquals("Found types sound not to be correct", expected, collector.toString()); +} +/** + * Hierarchy scope test. + * (test for enhancement bug 215139 search: find only subtypes plus member & enclosing types - different call chain). + */ +public void testSearchScope16() throws CoreException { + ICompilationUnit cuC = this. getCompilationUnit("JavaSearch", "src", "a10", "C.java"); + IType type = cuC.getType("C"); + IJavaSearchScope scope = SearchEngine.createHierarchyScope(null, type, true, false, null); + TypeNameMatchCollector collector = new TypeNameMatchCollector() { + public String toString(){ + return toFullyQualifiedNamesString(); + } + }; + new SearchEngine().searchAllTypeNames( + null, + null, + scope, + collector, + IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, + null); + String expected = + "a10.D\n" + + "a10.E\n" + + "a10.F\n" + + "a10.F$G\n" + + "a10.H\n" + + "a10.H$I"; + assertTrue("We should get some types!", collector.size() > 0); + assertEquals("Found types sound not to be correct", expected, collector.toString()); +} +/** + * Hierarchy scope test. + * (test for enhancement bug 215139 encloses(method): find only subtypes). + */ +public void testSearchScope17() throws CoreException { + ICompilationUnit cuC = this. getCompilationUnit("JavaSearch", "src", "a10", "C.java"); + ICompilationUnit cuE = this. getCompilationUnit("JavaSearch", "src", "a10", "E.java"); + IType type = cuC.getType("C"); + IJavaSearchScope scope = SearchEngine.createHierarchyScope(null, type, true, true, null); + + // method of a member of a sub-type: + assertFalse("a10.F$G.m() should not be included in hierarchy scope", scope.encloses(cuE.getType("F").getType("G").getMethod("m", new String[0]))); +} +/** + * Hierarchy scope test. + * (test for enhancement bug 215139 encloses(method): find only subtypes but also member types). + */ +public void testSearchScope18() throws CoreException { + ICompilationUnit cuC = this. getCompilationUnit("JavaSearch", "src", "a10", "C.java"); + ICompilationUnit cuE = this. getCompilationUnit("JavaSearch", "src", "a10", "E.java"); + IType type = cuC.getType("C"); + IJavaSearchScope scope = SearchEngine.createHierarchyScope(null, type, true, false, null); + + // method of a member of a sub-type: + assertTrue("a10.F$G.m() should be included in hierarchy scope", scope.encloses(cuE.getType("F").getType("G").getMethod("m", new String[0]))); +} +/** * Simple type declaration test. */ public void testTypeDeclaration01() throws CoreException { // was testSimpleTypeDeclaration diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/TypeHierarchyTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/TypeHierarchyTests.java index 115a36923e..37d018f767 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/TypeHierarchyTests.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/TypeHierarchyTests.java @@ -666,7 +666,7 @@ public void testEfficiencyMultipleProjects() throws CoreException { } ProgressCounter counter = new ProgressCounter(); type.newTypeHierarchy(counter); - assertEquals("Unexpected work count", 77, counter.count); + assertEquals("Unexpected work count", 76, counter.count); } finally { deleteProjects(new String[] {"P1", "P2", "P3"}); } diff --git a/org.eclipse.jdt.core.tests.model/workspace/JavaSearch/src/a10/B.java b/org.eclipse.jdt.core.tests.model/workspace/JavaSearch/src/a10/B.java new file mode 100644 index 0000000000..97cb8fd3de --- /dev/null +++ b/org.eclipse.jdt.core.tests.model/workspace/JavaSearch/src/a10/B.java @@ -0,0 +1,5 @@ +package a10; + +class A { } + +public class B extends A { } diff --git a/org.eclipse.jdt.core.tests.model/workspace/JavaSearch/src/a10/C.java b/org.eclipse.jdt.core.tests.model/workspace/JavaSearch/src/a10/C.java new file mode 100644 index 0000000000..69240fda38 --- /dev/null +++ b/org.eclipse.jdt.core.tests.model/workspace/JavaSearch/src/a10/C.java @@ -0,0 +1,3 @@ +package a10; + +public class C extends B {} diff --git a/org.eclipse.jdt.core.tests.model/workspace/JavaSearch/src/a10/E.java b/org.eclipse.jdt.core.tests.model/workspace/JavaSearch/src/a10/E.java new file mode 100644 index 0000000000..9dd543d6e5 --- /dev/null +++ b/org.eclipse.jdt.core.tests.model/workspace/JavaSearch/src/a10/E.java @@ -0,0 +1,13 @@ +package a10; + +public class E extends D {} + +class F extends C { + class G { + void m(){} + } +} + +class H { + class I extends E {} +} diff --git a/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceModelTests.java b/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceModelTests.java index b05f721a0b..5e42a1cf95 100644 --- a/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceModelTests.java +++ b/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceModelTests.java @@ -16,7 +16,7 @@ import java.io.IOException; import java.io.PrintStream; import java.util.ArrayList; -import junit.framework.*; +import junit.framework.Test; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; @@ -26,15 +26,42 @@ import org.eclipse.core.resources.IWorkspace; import org.eclipse.core.resources.IWorkspaceRoot; import org.eclipse.core.resources.IWorkspaceRunnable; import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.*; -import org.eclipse.jdt.core.*; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.Path; +import org.eclipse.jdt.core.IClassFile; +import org.eclipse.jdt.core.IClasspathEntry; +import org.eclipse.jdt.core.ICompilationUnit; +import org.eclipse.jdt.core.IField; +import org.eclipse.jdt.core.IInitializer; +import org.eclipse.jdt.core.IJavaElement; +import org.eclipse.jdt.core.IJavaModel; +import org.eclipse.jdt.core.IJavaProject; +import org.eclipse.jdt.core.IMethod; +import org.eclipse.jdt.core.IPackageFragment; +import org.eclipse.jdt.core.IPackageFragmentRoot; +import org.eclipse.jdt.core.IProblemRequestor; +import org.eclipse.jdt.core.IType; +import org.eclipse.jdt.core.JavaCore; +import org.eclipse.jdt.core.JavaModelException; +import org.eclipse.jdt.core.WorkingCopyOwner; import org.eclipse.jdt.core.dom.AST; import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jdt.core.search.*; +import org.eclipse.jdt.core.search.IJavaSearchConstants; +import org.eclipse.jdt.core.search.IJavaSearchScope; +import org.eclipse.jdt.core.search.SearchEngine; +import org.eclipse.jdt.core.search.SearchMatch; +import org.eclipse.jdt.core.search.SearchPattern; +import org.eclipse.jdt.core.search.SearchRequestor; +import org.eclipse.jdt.core.search.TypeNameRequestor; import org.eclipse.jdt.core.tests.model.AbstractJavaModelTests; import org.eclipse.jdt.core.tests.model.AbstractJavaModelTests.ProblemRequestor; -import org.eclipse.jdt.internal.core.*; -import org.eclipse.test.performance.Performance; +import org.eclipse.jdt.internal.core.DefaultWorkingCopyOwner; +import org.eclipse.jdt.internal.core.IJavaElementRequestor; +import org.eclipse.jdt.internal.core.JavaElement; +import org.eclipse.jdt.internal.core.JavaProject; +import org.eclipse.jdt.internal.core.NameLookup; /** */ @@ -1007,7 +1034,6 @@ public void testPopulateTwoBigJars() throws CoreException { */ public void testSeekPackageFragments() throws CoreException { assertNotNull("We should have the 'BigProject' in workspace!", BIG_PROJECT); - setComment(Performance.EXPLAINS_DEGRADATION_COMMENT, "Test has been rewritten and is not stabilized yet..."); class PackageRequestor implements IJavaElementRequestor { ArrayList pkgs = new ArrayList(); public void acceptField(IField field) {} diff --git a/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceSearchTests.java b/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceSearchTests.java index e779e1db19..506e60491f 100644 --- a/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceSearchTests.java +++ b/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceSearchTests.java @@ -25,7 +25,6 @@ import org.eclipse.jdt.core.IPackageFragment; import org.eclipse.jdt.core.search.*; import org.eclipse.jdt.core.tests.model.AbstractJavaModelTests; import org.eclipse.jdt.internal.core.search.processing.IJob; -import org.eclipse.test.performance.Performance; /** */ @@ -518,8 +517,7 @@ public class FullSourceWorkspaceSearchTests extends FullSourceWorkspaceTests imp */ public void testSearchMethod() throws CoreException { tagAsSummary("Search method occurences (no resolution)", false); // do NOT put in fingerprint - setComment(Performance.EXPLAINS_DEGRADATION_COMMENT, "Test is not enough stable and will be replaced by another one..."); - + // Wait for indexing end AbstractJavaModelTests.waitUntilIndexesReady(); |