### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java,v retrieving revision 1.118 diff -u -r1.118 BlockScope.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java 5 Jul 2010 14:18:49 -0000 1.118 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java 10 Sep 2010 19:23:21 -0000 @@ -879,7 +879,7 @@ * to abort. */ public ProblemReporter problemReporter() { - return outerMostMethodScope().problemReporter(); + return methodScope().problemReporter(); } /* Index: compiler/org/eclipse/jdt/internal/compiler/lookup/MethodScope.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodScope.java,v retrieving revision 1.74 diff -u -r1.74 MethodScope.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/MethodScope.java 20 May 2010 14:12:02 -0000 1.74 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/MethodScope.java 10 Sep 2010 19:23:21 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 2010 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 @@ -403,13 +403,9 @@ * to abort. */ public ProblemReporter problemReporter() { - MethodScope outerMethodScope; - if ((outerMethodScope = outerMostMethodScope()) == this) { - ProblemReporter problemReporter = referenceCompilationUnit().problemReporter; - problemReporter.referenceContext = this.referenceContext; - return problemReporter; - } - return outerMethodScope.problemReporter(); + ProblemReporter problemReporter = referenceCompilationUnit().problemReporter; + problemReporter.referenceContext = this.referenceContext; + return problemReporter; } public final int recordInitializationStates(FlowInfo flowInfo) { #P org.eclipse.jdt.core.tests.compiler Index: src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_3.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_3.java,v retrieving revision 1.107 diff -u -r1.107 Compliance_1_3.java --- src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_3.java 1 Jul 2010 04:39:13 -0000 1.107 +++ src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_3.java 10 Sep 2010 19:23:21 -0000 @@ -38,6 +38,10 @@ options.put(CompilerOptions.OPTION_ReportInvalidJavadoc, CompilerOptions.ERROR); options.put(CompilerOptions.OPTION_ReportInvalidJavadocTags, CompilerOptions.ENABLED); } + options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE); + options.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.IGNORE); + options.put(CompilerOptions.OPTION_ReportUnusedParameter, CompilerOptions.IGNORE); + options.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE); return options; } public static Test suite() { @@ -1676,12 +1680,7 @@ "}" }, "----------\n" + - "1. WARNING in p\\A.java (at line 6)\n" + - " private int i;\n" + - " ^\n" + - "The field A.i is never read locally\n" + - "----------\n" + - "2. ERROR in p\\A.java (at line 8)\n" + + "1. ERROR in p\\A.java (at line 8)\n" + " int x = i;\n" + " ^\n" + "Cannot make a static reference to the non-static field i\n" + @@ -1999,12 +1998,6 @@ " Z someField; \n" + " ^\n" + "The type Z is defined in an inherited type and an enclosing scope\n" + - "----------\n" + - "----------\n" + - "1. WARNING in q\\Y.java (at line 3)\n" + - " private static class X {} \n" + - " ^\n" + - "The type Y.X is never used locally\n" + "----------\n"); } @@ -2874,11 +2867,6 @@ " this.super();\n" + " ^^^^\n" + "Illegal enclosing instance specification for type Object\n" + - "----------\n" + - "3. WARNING in p\\X.java (at line 25)\n" + - " private void a() { System.out.println(\"A\");} \n" + - " ^^^\n" + - "The method a() from the type X is never used locally\n" + "----------\n"); } /* Index: src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_5.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_5.java,v retrieving revision 1.87 diff -u -r1.87 Compliance_1_5.java --- src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_5.java 1 Jul 2010 04:39:13 -0000 1.87 +++ src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_5.java 10 Sep 2010 19:23:21 -0000 @@ -40,6 +40,10 @@ options.put(CompilerOptions.OPTION_ReportInvalidJavadoc, CompilerOptions.ERROR); options.put(CompilerOptions.OPTION_ReportInvalidJavadocTags, CompilerOptions.ENABLED); } + options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE); + options.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.IGNORE); + options.put(CompilerOptions.OPTION_ReportUnusedParameter, CompilerOptions.IGNORE); + options.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE); return options; } public static Test suite() { @@ -1752,12 +1756,7 @@ "}" }, "----------\n" + - "1. WARNING in p\\A.java (at line 6)\n" + - " private int i;\n" + - " ^\n" + - "The field A.i is never read locally\n" + - "----------\n" + - "2. ERROR in p\\A.java (at line 8)\n" + + "1. ERROR in p\\A.java (at line 8)\n" + " int x = i;\n" + " ^\n" + "Cannot make a static reference to the non-static field i\n" + @@ -1984,26 +1983,11 @@ "}", }, // compiler results - "----------\n" + /* expected compiler log */ - "1. WARNING in p\\FieldQualification.java (at line 5)\n" + - " class Local {\n" + - " ^^^^^\n" + - "The type Local is never used locally\n" + "----------\n" + - "2. WARNING in p\\FieldQualification.java (at line 6)\n" + + "1. WARNING in p\\FieldQualification.java (at line 6)\n" + " String field = \"Enclosing field for anonymous type\";\n" + " ^^^^^\n" + "The field Local.field is hiding a field from type FieldQualification\n" + - "----------\n" + - "3. WARNING in p\\FieldQualification.java (at line 6)\n" + - " String field = \"Enclosing field for anonymous type\";\n" + - " ^^^^^\n" + - "The field Local.field is never read locally\n" + - "----------\n" + - "4. WARNING in p\\FieldQualification.java (at line 7)\n" + - " void foo() {\n" + - " ^^^^^\n" + - "The method foo() from the type Local is never used locally\n" + "----------\n", // runtime results null /* do not check output string */, @@ -2066,17 +2050,12 @@ "} \n" }, // compiler results - "----------\n" + /* expected compiler log */ - "1. WARNING in q\\Y.java (at line 3)\n" + - " private static class X {} \n" + - " ^\n" + - "The type Y.X is never used locally\n" + - "----------\n", + "", // runtime results null /* do not check output string */, null /* do not check error string */, // javac options - JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings /* javac test options */); + JavacTestOptions.DEFAULT /* javac test options */); } /* * http://bugs.eclipse.org/bugs/show_bug.cgi?id=11435 @@ -2948,27 +2927,7 @@ " ^^^^\n" + "Illegal enclosing instance specification for type Object\n" + "----------\n" + - "3. WARNING in p\\X.java (at line 25)\n" + - " private void a() { System.out.println(\"A\");} \n" + - " ^^^\n" + - "The method a() from the type X is never used locally\n" + - "----------\n" + - "4. WARNING in p\\X.java (at line 31)\n" + - " Class c = b.getClass();\n" + - " ^^^^^\n" + - "Class is a raw type. References to generic type Class should be parameterized\n" + - "----------\n" + - "5. WARNING in p\\X.java (at line 32)\n" + - " Class _getClasses [] = X.class.getClasses(); \n" + - " ^^^^^\n" + - "Class is a raw type. References to generic type Class should be parameterized\n" + - "----------\n" + - "6. WARNING in p\\X.java (at line 36)\n" + - " Constructor _getConstructors[] = c.getConstructors(); \n" + - " ^^^^^^^^^^^\n" + - "Constructor is a raw type. References to generic type Constructor should be parameterized\n" + - "----------\n" + - "7. WARNING in p\\X.java (at line 39)\n" + + "3. WARNING in p\\X.java (at line 39)\n" + " Method _getMethod = c.getMethod(\"d\",null);\n" + " ^^^^^^^^^^^^^^^^^^^^^\n" + "The argument of type null should explicitly be cast to Class[] for the invocation of the varargs method getMethod(String, Class...) from type Class. It could alternatively be cast to Class for a varargs invocation\n" + @@ -2986,32 +2945,12 @@ " ^^^^\n" + "Illegal enclosing instance specification for type Object\n" + "----------\n" + - "3. WARNING in p\\X.java (at line 25)\n" + - " private void a() { System.out.println(\"A\");} \n" + - " ^^^\n" + - "The method a() from the type X is never used locally\n" + - "----------\n" + - "4. WARNING in p\\X.java (at line 31)\n" + - " Class c = b.getClass();\n" + - " ^^^^^\n" + - "Class is a raw type. References to generic type Class should be parameterized\n" + - "----------\n" + - "5. WARNING in p\\X.java (at line 32)\n" + - " Class _getClasses [] = X.class.getClasses(); \n" + - " ^^^^^\n" + - "Class is a raw type. References to generic type Class should be parameterized\n" + - "----------\n" + - "6. WARNING in p\\X.java (at line 36)\n" + - " Constructor _getConstructors[] = c.getConstructors(); \n" + - " ^^^^^^^^^^^\n" + - "Constructor is a raw type. References to generic type Constructor should be parameterized\n" + - "----------\n" + - "7. WARNING in p\\X.java (at line 39)\n" + + "3. WARNING in p\\X.java (at line 39)\n" + " Method _getMethod = c.getMethod(\"d\",null);\n" + " ^^^^^^^^^^^^^^^^^^^^^\n" + "The argument of type null should explicitly be cast to Class[] for the invocation of the varargs method getMethod(String, Class...) from type Class. It could alternatively be cast to Class for a varargs invocation\n" + "----------\n" + - "8. WARNING in p\\X.java (at line 39)\n" + + "4. WARNING in p\\X.java (at line 39)\n" + " Method _getMethod = c.getMethod(\"d\",null);\n" + " ^^^^^^^^^^^^^^^^^^^^^\n" + "Type safety: The method getMethod(String, Class...) belongs to the raw type Class. References to generic type Class should be parameterized\n" + Index: src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java,v retrieving revision 1.153 diff -u -r1.153 EnumTest.java --- src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java 11 May 2010 18:53:50 -0000 1.153 +++ src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java 10 Sep 2010 19:23:21 -0000 @@ -53,6 +53,9 @@ options.put(CompilerOptions.OPTION_ReportMissingJavadocTags, CompilerOptions.ERROR); options.put(CompilerOptions.OPTION_ReportMissingJavadocTagsVisibility, CompilerOptions.PRIVATE); options.put(CompilerOptions.OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation, CompilerOptions.DISABLED); + options.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.IGNORE); + options.put(CompilerOptions.OPTION_ReportUnusedParameter, CompilerOptions.IGNORE); + options.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE); if (this.reportMissingJavadocComments != null) options.put(CompilerOptions.OPTION_ReportMissingJavadocComments, this.reportMissingJavadocComments); return options; @@ -3755,12 +3758,7 @@ "}\n", }, "----------\n" + - "1. WARNING in X.java (at line 3)\n" + - " static int bar;\n" + - " ^^^\n" + - "The field new BugDemo(){}.bar is never read locally\n" + - "----------\n" + - "2. ERROR in X.java (at line 3)\n" + + "1. ERROR in X.java (at line 3)\n" + " static int bar;\n" + " ^^^\n" + "The field bar cannot be declared static; static fields can only be declared in static or top level types\n" + @@ -6193,12 +6191,7 @@ "}\n" }, null, customOptions, - "----------\n" + - "1. WARNING in X.java (at line 8)\n" + - " private enum Complaint { WARNING, ERROR, FATAL_ERROR, PANIC;\n" + - " ^^^^^^^^^\n" + - "The type X.Complaint is never used locally\n" + - "----------\n", + "", "HELLORED", null, JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings); } Index: src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java,v retrieving revision 1.825 diff -u -r1.825 GenericTypeTest.java --- src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java 26 Jul 2010 06:32:15 -0000 1.825 +++ src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java 10 Sep 2010 19:23:22 -0000 @@ -30,7 +30,7 @@ // Static initializer to specify tests subset using TESTS_* static variables // All specified tests which does not belong to the class are skipped... static { -// TESTS_NAMES = new String[] { "test1464" }; +// TESTS_NAMES = new String[] { "test1203c", "test1203d" }; // TESTS_NUMBERS = new int[] { 1465 }; // TESTS_RANGE = new int[] { 1097, -1 }; } @@ -43,9 +43,12 @@ } protected Map getCompilerOptions() { - Map compilerOptions = super.getCompilerOptions(); - compilerOptions.put(CompilerOptions.OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation, CompilerOptions.DISABLED); - return compilerOptions; + Map options = super.getCompilerOptions(); + options.put(CompilerOptions.OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation, CompilerOptions.DISABLED); + options.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.IGNORE); + options.put(CompilerOptions.OPTION_ReportUnusedParameter, CompilerOptions.IGNORE); + options.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE); + return options; } public void test0001() { @@ -14393,17 +14396,6 @@ "}\n" }, "----------\n" + - "1. WARNING in test\\Foo.java (at line 4)\n" + - " private R dosomething(){ return s; } \n" + - " ^^^^^^^^^^^^^\n" + - "The method dosomething() from the type Foo is never used locally\n" + - "----------\n" + - "2. WARNING in test\\Foo.java (at line 5)\n" + - " private class Bar {} \n" + - " ^^^\n" + - "The type Foo.Bar is never used locally\n" + - "----------\n" + - "----------\n" + "1. ERROR in test02\\FooBar.java (at line 6)\n" + " f.s = \"foo\"; \n" + " ^\n" + @@ -19118,12 +19110,7 @@ " private static class Bucket extends LinkedList> {}\n" + " ^\n" + "Cannot make a static reference to the non-static type V\n" + - "----------\n" + - "3. WARNING in X.java (at line 7)\n" + - " private Bucket[] buckets = new X.Bucket[100];\n" + - " ^^^^^^^\n" + - "The field X.buckets is never read locally\n" + - "----------\n"); + "----------\n"); } //https://bugs.eclipse.org/bugs/show_bug.cgi?id=84973 public void test0613() { @@ -25832,27 +25819,12 @@ "}\n", }, "----------\n" + - "1. WARNING in X.java (at line 2)\n" + - " private T t;\n" + - " ^\n" + - "The field X.t is never read locally\n" + - "----------\n" + - "2. WARNING in X.java (at line 3)\n" + - " private X.Inner inner;\n" + - " ^^^^^\n" + - "The field X.inner is never read locally\n" + - "----------\n" + - "3. WARNING in X.java (at line 4)\n" + - " private X.Inner[] inners;\n" + - " ^^^^^^\n" + - "The field X.inners is never read locally\n" + - "----------\n" + - "4. WARNING in X.java (at line 7)\n" + + "1. WARNING in X.java (at line 7)\n" + " this.inner = new X.Inner();\n" + " ^^^^^^^\n" + "X.Inner is a raw type. References to generic type X.Inner should be parameterized\n" + "----------\n" + - "5. ERROR in X.java (at line 9)\n" + + "2. ERROR in X.java (at line 9)\n" + " Zork z;\n" + " ^^^^\n" + "Zork cannot be resolved to a type\n" + @@ -26020,47 +25992,42 @@ "}\n", }, "----------\n" + - "1. WARNING in X.java (at line 4)\n" + - " private T t;\n" + - " ^\n" + - "The field X.t is never read locally\n" + - "----------\n" + - "2. WARNING in X.java (at line 9)\n" + + "1. WARNING in X.java (at line 9)\n" + " if (this.inner instanceof X.Inner) {}\n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "The expression of type X.Inner is already an instance of type X.Inner\n" + "----------\n" + - "3. WARNING in X.java (at line 10)\n" + + "2. WARNING in X.java (at line 10)\n" + " if (this.inners instanceof X.Inner[]) {}\n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "The expression of type X.Inner[] is already an instance of type X.Inner[]\n" + "----------\n" + - "4. WARNING in X.java (at line 14)\n" + + "3. WARNING in X.java (at line 14)\n" + " void foo(List l) {\n" + " ^^^^\n" + "List is a raw type. References to generic type List should be parameterized\n" + "----------\n" + - "5. WARNING in X.java (at line 15)\n" + + "4. WARNING in X.java (at line 15)\n" + " if (l instanceof List) {}\n" + " ^^^^^^^^^^^^^^^^^\n" + "The expression of type List is already an instance of type List\n" + "----------\n" + - "6. ERROR in X.java (at line 16)\n" + + "5. ERROR in X.java (at line 16)\n" + " if (l instanceof List) {}\n" + " ^^^^^^^^^^^^^^^^^\n" + "Cannot perform instanceof check against parameterized type List. Use the form List instead since further generic type information will be erased at runtime\n" + "----------\n" + - "7. WARNING in X.java (at line 18)\n" + + "6. WARNING in X.java (at line 18)\n" + " void foo(List[] ls) {\n" + " ^^^^\n" + "List is a raw type. References to generic type List should be parameterized\n" + "----------\n" + - "8. WARNING in X.java (at line 19)\n" + + "7. WARNING in X.java (at line 19)\n" + " if (ls instanceof List[]) {}\n" + " ^^^^^^^^^^^^^^^^^^^^^^^\n" + "The expression of type List[] is already an instance of type List\n" + "----------\n" + - "9. ERROR in X.java (at line 20)\n" + + "8. ERROR in X.java (at line 20)\n" + " if (ls instanceof List[]) {}\n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "Cannot perform instanceof check against parameterized type List[]. Use the form List[] instead since further generic type information will be erased at runtime\n" + @@ -32552,27 +32519,22 @@ "}\n", // ================= }, "----------\n" + - "1. WARNING in X.java (at line 5)\n" + - " private T aObject = null;\n" + - " ^^^^^^^\n" + - "The field X.aObject is never read locally\n" + - "----------\n" + - "2. ERROR in X.java (at line 20)\n" + + "1. ERROR in X.java (at line 20)\n" + " final List> l2 = castList(l1, List.class);\n" + " ^^^^^^^^^^^^^^^^^^^^^^^^\n" + "Type mismatch: cannot convert from List to List>\n" + "----------\n" + - "3. WARNING in X.java (at line 22)\n" + + "2. WARNING in X.java (at line 22)\n" + " List l3 = l2;\n" + " ^\n" + "X is a raw type. References to generic type X should be parameterized\n" + "----------\n" + - "4. ERROR in X.java (at line 22)\n" + + "3. ERROR in X.java (at line 22)\n" + " List l3 = l2;\n" + " ^^\n" + "Type mismatch: cannot convert from List> to List\n" + "----------\n" + - "5. ERROR in X.java (at line 24)\n" + + "4. ERROR in X.java (at line 24)\n" + " l3 = l4;\n" + " ^^\n" + "Type mismatch: cannot convert from List> to List\n" + @@ -36767,30 +36729,10 @@ " ^\n" + "The nested type T is hiding the type parameter T of type Y\n" + "----------\n" + - "4. WARNING in X.java (at line 11)\n" + - " class T {}; // hiding warning\n" + - " ^\n" + - "The type T is never used locally\n" + - "----------\n" + - "5. WARNING in X.java (at line 12)\n" + + "4. WARNING in X.java (at line 12)\n" + " class Local {};\n" + " ^^^^^\n" + "The type Local is hiding the type Y.Local\n" + - "----------\n" + - "6. WARNING in X.java (at line 12)\n" + - " class Local {};\n" + - " ^^^^^\n" + - "The type Local is never used locally\n" + - "----------\n" + - "7. WARNING in X.java (at line 15)\n" + - " class T {}; // no hiding warning\n" + - " ^\n" + - "The type T is never used locally\n" + - "----------\n" + - "8. WARNING in X.java (at line 16)\n" + - " class Local {}; // no hiding warning\n" + - " ^^^^^\n" + - "The type Local is never used locally\n" + "----------\n"); } //https://bugs.eclipse.org/bugs/show_bug.cgi?id=165679 - variation @@ -38111,27 +38053,22 @@ "}", // ================= }, "----------\n" + - "1. WARNING in X.java (at line 7)\n" + - " private final T theGenericThing;\n" + - " ^^^^^^^^^^^^^^^\n" + - "The field X.theGenericThing is never read locally\n" + - "----------\n" + - "2. WARNING in X.java (at line 13)\n" + + "1. WARNING in X.java (at line 13)\n" + " public static class InnerClassThatShowsBug extends X {\n" + " ^\n" + "X is a raw type. References to generic type X should be parameterized\n" + "----------\n" + - "3. WARNING in X.java (at line 15)\n" + + "2. WARNING in X.java (at line 15)\n" + " super(null);\n" + " ^^^^^^^^^^^^\n" + "Type safety: The constructor X(Object) belongs to the raw type X. References to generic type X should be parameterized\n" + "----------\n" + - "4. WARNING in X.java (at line 15)\n" + + "3. WARNING in X.java (at line 15)\n" + " super(null);\n" + " ^^^^^^^^^^^^\n" + "Access to enclosing constructor X(T) is emulated by a synthetic accessor method\n" + "----------\n" + - "5. ERROR in X.java (at line 19)\n" + + "4. ERROR in X.java (at line 19)\n" + " for (Map.Entry entry : myMap().entrySet()) {\n" + " ^^^^^^^^^^^^^^^^^^\n" + "Type mismatch: cannot convert from element type Object to Map.Entry\n" + @@ -39571,42 +39508,27 @@ "}\n", // ================= }, "----------\n" + - "1. WARNING in X.java (at line 3)\n" + - " private final Object mDependent = new Object() {\n" + - " ^^^^^^^^^^\n" + - "The field X.mDependent is never read locally\n" + - "----------\n" + - "2. WARNING in X.java (at line 5)\n" + + "1. WARNING in X.java (at line 5)\n" + " Object o1 = mObj;\n" + " ^^^^\n" + "Read access to enclosing field X.mObj is emulated by a synthetic accessor method\n" + "----------\n" + - "3. ERROR in X.java (at line 5)\n" + + "2. ERROR in X.java (at line 5)\n" + " Object o1 = mObj;\n" + " ^^^^\n" + "The blank final field mObj may not have been initialized\n" + "----------\n" + - "4. WARNING in X.java (at line 7)\n" + - " Object o2 = mObj;\n" + - " ^^\n" + - "The field new Object(){}.o2 is never read locally\n" + - "----------\n" + - "5. WARNING in X.java (at line 7)\n" + + "3. WARNING in X.java (at line 7)\n" + " Object o2 = mObj;\n" + " ^^^^\n" + "Read access to enclosing field X.mObj is emulated by a synthetic accessor method\n" + "----------\n" + - "6. ERROR in X.java (at line 7)\n" + + "4. ERROR in X.java (at line 7)\n" + " Object o2 = mObj;\n" + " ^^^^\n" + "The blank final field mObj may not have been initialized\n" + "----------\n" + - "7. WARNING in X.java (at line 8)\n" + - " void foo() {\n" + - " ^^^^^\n" + - "The method foo() from the type new Object(){} is never used locally\n" + - "----------\n" + - "8. WARNING in X.java (at line 9)\n" + + "5. WARNING in X.java (at line 9)\n" + " Object o3 = mObj;\n" + " ^^^^\n" + "Read access to enclosing field X.mObj is emulated by a synthetic accessor method\n" + @@ -39636,62 +39558,47 @@ "}\n" }, "----------\n" + - "1. WARNING in X.java (at line 3)\n" + - " private final Object mDependent = new Object() {\n" + - " ^^^^^^^^^^\n" + - "The field X.mDependent is never read locally\n" + - "----------\n" + - "2. WARNING in X.java (at line 5)\n" + + "1. WARNING in X.java (at line 5)\n" + " Object o1 = mObj;\n" + " ^^^^\n" + "Read access to enclosing field X.mObj is emulated by a synthetic accessor method\n" + "----------\n" + - "3. ERROR in X.java (at line 5)\n" + + "2. ERROR in X.java (at line 5)\n" + " Object o1 = mObj;\n" + " ^^^^\n" + "The blank final field mObj may not have been initialized\n" + "----------\n" + - "4. WARNING in X.java (at line 6)\n" + + "3. WARNING in X.java (at line 6)\n" + " mObj = \"1\";\n" + " ^^^^\n" + "Write access to enclosing field X.mObj is emulated by a synthetic accessor method\n" + "----------\n" + - "5. ERROR in X.java (at line 6)\n" + + "4. ERROR in X.java (at line 6)\n" + " mObj = \"1\";\n" + " ^^^^\n" + "The final field X.mObj cannot be assigned\n" + "----------\n" + - "6. WARNING in X.java (at line 8)\n" + - " Object o2 = mObj = \"2\";\n" + - " ^^\n" + - "The field new Object(){}.o2 is never read locally\n" + - "----------\n" + - "7. WARNING in X.java (at line 8)\n" + + "5. WARNING in X.java (at line 8)\n" + " Object o2 = mObj = \"2\";\n" + " ^^^^\n" + "Write access to enclosing field X.mObj is emulated by a synthetic accessor method\n" + "----------\n" + - "8. ERROR in X.java (at line 8)\n" + + "6. ERROR in X.java (at line 8)\n" + " Object o2 = mObj = \"2\";\n" + " ^^^^\n" + "The final field X.mObj cannot be assigned\n" + "----------\n" + - "9. WARNING in X.java (at line 9)\n" + - " void foo() {\n" + - " ^^^^^\n" + - "The method foo() from the type new Object(){} is never used locally\n" + - "----------\n" + - "10. WARNING in X.java (at line 10)\n" + + "7. WARNING in X.java (at line 10)\n" + " Object o3 = mObj;\n" + " ^^^^\n" + "Read access to enclosing field X.mObj is emulated by a synthetic accessor method\n" + "----------\n" + - "11. WARNING in X.java (at line 11)\n" + + "8. WARNING in X.java (at line 11)\n" + " mObj = \"3\";\n" + " ^^^^\n" + "Write access to enclosing field X.mObj is emulated by a synthetic accessor method\n" + "----------\n" + - "12. ERROR in X.java (at line 11)\n" + + "9. ERROR in X.java (at line 11)\n" + " mObj = \"3\";\n" + " ^^^^\n" + "The final field X.mObj cannot be assigned\n" + @@ -41031,7 +40938,7 @@ String[] sources = new String[] { "X.java", - "class X extends Y {\n" + + "public class X extends Y {\n" + " public static void main(String[] args) {\n" + " String s = \"\";\n" + " new X(). a(s);\n" + // fails before 7 @@ -41113,7 +41020,7 @@ String[] sources = new String[] { "X.java", - "class X implements I {\n" + + "public class X implements I {\n" + " public static void main(String[] args) {\n" + " String s = \"\";\n" + " new X(). a(s);\n" + // fails before 7 @@ -41580,12 +41487,7 @@ "The type A.P is not visible\n" + "----------\n" + "----------\n" + - "1. WARNING in p\\A.java (at line 9)\n" + - " public int pval;\n" + - " ^^^^\n" + - "The field A.P.pval is never read locally\n" + - "----------\n" + - "2. WARNING in p\\A.java (at line 18)\n" + + "1. WARNING in p\\A.java (at line 18)\n" + " this.box.set(new P());\n" + " ^^^^^^^\n" + "Access to enclosing constructor A.P() is emulated by a synthetic accessor method\n" + @@ -42618,11 +42520,6 @@ " public class X {\n" + " ^^^^^^^^^^^^^^^^^\n" + "The type Secondary.Private is not visible\n" + - "----------\n" + - "2. WARNING in X.java (at line 4)\n" + - " static private class Private {}\n" + - " ^^^^^^^\n" + - "The type Secondary.Private is never used locally\n" + "----------\n"); } //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216100 - variation @@ -46336,7 +46233,7 @@ "done"); } //https://bugs.eclipse.org/bugs/show_bug.cgi?id=185422 -public void _test1357() { +public void test1357() { this.runNegativeTest( new String[] { "X.java", // ================= @@ -46358,10 +46255,20 @@ " private static interface SecondaryPrivate {}\n" + "}\n", // ================= }, - "done"); + "----------\n" + + "1. ERROR in X.java (at line 8)\n" + + " public abstract class X implements Map {\n" + + " ^^^^^^^^^\n" + + "The type X.Private is not visible\n" + + "----------\n" + + "2. ERROR in X.java (at line 8)\n" + + " public abstract class X implements Map {\n" + + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + + "The type Secondary.SecondaryPrivate is not visible\n" + + "----------\n"); } //https://bugs.eclipse.org/bugs/show_bug.cgi?id=185422 - variation -public void _test1358() { +public void test1358() { this.runNegativeTest( new String[] { "X.java", // ================= @@ -46376,7 +46283,12 @@ " Inter.Private field;\n" + "}\n", // ================= }, - "done"); + "----------\n" + + "1. ERROR in X.java (at line 2)\n" + + " public abstract class X implements List {\n" + + " ^^^^^^^^^^^^^^^\n" + + "The type X.Inter.Private is not visible\n" + + "----------\n"); } //https://bugs.eclipse.org/bugs/show_bug.cgi?id=185422 - variation public void test1359() { @@ -50500,12 +50412,7 @@ "interface IReferencedInterface extends IRecursiveInterface {}\n" }, "----------\n" + - "1. WARNING in AnotherClass.java (at line 3)\n" + - " private AnotherClass m_var;\n" + - " ^^^^^\n" + - "The field ImplementingClass.m_var is never read locally\n" + - "----------\n" + - "2. ERROR in AnotherClass.java (at line 5)\n" + + "1. ERROR in AnotherClass.java (at line 5)\n" + " m_var = a;\n" + " ^\n" + "Type mismatch: cannot convert from AnotherClass to AnotherClass\n" + Index: src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest.java,v retrieving revision 1.61 diff -u -r1.61 InnerEmulationTest.java --- src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest.java 22 Jul 2010 18:49:01 -0000 1.61 +++ src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest.java 10 Sep 2010 19:23:23 -0000 @@ -11,6 +11,7 @@ package org.eclipse.jdt.core.tests.compiler.regression; import java.io.File; +import java.util.Map; import junit.framework.Test; @@ -31,6 +32,14 @@ public InnerEmulationTest(String name) { super(name); } +protected Map getCompilerOptions() { + Map options = super.getCompilerOptions(); + options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE); + options.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.IGNORE); + options.put(CompilerOptions.OPTION_ReportUnusedParameter, CompilerOptions.IGNORE); + options.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE); + return options; +} public static Test suite() { return buildAllCompliancesTestSuite(testClass()); } @@ -1460,19 +1469,9 @@ "1. WARNING in p1\\A2.java (at line 18)\n" + " private class C extends B { \n" + " ^\n" + - "The type A2.C is never used locally\n" + - "----------\n" + - "2. WARNING in p1\\A2.java (at line 18)\n" + - " private class C extends B { \n" + - " ^\n" + "Access to enclosing constructor A2.B() is emulated by a synthetic accessor method\n" + "----------\n" + - "3. WARNING in p1\\A2.java (at line 19)\n" + - " public void foo() { \n" + - " ^^^^^\n" + - "The method foo() from the type A2.C is never used locally\n" + - "----------\n" + - "4. ERROR in p1\\A2.java (at line 20)\n" + + "2. ERROR in p1\\A2.java (at line 20)\n" + " (new D.E(null, null, null, new F(get()) {}) {}).execute(); \n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "No enclosing instance of type D is accessible. Must qualify the allocation with an enclosing instance of type D (e.g. x.new A() where x is an instance of D).\n" + @@ -1553,19 +1552,9 @@ "1. WARNING in p1\\A2.java (at line 18)\n" + " private class C extends B { \n" + " ^\n" + - "The type A2.C is never used locally\n" + - "----------\n" + - "2. WARNING in p1\\A2.java (at line 18)\n" + - " private class C extends B { \n" + - " ^\n" + "Access to enclosing constructor A2.B() is emulated by a synthetic accessor method\n" + "----------\n" + - "3. WARNING in p1\\A2.java (at line 19)\n" + - " public void foo() { \n" + - " ^^^^^\n" + - "The method foo() from the type A2.C is never used locally\n" + - "----------\n" + - "4. ERROR in p1\\A2.java (at line 20)\n" + + "2. ERROR in p1\\A2.java (at line 20)\n" + " (new D.E(null, null, null, new F(get()) {})).execute(); \n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "No enclosing instance of type D is accessible. Must qualify the allocation with an enclosing instance of type D (e.g. x.new A() where x is an instance of D).\n" + @@ -2990,18 +2979,13 @@ "} \n" }, "----------\n" + - "1. WARNING in X.java (at line 7)\n" + - " class B extends X { \n" + - " ^\n" + - "The type B is never used locally\n" + - "----------\n" + - "2. ERROR in X.java (at line 9)\n" + + "1. ERROR in X.java (at line 9)\n" + " super(new A(){ \n" + " }); \n" + " ^^^^^^^^^^^^^^^\n" + "No enclosing instance of type X is available due to some intermediate constructor invocation\n" + "----------\n" + - "3. WARNING in X.java (at line 9)\n" + + "2. WARNING in X.java (at line 9)\n" + " super(new A(){ \n" + " ^^^\n" + "Access to enclosing constructor A() is emulated by a synthetic accessor method\n" + @@ -3028,12 +3012,7 @@ "} \n" }, "----------\n" + - "1. WARNING in X.java (at line 7)\n" + - " class B extends X { \n" + - " ^\n" + - "The type B is never used locally\n" + - "----------\n" + - "2. ERROR in X.java (at line 9)\n" + + "1. ERROR in X.java (at line 9)\n" + " super(new A(){ \n" + " }); \n" + " ^^^^^^^^^^^^^^^\n" + @@ -3120,29 +3099,19 @@ "} \n" }, "----------\n" + - "1. WARNING in X.java (at line 7)\n" + - " class B extends X { \n" + - " ^\n" + - "The type B is never used locally\n" + - "----------\n" + - "2. ERROR in X.java (at line 9)\n" + + "1. ERROR in X.java (at line 9)\n" + " super(new A(){ \n" + " void foo() { System.out.println(X.this); } \n" + " }); \n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "No enclosing instance of type X is available due to some intermediate constructor invocation\n" + "----------\n" + - "3. WARNING in X.java (at line 9)\n" + + "2. WARNING in X.java (at line 9)\n" + " super(new A(){ \n" + " ^^^\n" + "Access to enclosing constructor A() is emulated by a synthetic accessor method\n" + "----------\n" + - "4. WARNING in X.java (at line 10)\n" + - " void foo() { System.out.println(X.this); } \n" + - " ^^^^^\n" + - "The method foo() from the type new A(){} is never used locally\n" + - "----------\n" + - "5. ERROR in X.java (at line 10)\n" + + "3. ERROR in X.java (at line 10)\n" + " void foo() { System.out.println(X.this); } \n" + " ^^^^^^\n" + "No enclosing instance of the type X is accessible in scope\n" + @@ -3170,24 +3139,14 @@ "} \n" }, "----------\n" + - "1. WARNING in X.java (at line 7)\n" + - " class B extends X { \n" + - " ^\n" + - "The type B is never used locally\n" + - "----------\n" + - "2. ERROR in X.java (at line 9)\n" + + "1. ERROR in X.java (at line 9)\n" + " super(new A(){ \n" + " void foo() { System.out.println(X.this); } \n" + " }); \n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "No enclosing instance of type X is available due to some intermediate constructor invocation\n" + "----------\n" + - "3. WARNING in X.java (at line 10)\n" + - " void foo() { System.out.println(X.this); } \n" + - " ^^^^^\n" + - "The method foo() from the type new A(){} is never used locally\n" + - "----------\n" + - "4. ERROR in X.java (at line 10)\n" + + "2. ERROR in X.java (at line 10)\n" + " void foo() { System.out.println(X.this); } \n" + " ^^^^^^\n" + "No enclosing instance of the type X is accessible in scope\n" + @@ -3385,12 +3344,7 @@ "} \n" }, "----------\n" + - "1. WARNING in X.java (at line 10)\n" + - " X x = X.this; \n" + - " ^\n" + - "The field new B(){}.x is never read locally\n" + - "----------\n" + - "2. ERROR in X.java (at line 10)\n" + + "1. ERROR in X.java (at line 10)\n" + " X x = X.this; \n" + " ^^^^^^\n" + "No enclosing instance of the type X is accessible in scope\n" + @@ -3938,12 +3892,7 @@ "} ", }, "----------\n" + - "1. WARNING in X.java (at line 9)\n" + - " private static class B extends X.Y implements X.Z { \n" + - " ^\n" + - "The type A.B is never used locally\n" + - "----------\n" + - "2. ERROR in X.java (at line 11)\n" + + "1. ERROR in X.java (at line 11)\n" + " super(B.this); \n" + " ^^^^^^\n" + "Cannot refer to \'this\' nor \'super\' while explicitly invoking a constructor\n" + @@ -3967,12 +3916,7 @@ "}", }, "----------\n" + - "1. WARNING in X.java (at line 5)\n" + - " class Local2 extends Local1 {\n" + - " ^^^^^^\n" + - "The type Local2 is never used locally\n" + - "----------\n" + - "2. ERROR in X.java (at line 5)\n" + + "1. ERROR in X.java (at line 5)\n" + " class Local2 extends Local1 {\n" + " ^^^^^^\n" + "No enclosing instance of type X is available due to some intermediate constructor invocation\n" + @@ -4020,22 +3964,7 @@ "}" }, "----------\n" + - "1. WARNING in X.java (at line 4)\n" + - " public void foo() {\n" + - " ^^^^^\n" + - "The method foo() from the type C is never used locally\n" + - "----------\n" + - "2. WARNING in X.java (at line 9)\n" + - " public void foo() {\n" + - " ^^^^^\n" + - "The method foo() from the type new X(){} is never used locally\n" + - "----------\n" + - "3. WARNING in X.java (at line 13)\n" + - " class D extends C {\n" + - " ^\n" + - "The type D is never used locally\n" + - "----------\n" + - "4. ERROR in X.java (at line 13)\n" + + "1. ERROR in X.java (at line 13)\n" + " class D extends C {\n" + " ^\n" + "No enclosing instance of type X is available due to some intermediate constructor invocation\n" + @@ -4319,11 +4248,6 @@ " bar();\n" + " ^^^\n" + "Cannot refer to an instance method while explicitly invoking a constructor\n" + - "----------\n" + - "2. WARNING in X.java (at line 22)\n" + - " void baz() {\n" + - " ^^^^^\n" + - "The method baz() from the type new Object(){} is never used locally\n" + "----------\n"); } public void test119() { @@ -4380,21 +4304,6 @@ " foo(\"0\");\n" + " ^^^^^^^^\n" + "No enclosing instance of the type X is accessible in scope\n" + - "----------\n" + - "2. WARNING in X.java (at line 13)\n" + - " void baz() {\n" + - " ^^^^^\n" + - "The method baz() from the type new Object(){} is never used locally\n" + - "----------\n" + - "3. WARNING in X.java (at line 18)\n" + - " void baz() {\n" + - " ^^^^^\n" + - "The method baz() from the type Local is never used locally\n" + - "----------\n" + - "4. WARNING in X.java (at line 35)\n" + - " void baz() {\n" + - " ^^^^^\n" + - "The method baz() from the type new Object(){} is never used locally\n" + "----------\n"); return; } @@ -4493,45 +4402,20 @@ "}\n", }, "----------\n" + - "1. WARNING in X.java (at line 7)\n" + - " void baz() {\n" + - " ^^^^^\n" + - "The method baz() from the type new Object(){} is never used locally\n" + - "----------\n" + - "2. WARNING in X.java (at line 9)\n" + - " void baz() {\n" + - " ^^^^^\n" + - "The method baz() from the type new Object(){} is never used locally\n" + - "----------\n" + - "3. ERROR in X.java (at line 10)\n" + + "1. ERROR in X.java (at line 10)\n" + " foo(); //0\n" + " ^^^^^\n" + "No enclosing instance of the type X is accessible in scope\n" + "----------\n" + - "4. WARNING in X.java (at line 14)\n" + - " void baz() {\n" + - " ^^^^^\n" + - "The method baz() from the type Local is never used locally\n" + - "----------\n" + - "5. ERROR in X.java (at line 15)\n" + + "2. ERROR in X.java (at line 15)\n" + " foo(); //1\n" + " ^^^^^\n" + "No enclosing instance of the type X is accessible in scope\n" + "----------\n" + - "6. ERROR in X.java (at line 19)\n" + + "3. ERROR in X.java (at line 19)\n" + " foo();//2\n" + " ^^^^^\n" + "No enclosing instance of the type X is accessible in scope\n" + - "----------\n" + - "7. WARNING in X.java (at line 23)\n" + - " void baz() {\n" + - " ^^^^^\n" + - "The method baz() from the type new Object(){} is never used locally\n" + - "----------\n" + - "8. WARNING in X.java (at line 32)\n" + - " void baz() {\n" + - " ^^^^^\n" + - "The method baz() from the type new Object(){} is never used locally\n" + "----------\n"); return; } @@ -4574,30 +4458,10 @@ "}\n", }, "----------\n" + - "1. WARNING in X.java (at line 7)\n" + - " void baz() {\n" + - " ^^^^^\n" + - "The method baz() from the type new Object(){} is never used locally\n" + - "----------\n" + - "2. WARNING in X.java (at line 9)\n" + - " void baz() {\n" + - " ^^^^^\n" + - "The method baz() from the type Local is never used locally\n" + - "----------\n" + - "3. ERROR in X.java (at line 10)\n" + + "1. ERROR in X.java (at line 10)\n" + " foo(); //1\n" + " ^^^^^\n" + "No enclosing instance of the type X is accessible in scope\n" + - "----------\n" + - "4. WARNING in X.java (at line 18)\n" + - " void baz() {\n" + - " ^^^^^\n" + - "The method baz() from the type new Object(){} is never used locally\n" + - "----------\n" + - "5. WARNING in X.java (at line 27)\n" + - " void baz() {\n" + - " ^^^^^\n" + - "The method baz() from the type new Object(){} is never used locally\n" + "----------\n"); } public void test121() { @@ -5338,30 +5202,10 @@ "}", // ================= }, "----------\n" + - "1. WARNING in X.java (at line 3)\n" + - " class Local {}\n" + - " ^^^^^\n" + - "The type Local is never used locally\n" + - "----------\n" + - "2. WARNING in X.java (at line 4)\n" + - " class Foo {\n" + - " ^^^\n" + - "The type Foo is never used locally\n" + - "----------\n" + - "3. WARNING in X.java (at line 5)\n" + - " void foo() {\n" + - " ^^^^^\n" + - "The method foo() from the type Foo is never used locally\n" + - "----------\n" + - "4. WARNING in X.java (at line 6)\n" + + "1. WARNING in X.java (at line 6)\n" + " class Local {}\n" + " ^^^^^\n" + "The type Local is hiding the type Local\n" + - "----------\n" + - "5. WARNING in X.java (at line 6)\n" + - " class Local {}\n" + - " ^^^^^\n" + - "The type Local is never used locally\n" + "----------\n", "", "", @@ -5568,12 +5412,7 @@ "}", // =================, }, "----------\n" + - "1. WARNING in p\\X.java (at line 5)\n" + - " String variable = \"my testing\";\n" + - " ^^^^^^^^\n" + - "The field X.Outer.Inner.variable is never read locally\n" + - "----------\n" + - "2. ERROR in p\\X.java (at line 11)\n" + + "1. ERROR in p\\X.java (at line 11)\n" + " Zork z;\n" + " ^^^^\n" + "Zork cannot be resolved to a type\n" + @@ -5627,12 +5466,7 @@ "}", // =================, }, "----------\n" + - "1. WARNING in p\\X.java (at line 4)\n" + - " String variable = \"my testing\";\n" + - " ^^^^^^^^\n" + - "The field X.Outer.Inner.variable is never read locally\n" + - "----------\n" + - "2. ERROR in p\\X.java (at line 12)\n" + + "1. ERROR in p\\X.java (at line 12)\n" + " Zork z;\n" + " ^^^^\n" + "Zork cannot be resolved to a type\n" + @@ -6077,42 +5911,12 @@ "}", // ================= }, "----------\n" + - "1. WARNING in X.java (at line 6)\n" + - " private static class B2F extends X { }\n" + - " ^^^\n" + - "The type X.B2F is never used locally\n" + - "----------\n" + - "2. WARNING in X.java (at line 7)\n" + - " private static class F2B extends X { }\n" + - " ^^^\n" + - "The type X.F2B is never used locally\n" + - "----------\n" + - "3. WARNING in X.java (at line 13)\n" + - " private static class B2F extends Key {\n" + - " ^^^\n" + - "The type X.Key.B2F is never used locally\n" + - "----------\n" + - "4. WARNING in X.java (at line 14)\n" + - " private static B2F create() { return new B2F(); }\n" + - " ^^^^^^^^\n" + - "The method create() from the type X.Key.B2F is never used locally\n" + - "----------\n" + - "5. ERROR in X.java (at line 15)\n" + + "1. ERROR in X.java (at line 15)\n" + " public Key flip() { return F2B.create(); }\n" + " ^^^\n" + "The type F2B is defined in an inherited type and an enclosing scope\n" + "----------\n" + - "6. WARNING in X.java (at line 18)\n" + - " private static class F2B extends Key {\n" + - " ^^^\n" + - "The type X.Key.F2B is never used locally\n" + - "----------\n" + - "7. WARNING in X.java (at line 19)\n" + - " private static F2B create() { return new F2B(); }\n" + - " ^^^^^^^^\n" + - "The method create() from the type X.Key.F2B is never used locally\n" + - "----------\n" + - "8. ERROR in X.java (at line 20)\n" + + "2. ERROR in X.java (at line 20)\n" + " public Key flip() { return B2F.create(); }\n" + " ^^^\n" + "The type B2F is defined in an inherited type and an enclosing scope\n" + @@ -6211,22 +6015,12 @@ "}", // ================= }, "----------\n" + - "1. WARNING in X.java (at line 14)\n" + - " private static B2F create() { return new B2F(); }\n" + - " ^^^^^^^^\n" + - "The method create() from the type X.Key.B2F is never used locally\n" + - "----------\n" + - "2. ERROR in X.java (at line 15)\n" + + "1. ERROR in X.java (at line 15)\n" + " public Key flip() { return F2B.create(); }\n" + " ^^^\n" + "The type F2B is defined in an inherited type and an enclosing scope\n" + "----------\n" + - "3. WARNING in X.java (at line 19)\n" + - " private static F2B create() { return new F2B(); }\n" + - " ^^^^^^^^\n" + - "The method create() from the type X.Key.F2B is never used locally\n" + - "----------\n" + - "4. ERROR in X.java (at line 20)\n" + + "2. ERROR in X.java (at line 20)\n" + " public Key flip() { return B2F.create(); }\n" + " ^^^\n" + "The type B2F is defined in an inherited type and an enclosing scope\n" + @@ -6324,32 +6118,22 @@ "}", // ================= }, "----------\n" + - "1. WARNING in X.java (at line 11)\n" + - " private class Test5 {\n" + - " ^^^^^\n" + - "The type X.Test5 is never used locally\n" + - "----------\n" + - "2. WARNING in X.java (at line 12)\n" + - " private class Test4 extends Test2 {\n" + - " ^^^^^\n" + - "The type X.Test5.Test4 is never used locally\n" + - "----------\n" + - "3. ERROR in X.java (at line 16)\n" + + "1. ERROR in X.java (at line 16)\n" + " System.out.println(X.this.var1.trim());\n" + " ^^^^^^\n" + "No enclosing instance of the type X is accessible in scope\n" + "----------\n" + - "4. WARNING in X.java (at line 16)\n" + + "2. WARNING in X.java (at line 16)\n" + " System.out.println(X.this.var1.trim());\n" + " ^^^^\n" + "Read access to enclosing field X.var1 is emulated by a synthetic accessor method\n" + "----------\n" + - "5. WARNING in X.java (at line 17)\n" + + "3. WARNING in X.java (at line 17)\n" + " System.out.println(var1.trim());\n" + " ^^^^\n" + "Read access to enclosing field X.var1 is emulated by a synthetic accessor method\n" + "----------\n" + - "6. ERROR in X.java (at line 17)\n" + + "4. ERROR in X.java (at line 17)\n" + " System.out.println(var1.trim());\n" + " ^^^^\n" + "No enclosing instance of the type X is accessible in scope\n" + @@ -6417,27 +6201,22 @@ "}", // ================= }, "----------\n" + - "1. WARNING in X.java (at line 12)\n" + - " private class Test4 extends Test2 {\n" + - " ^^^^^\n" + - "The type X.Test4 is never used locally\n" + - "----------\n" + - "2. ERROR in X.java (at line 16)\n" + + "1. ERROR in X.java (at line 16)\n" + " System.out.println(X.this.var1.trim());\n" + " ^^^^^^\n" + "No enclosing instance of the type X is accessible in scope\n" + "----------\n" + - "3. WARNING in X.java (at line 16)\n" + + "2. WARNING in X.java (at line 16)\n" + " System.out.println(X.this.var1.trim());\n" + " ^^^^\n" + "Read access to enclosing field X.var1 is emulated by a synthetic accessor method\n" + "----------\n" + - "4. WARNING in X.java (at line 17)\n" + + "3. WARNING in X.java (at line 17)\n" + " System.out.println(var1.trim());\n" + " ^^^^\n" + "Read access to enclosing field X.var1 is emulated by a synthetic accessor method\n" + "----------\n" + - "5. ERROR in X.java (at line 17)\n" + + "4. ERROR in X.java (at line 17)\n" + " System.out.println(var1.trim());\n" + " ^^^^\n" + "No enclosing instance of the type X is accessible in scope\n" + @@ -7036,27 +6815,22 @@ "}\n", }, "----------\n" + - "1. WARNING in X.java (at line 4)\n" + - " private void c() {}\n" + - " ^^^\n" + - "The method c() from the type X is never used locally\n" + - "----------\n" + - "2. WARNING in X.java (at line 8)\n" + + "1. WARNING in X.java (at line 8)\n" + " a(null);\n" + " ^^^^^^^\n" + "Access to enclosing method a(String) from the type X is emulated by a synthetic accessor method\n" + "----------\n" + - "3. WARNING in X.java (at line 9)\n" + + "2. WARNING in X.java (at line 9)\n" + " c(null);\n" + " ^^^^^^^\n" + "Access to enclosing method c(String) from the type X is emulated by a synthetic accessor method\n" + "----------\n" + - "4. WARNING in X.java (at line 14)\n" + + "3. WARNING in X.java (at line 14)\n" + " a(null);\n" + " ^^^^^^^\n" + "Access to enclosing method a(String) from the type X is emulated by a synthetic accessor method\n" + "----------\n" + - "5. WARNING in X.java (at line 15)\n" + + "4. WARNING in X.java (at line 15)\n" + " c(null);\n" + " ^^^^^^^\n" + "Access to enclosing method c(String) from the type X is emulated by a synthetic accessor method\n" + Index: src/org/eclipse/jdt/core/tests/compiler/regression/StackMapAttributeTest.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/StackMapAttributeTest.java,v retrieving revision 1.46 diff -u -r1.46 StackMapAttributeTest.java --- src/org/eclipse/jdt/core/tests/compiler/regression/StackMapAttributeTest.java 21 Jan 2010 16:48:41 -0000 1.46 +++ src/org/eclipse/jdt/core/tests/compiler/regression/StackMapAttributeTest.java 10 Sep 2010 19:23:23 -0000 @@ -34,7 +34,7 @@ static { // TESTS_PREFIX = "testBug95521"; // TESTS_NAMES = new String[] { "testBug83127a" }; -// TESTS_NUMBERS = new int[] { 46 }; +// TESTS_NUMBERS = new int[] { 47 }; // TESTS_RANGE = new int[] { 23 -1,}; } public static Test suite() { @@ -6522,4 +6522,30 @@ true, customOptions); } + // https://bugs.eclipse.org/bugs/show_bug.cgi?id=324848 + public void test047() { + this.runNegativeTest( + new String[] { + "X.java", + "public class X {\n" + + " public static void test() {\n" + + " final boolean x = true;\n" + + " new Runnable() {\n" + + " @Override\n" + + " public void run() {\n" + + " synchronized (X.this) {\n" + + " System.out.println(x);\n" + + " }\n" + + " }\n" + + " };\n" + + " }\n" + + "}" + }, + "----------\n" + + "1. ERROR in X.java (at line 7)\n" + + " synchronized (X.this) {\n" + + " ^^^^^^\n" + + "No enclosing instance of the type X is accessible in scope\n" + + "----------\n"); + } }