Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 178645 Details for
Bug 324848
[1.6][compiler] NullPointerException when trying to synchronize on non-existing outer class instance
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix + regression tests
patch_324848.txt (text/plain), 98.18 KB, created by
Olivier Thomann
on 2010-09-10 15:08:13 EDT
(
hide
)
Description:
Proposed fix + regression tests
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2010-09-10 15:08:13 EDT
Size:
98.18 KB
patch
obsolete
>### 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:05:53 -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:05:53 -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 >Index: Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/InnerClassTest.java >=================================================================== >RCS file: /home/cvs/numbat/org.eclipse.jdt.core.tests/Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/InnerClassTest.java,v >retrieving revision 1.45 >diff -u -r1.45 InnerClassTest.java >--- Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/InnerClassTest.java 27 May 2010 14:12:25 -0000 1.45 >+++ Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/InnerClassTest.java 10 Sep 2010 19:05:54 -0000 >@@ -30,6 +30,9 @@ > 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 void test001() { >@@ -3063,17 +3066,12 @@ > "}", > }, > "----------\n" + >- "1. WARNING in InnerClassTests\\LocalClass\\ExtendingLocalClass\\AccessToMethod\\Test00.java (at line 21)\n" + >- " private int var = 1;\n" + >- " ^^^\n" + >- "The field Test00.var is never read locally\n" + >- "----------\n" + >- "2. ERROR in InnerClassTests\\LocalClass\\ExtendingLocalClass\\AccessToMethod\\Test00.java (at line 33)\n" + >+ "1. ERROR in InnerClassTests\\LocalClass\\ExtendingLocalClass\\AccessToMethod\\Test00.java (at line 33)\n" + > " class Inner extends java.awt.Component {\n" + > " ^^^^^\n" + > "Duplicate nested type Inner\n" + > "----------\n" + >- "3. WARNING in InnerClassTests\\LocalClass\\ExtendingLocalClass\\AccessToMethod\\Test00.java (at line 33)\n" + >+ "2. WARNING in InnerClassTests\\LocalClass\\ExtendingLocalClass\\AccessToMethod\\Test00.java (at line 33)\n" + > " class Inner extends java.awt.Component {\n" + > " ^^^^^\n" + > "The serializable class Inner does not declare a static final serialVersionUID field of type long\n" + >@@ -4701,17 +4699,27 @@ > " }\n" + > "}", > }, >- "----------\n" + >- "1. ERROR in InnerClassTests\\LocalClass\\NestedMemberClass\\Test06.java (at line 44)\n" + >- " int geta9BMember() { return a9; }\n" + >- " ^^\n" + >- "Cannot make a static reference to the non-static field a9\n" + >- "----------\n" + >- "2. ERROR in InnerClassTests\\LocalClass\\NestedMemberClass\\Test06.java (at line 50)\n" + >- " int geta9BMember() { return a9; }\n" + >- " ^^\n" + >- "Cannot make a static reference to the non-static field a9\n" + >- "----------\n" >+ "----------\n" + >+ "1. ERROR in InnerClassTests\\LocalClass\\NestedMemberClass\\Test06.java (at line 42)\n" + >+ " float getbtopBMember() { return btop; }\n" + >+ " ^^^^\n" + >+ "No enclosing instance of the type BTop is accessible in scope\n" + >+ "----------\n" + >+ "2. ERROR in InnerClassTests\\LocalClass\\NestedMemberClass\\Test06.java (at line 44)\n" + >+ " int geta9BMember() { return a9; }\n" + >+ " ^^\n" + >+ "Cannot make a static reference to the non-static field a9\n" + >+ "----------\n" + >+ "3. ERROR in InnerClassTests\\LocalClass\\NestedMemberClass\\Test06.java (at line 48)\n" + >+ " float getbtopBMember() { return btop; }\n" + >+ " ^^^^\n" + >+ "No enclosing instance of the type BTop is accessible in scope\n" + >+ "----------\n" + >+ "4. ERROR in InnerClassTests\\LocalClass\\NestedMemberClass\\Test06.java (at line 50)\n" + >+ " int geta9BMember() { return a9; }\n" + >+ " ^^\n" + >+ "Cannot make a static reference to the non-static field a9\n" + >+ "----------\n" > ); > } > public void test104() { >@@ -4963,12 +4971,17 @@ > " }\n" + > "}", > }, >- "----------\n" + >- "1. ERROR in InnerClassTests\\LocalClass\\NestedMemberClass\\Test05.java (at line 44)\n" + >- " int geta8BMember() { return a8; }\n" + >- " ^^\n" + >- "Cannot make a static reference to the non-static field a8\n" + >- "----------\n" >+ "----------\n" + >+ "1. ERROR in InnerClassTests\\LocalClass\\NestedMemberClass\\Test05.java (at line 42)\n" + >+ " float getbtopBMember() { return btop; }\n" + >+ " ^^^^\n" + >+ "No enclosing instance of the type BTop is accessible in scope\n" + >+ "----------\n" + >+ "2. ERROR in InnerClassTests\\LocalClass\\NestedMemberClass\\Test05.java (at line 44)\n" + >+ " int geta8BMember() { return a8; }\n" + >+ " ^^\n" + >+ "Cannot make a static reference to the non-static field a8\n" + >+ "----------\n" > ); > } > public void test108() { >Index: Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/NegativeTest.java >=================================================================== >RCS file: /home/cvs/numbat/org.eclipse.jdt.core.tests/Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/NegativeTest.java,v >retrieving revision 1.341 >diff -u -r1.341 NegativeTest.java >--- Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/NegativeTest.java 9 Aug 2010 03:54:31 -0000 1.341 >+++ Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/NegativeTest.java 10 Sep 2010 19:05:54 -0000 >@@ -30,6 +30,9 @@ > 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; > } > /** >@@ -1894,12 +1897,7 @@ > "}", > }, > "----------\n" + >- "1. WARNING in p\\X.java (at line 6)\n" + >- " int j = i; \n" + >- " ^\n" + >- "The field Local.j is never read locally\n" + >- "----------\n" + >- "2. ERROR in p\\X.java (at line 6)\n" + >+ "1. ERROR in p\\X.java (at line 6)\n" + > " int j = i; \n" + > " ^\n" + > "The local variable i may not have been initialized\n" + >@@ -2306,12 +2304,7 @@ > "}", > }, > "----------\n" + >- "1. WARNING in p\\Init2.java (at line 6)\n" + >- " int j = i; // Javac complains here (Jikes does not)\n" + >- " ^\n" + >- "The field Local.j is never read locally\n" + >- "----------\n" + >- "2. ERROR in p\\Init2.java (at line 6)\n" + >+ "1. ERROR in p\\Init2.java (at line 6)\n" + > " int j = i; // Javac complains here (Jikes does not)\n" + > " ^\n" + > "The local variable i may not have been initialized\n" + >@@ -2632,12 +2625,7 @@ > "}", > }, > "----------\n" + >- "1. WARNING in p\\X.java (at line 5)\n" + >- " Object obj = X.this;\n" + >- " ^^^\n" + >- "The field new Object(){}.obj is never read locally\n" + >- "----------\n" + >- "2. ERROR in p\\X.java (at line 5)\n" + >+ "1. ERROR in p\\X.java (at line 5)\n" + > " Object obj = X.this;\n" + > " ^^^^^^\n" + > "No enclosing instance of the type X is accessible in scope\n" + >@@ -3121,35 +3109,15 @@ > " ^^^^^^^\n" + > "The blank final field a may not have been initialized\n" + > "----------\n" + >- "2. WARNING in p\\CheckBlankFinals.java (at line 13)\n" + >- " class LocA {\n" + >- " ^^^^\n" + >- "The type LocA is never used locally\n" + >- "----------\n" + >- "3. ERROR in p\\CheckBlankFinals.java (at line 13)\n" + >+ "2. ERROR in p\\CheckBlankFinals.java (at line 13)\n" + > " class LocA {\n" + > " ^^^^\n" + > "The blank final field a may not have been initialized\n" + > "----------\n" + >- "4. WARNING in p\\CheckBlankFinals.java (at line 14)\n" + >- " final int a; // never initialized\n" + >- " ^\n" + >- "The field LocA.a is never read locally\n" + >- "----------\n" + >- "5. WARNING in p\\CheckBlankFinals.java (at line 15)\n" + >- " class LocB {\n" + >- " ^^^^\n" + >- "The type LocA.LocB is never used locally\n" + >- "----------\n" + >- "6. ERROR in p\\CheckBlankFinals.java (at line 15)\n" + >+ "3. ERROR in p\\CheckBlankFinals.java (at line 15)\n" + > " class LocB {\n" + > " ^^^^\n" + > "The blank final field b may not have been initialized\n" + >- "----------\n" + >- "7. WARNING in p\\CheckBlankFinals.java (at line 16)\n" + >- " final int b; \n" + >- " ^\n" + >- "The field LocA.LocB.b is never read locally\n" + > "----------\n" > ); > } >@@ -3895,36 +3863,6 @@ > " class SubLocal extends SuperLokcal {}\n" + > " ^^^^^^^^^^^\n" + > "SuperLokcal cannot be resolved to a type\n" + >- "----------\n" + >- "3. WARNING in p\\TheSub.java (at line 12)\n" + >- " class SubLocal extends MidLocal {}\n" + >- " ^^^^^^^^\n" + >- "The type SubLocal is never used locally\n" + >- "----------\n" + >- "4. WARNING in p\\TheSub.java (at line 16)\n" + >- " int y = x; }\n" + >- " ^\n" + >- "The field SuperLocal.y is never read locally\n" + >- "----------\n" + >- "5. WARNING in p\\TheSub.java (at line 18)\n" + >- " class SubLocal extends MidLocal {}\n" + >- " ^^^^^^^^\n" + >- "The type SubLocal is never used locally\n" + >- "----------\n" + >- "6. WARNING in p\\TheSub.java (at line 22)\n" + >- " Object o = TheSub.this; }\n" + >- " ^\n" + >- "The field SuperLocal.o is never read locally\n" + >- "----------\n" + >- "7. WARNING in p\\TheSub.java (at line 24)\n" + >- " class SubLocal extends MidLocal {}\n" + >- " ^^^^^^^^\n" + >- "The type SubLocal is never used locally\n" + >- "----------\n" + >- "8. WARNING in p\\TheSub.java (at line 29)\n" + >- " class SubLocal extends MidLocal {}\n" + >- " ^^^^^^^^\n" + >- "The type SubLocal is never used locally\n" + > "----------\n" > ); > } >@@ -3956,30 +3894,10 @@ > "}", > }, > "----------\n" + >- "1. WARNING in p\\CheckBlankFinals1.java (at line 11)\n" + >- " class LocA {\n" + >- " ^^^^\n" + >- "The type LocA is never used locally\n" + >- "----------\n" + >- "2. ERROR in p\\CheckBlankFinals1.java (at line 11)\n" + >+ "1. ERROR in p\\CheckBlankFinals1.java (at line 11)\n" + > " class LocA {\n" + > " ^^^^\n" + > "The blank final field a may not have been initialized\n" + >- "----------\n" + >- "3. WARNING in p\\CheckBlankFinals1.java (at line 12)\n" + >- " final int a; // never initialized\n" + >- " ^\n" + >- "The field LocA.a is never read locally\n" + >- "----------\n" + >- "4. WARNING in p\\CheckBlankFinals1.java (at line 13)\n" + >- " class LocB {\n" + >- " ^^^^\n" + >- "The type LocA.LocB is never used locally\n" + >- "----------\n" + >- "5. WARNING in p\\CheckBlankFinals1.java (at line 14)\n" + >- " final int b; \n" + >- " ^\n" + >- "The field LocA.LocB.b is never read locally\n" + > "----------\n"); > } > public void test098() { >@@ -4001,35 +3919,15 @@ > "} ", > }, > "----------\n" + >- "1. WARNING in p\\CheckBlankFinals2.java (at line 6)\n" + >- " class LocA {\n" + >- " ^^^^\n" + >- "The type LocA is never used locally\n" + >- "----------\n" + >- "2. ERROR in p\\CheckBlankFinals2.java (at line 6)\n" + >+ "1. ERROR in p\\CheckBlankFinals2.java (at line 6)\n" + > " class LocA {\n" + > " ^^^^\n" + > "The blank final field a may not have been initialized\n" + > "----------\n" + >- "3. WARNING in p\\CheckBlankFinals2.java (at line 7)\n" + >- " final int a; // never initialized\n" + >- " ^\n" + >- "The field LocA.a is never read locally\n" + >- "----------\n" + >- "4. WARNING in p\\CheckBlankFinals2.java (at line 8)\n" + >- " class LocB {\n" + >- " ^^^^\n" + >- "The type LocA.LocB is never used locally\n" + >- "----------\n" + >- "5. ERROR in p\\CheckBlankFinals2.java (at line 8)\n" + >+ "2. ERROR in p\\CheckBlankFinals2.java (at line 8)\n" + > " class LocB {\n" + > " ^^^^\n" + > "The blank final field b may not have been initialized\n" + >- "----------\n" + >- "6. WARNING in p\\CheckBlankFinals2.java (at line 9)\n" + >- " final int b; // never initialized\n" + >- " ^\n" + >- "The field LocA.LocB.b is never read locally\n" + > "----------\n" > ); > } >@@ -4055,16 +3953,6 @@ > " class MemberA {\n" + > " ^^^^^^^\n" + > "The blank final field a may not have been initialized\n" + >- "----------\n" + >- "2. WARNING in p\\CheckBlankFinals3.java (at line 6)\n" + >- " class MemberB {\n" + >- " ^^^^^^^\n" + >- "The type MemberB is never used locally\n" + >- "----------\n" + >- "3. WARNING in p\\CheckBlankFinals3.java (at line 7)\n" + >- " final int b; \n" + >- " ^\n" + >- "The field MemberB.b is never read locally\n" + > "----------\n" > ); > } >@@ -4568,27 +4456,12 @@ > "}", > }, > "----------\n" + >- "1. WARNING in p\\Outer12.java (at line 7)\n" + >- " void g() {\n" + >- " ^^^\n" + >- "The method g() from the type Local is never used locally\n" + >- "----------\n" + >- "2. WARNING in p\\Outer12.java (at line 8)\n" + >- " class Local2 {\n" + >- " ^^^^^^\n" + >- "The type Local2 is never used locally\n" + >- "----------\n" + >- "3. WARNING in p\\Outer12.java (at line 9)\n" + >- " int n = count + count; // another compiler rejects\n" + >- " ^\n" + >- "The field Local2.n is never read locally\n" + >- "----------\n" + >- "4. ERROR in p\\Outer12.java (at line 9)\n" + >+ "1. ERROR in p\\Outer12.java (at line 9)\n" + > " int n = count + count; // another compiler rejects\n" + > " ^^^^^\n" + > "The local variable count may not have been initialized\n" + > "----------\n" + >- "5. ERROR in p\\Outer12.java (at line 9)\n" + >+ "2. ERROR in p\\Outer12.java (at line 9)\n" + > " int n = count + count; // another compiler rejects\n" + > " ^^^^^\n" + > "The local variable count may not have been initialized\n" + >@@ -6082,22 +5955,12 @@ > " ^\n" + > "Cannot define static initializer in inner type B\n" + > "----------\n" + >- "2. WARNING in p\\A11.java (at line 10)\n" + >- " class A {\n" + >- " ^\n" + >- "The type A is never used locally\n" + >- "----------\n" + >- "3. WARNING in p\\A11.java (at line 11)\n" + >- " void f()\n" + >- " ^^^\n" + >- "The method f() from the type A is never used locally\n" + >- "----------\n" + >- "4. ERROR in p\\A11.java (at line 13)\n" + >+ "2. ERROR in p\\A11.java (at line 13)\n" + > " b=3; // B has not been definitely assigned!\n" + > " ^\n" + > "The final local variable b cannot be assigned, since it is defined in an enclosing type\n" + > "----------\n" + >- "5. ERROR in p\\A11.java (at line 17)\n" + >+ "3. ERROR in p\\A11.java (at line 17)\n" + > " System.out.println(b);\n" + > " ^\n" + > "The local variable b may not have been initialized\n" + >@@ -6795,17 +6658,7 @@ > "}", > }, > "----------\n" + >- "1. WARNING in p\\ASB.java (at line 8)\n" + >- " class L {\n" + >- " ^\n" + >- "The type L is never used locally\n" + >- "----------\n" + >- "2. WARNING in p\\ASB.java (at line 9)\n" + >- " int l = ASB.this.x; // no enclosing instance of type X is available\n" + >- " ^\n" + >- "The field L.l is never read locally\n" + >- "----------\n" + >- "3. ERROR in p\\ASB.java (at line 9)\n" + >+ "1. ERROR in p\\ASB.java (at line 9)\n" + > " int l = ASB.this.x; // no enclosing instance of type X is available\n" + > " ^^^^^^^^\n" + > "No enclosing instance of the type ASB is accessible in scope\n" + >@@ -7370,62 +7223,57 @@ > " ^^^^^^^^^^^^^^^^^^^\n" + > "Unreachable catch block for IOException. This exception is never thrown from the try statement body\n" + > "----------\n" + >- "3. WARNING in p\\DCBug.java (at line 15)\n" + >- " private static void check_break ()\n" + >- " ^^^^^^^^^^^^^^\n" + >- "The method check_break() from the type DCBug is never used locally\n" + >- "----------\n" + >- "4. WARNING in p\\DCBug.java (at line 20)\n" + >+ "3. WARNING in p\\DCBug.java (at line 20)\n" + > " outer:\n" + > " ^^^^^\n" + > "The label outer is never explicitly referenced\n" + > "----------\n" + >- "5. WARNING in p\\DCBug.java (at line 23)\n" + >+ "4. WARNING in p\\DCBug.java (at line 23)\n" + > " middle:\n" + > " ^^^^^^\n" + > "The label middle is never explicitly referenced\n" + > "----------\n" + >- "6. WARNING in p\\DCBug.java (at line 41)\n" + >+ "5. WARNING in p\\DCBug.java (at line 41)\n" + > " outer:\n" + > " ^^^^^\n" + > "The label outer is never explicitly referenced\n" + > "----------\n" + >- "7. WARNING in p\\DCBug.java (at line 42)\n" + >+ "6. WARNING in p\\DCBug.java (at line 42)\n" + > " for (int i = 0; i < 1000; i++)\n" + > " ^^^\n" + > "Dead code\n" + > "----------\n" + >- "8. WARNING in p\\DCBug.java (at line 45)\n" + >+ "7. WARNING in p\\DCBug.java (at line 45)\n" + > " for (int j = 0; j < 1000; j++)\n" + > " ^^^\n" + > "Dead code\n" + > "----------\n" + >- "9. WARNING in p\\DCBug.java (at line 47)\n" + >+ "8. WARNING in p\\DCBug.java (at line 47)\n" + > " inner:\n" + > " ^^^^^\n" + > "The label inner is never explicitly referenced\n" + > "----------\n" + >- "10. WARNING in p\\DCBug.java (at line 48)\n" + >+ "9. WARNING in p\\DCBug.java (at line 48)\n" + > " for (int k = 0; k < 1000; k++)\n" + > " ^^^\n" + > "Dead code\n" + > "----------\n" + >- "11. WARNING in p\\DCBug.java (at line 63)\n" + >+ "10. WARNING in p\\DCBug.java (at line 63)\n" + > " middle:\n" + > " ^^^^^^\n" + > "The label middle is never explicitly referenced\n" + > "----------\n" + >- "12. WARNING in p\\DCBug.java (at line 66)\n" + >+ "11. WARNING in p\\DCBug.java (at line 66)\n" + > " inner:\n" + > " ^^^^^\n" + > "The label inner is never explicitly referenced\n" + > "----------\n" + >- "13. WARNING in p\\DCBug.java (at line 67)\n" + >+ "12. WARNING in p\\DCBug.java (at line 67)\n" + > " for (int k = 0; k < 1000; k++)\n" + > " ^^^\n" + > "Dead code\n" + > "----------\n" + >- "14. WARNING in p\\DCBug.java (at line 90)\n" + >+ "13. WARNING in p\\DCBug.java (at line 90)\n" + > " {\n" + > " i = 20;\n" + > " continue;\n" + >@@ -7625,12 +7473,7 @@ > "}", > }, > "----------\n" + >- "1. WARNING in p\\Outer.java (at line 7)\n" + >- " int n = count; // another compiler rejects\n" + >- " ^\n" + >- "The field Local.n is never read locally\n" + >- "----------\n" + >- "2. ERROR in p\\Outer.java (at line 7)\n" + >+ "1. ERROR in p\\Outer.java (at line 7)\n" + > " int n = count; // another compiler rejects\n" + > " ^^^^^\n" + > "The local variable count may not have been initialized\n" + >@@ -7738,23 +7581,13 @@ > > }, > "----------\n" + >- "1. WARNING in p\\a\\Init.java (at line 9)\n" + >- " int j = i; // Javac complains here (Jikes does not)\n" + >- " ^\n" + >- "The field Local.j is never read locally\n" + >- "----------\n" + >- "2. ERROR in p\\a\\Init.java (at line 9)\n" + >+ "1. ERROR in p\\a\\Init.java (at line 9)\n" + > " int j = i; // Javac complains here (Jikes does not)\n" + > " ^\n" + > "The local variable i may not have been initialized\n" + > "----------\n" + > "----------\n" + >- "1. WARNING in p\\a\\Outer.java (at line 9)\n" + >- " int n = count; // another compiler rejects\n" + >- " ^\n" + >- "The field Local.n is never read locally\n" + >- "----------\n" + >- "2. ERROR in p\\a\\Outer.java (at line 9)\n" + >+ "1. ERROR in p\\a\\Outer.java (at line 9)\n" + > " int n = count; // another compiler rejects\n" + > " ^^^^^\n" + > "The local variable count may not have been initialized\n" + >@@ -7817,32 +7650,6 @@ > > }, //TODO should improve error message to suggest addition of explicit constructor instead > "----------\n" + >- "1. WARNING in p\\z\\AClass.java (at line 13)\n" + >- " static private class Inner3 {\n" + >- " ^^^^^^\n" + >- "The type AClass.Inner3 is never used locally\n" + >- "----------\n" + >- "2. WARNING in p\\z\\AClass.java (at line 14)\n" + >- " String test() {\n" + >- " ^^^^^^\n" + >- "The method test() from the type AClass.Inner3 is never used locally\n" + >- "----------\n" + >- "3. WARNING in p\\z\\AClass.java (at line 18)\n" + >- " private class Inner4 {\n" + >- " ^^^^^^\n" + >- "The type AClass.Inner4 is never used locally\n" + >- "----------\n" + >- "4. WARNING in p\\z\\AClass.java (at line 19)\n" + >- " String test() {\n" + >- " ^^^^^^\n" + >- "The method test() from the type AClass.Inner4 is never used locally\n" + >- "----------\n" + >- "5. WARNING in p\\z\\AClass.java (at line 31)\n" + >- " public String test() {\n" + >- " ^^^^^^\n" + >- "The method test() from the type new Object(){} is never used locally\n" + >- "----------\n" + >- "----------\n" + > "1. ERROR in p\\z\\AClassExtension.java (at line 2)\n" + > " public class AClassExtension extends AClass.Inner1 {}\n" + > " ^^^^^^^^^^^^^^^\n" + >@@ -8603,11 +8410,6 @@ > "----------\n" + > "3. WARNING in p\\r2\\helper\\SubA.java (at line 11)\n" + > " int x = i; }; // bad since from inside inner\n" + >- " ^\n" + >- "The field new Object(){}.x is never read locally\n" + >- "----------\n" + >- "4. WARNING in p\\r2\\helper\\SubA.java (at line 11)\n" + >- " int x = i; }; // bad since from inside inner\n" + > " ^\n" + > "Read access to enclosing field A.i is emulated by a synthetic accessor method\n" + > "----------\n" + >@@ -9027,12 +8829,6 @@ > " int i = new AA().new Inner().i; // THIS LINE SHOULD CAUSE AN ERROR\n" + > " ^^^^^\n" + > "The type AA.Inner is not visible\n" + >- "----------\n" + >- "----------\n" + >- "1. WARNING in p\\k\\AA.java (at line 4)\n" + >- " int i = 10;\n" + >- " ^\n" + >- "The field AA.Inner.i is never read locally\n" + > "----------\n"); > } > public void test227() { >@@ -9228,16 +9024,6 @@ > " ^\n" + > "X cannot be resolved to a type\n" + > "----------\n" + >- "9. WARNING in p\\h\\X1.java (at line 29)\n" + >- " class Local {\n" + >- " ^^^^^\n" + >- "The type Local is never used locally\n" + >- "----------\n" + >- "10. WARNING in p\\h\\X1.java (at line 30)\n" + >- " void foo() {\n" + >- " ^^^^^\n" + >- "The method foo() from the type Local is never used locally\n" + >- "----------\n" + > "----------\n" + > "1. WARNING in p\\h\\B.java (at line 2)\n" + > " class B extends Exception {\n" + >@@ -9513,12 +9299,7 @@ > > }, > "----------\n" + >- "1. WARNING in p\\d\\One1.java (at line 7)\n" + >- " public void problem2() {\n" + >- " ^^^^^^^^^^\n" + >- "The method problem2() from the type new Object(){} is never used locally\n" + >- "----------\n" + >- "2. WARNING in p\\d\\One1.java (at line 8)\n" + >+ "1. WARNING in p\\d\\One1.java (at line 8)\n" + > " if(dialog == 3) return;\n" + > " ^^^^^^^\n" + > "Dead code\n" + >@@ -9529,78 +9310,33 @@ > " ^^^^^^^^\n" + > "The serializable class JE_5_AWT does not declare a static final serialVersionUID field of type long\n" + > "----------\n" + >- "2. WARNING in p\\d\\JE_5_AWT.java (at line 21)\n" + >- " Object obj = JE_5_AWT.this; //<---------OK\n" + >- " ^^^\n" + >- "The field new Object(){}.obj is never read locally\n" + >- "----------\n" + >- "3. WARNING in p\\d\\JE_5_AWT.java (at line 26)\n" + >- " Object obj = JE_5_AWT.this; //<---------KO \n" + >- " ^^^\n" + >- "The field new Object(){}.obj is never read locally\n" + >- "----------\n" + >- "4. ERROR in p\\d\\JE_5_AWT.java (at line 26)\n" + >+ "2. ERROR in p\\d\\JE_5_AWT.java (at line 26)\n" + > " Object obj = JE_5_AWT.this; //<---------KO \n" + > " ^^^^^^^^^^^^^\n" + > "No enclosing instance of the type JE_5_AWT is accessible in scope\n" + > "----------\n" + >- "5. ERROR in p\\d\\JE_5_AWT.java (at line 32)\n" + >+ "3. ERROR in p\\d\\JE_5_AWT.java (at line 32)\n" + > " Object obj2 = d; // KO\n" + > " ^\n" + > "Cannot refer to an instance field d while explicitly invoking a constructor\n" + > "----------\n" + >- "6. WARNING in p\\d\\JE_5_AWT.java (at line 37)\n" + >- " Object myself() {\n" + >- " ^^^^^^^^\n" + >- "The method myself() from the type new Object(){} is never used locally\n" + >- "----------\n" + >- "7. WARNING in p\\d\\JE_5_AWT.java (at line 43)\n" + >- " class Local {\n" + >- " ^^^^^\n" + >- "The type Local is never used locally\n" + >- "----------\n" + >- "8. WARNING in p\\d\\JE_5_AWT.java (at line 44)\n" + >- " JE_5_AWT obj = JE_5_AWT.this;\n" + >- " ^^^\n" + >- "The field Local.obj is never read locally\n" + >- "----------\n" + >- "9. WARNING in p\\d\\JE_5_AWT.java (at line 49)\n" + >- " Object outer() {\n" + >- " ^^^^^^^\n" + >- "The method outer() from the type new Object(){} is never used locally\n" + >- "----------\n" + >- "10. ERROR in p\\d\\JE_5_AWT.java (at line 50)\n" + >+ "4. ERROR in p\\d\\JE_5_AWT.java (at line 50)\n" + > " return JE_5_AWT.this; //<---- KO\n" + > " ^^^^^^^^^^^^^\n" + > "No enclosing instance of the type JE_5_AWT is accessible in scope\n" + > "----------\n" + >- "11. WARNING in p\\d\\JE_5_AWT.java (at line 55)\n" + >- " class Local extends Thread {\n" + >- " ^^^^^\n" + >- "The type Local is never used locally\n" + > "----------\n" + >- "12. WARNING in p\\d\\JE_5_AWT.java (at line 56)\n" + >- " Local() {\n" + >- " ^^^^^^^\n" + >- "The constructor Local() is never used locally\n" + >- "----------\n" + >- "----------\n" + >- "1. WARNING in p\\d\\One.java (at line 13)\n" + >- " public void problem2() {\n" + >- " ^^^^^^^^^^\n" + >- "The method problem2() from the type new Object(){} is never used locally\n" + >- "----------\n" + >- "2. WARNING in p\\d\\One.java (at line 14)\n" + >+ "1. WARNING in p\\d\\One.java (at line 14)\n" + > " if(dialog == 3) return;\n" + > " ^^^^^^^\n" + > "Dead code\n" + > "----------\n" + >- "3. ERROR in p\\d\\One.java (at line 24)\n" + >+ "2. ERROR in p\\d\\One.java (at line 24)\n" + > " fireTableCellUpdated();\n" + > " ^^^^^^^^^^^^^^^^^^^^\n" + > "Cannot refer to an instance method while explicitly invoking a constructor\n" + > "----------\n" + >- "4. WARNING in p\\d\\One.java (at line 40)\n" + >+ "3. WARNING in p\\d\\One.java (at line 40)\n" + > " if (m == null) return;\n" + > " ^^^^^^^\n" + > "Dead code\n" + >@@ -10339,11 +10075,6 @@ > " super.init(); \n" + > " ^^^^^^^^^^^^\n" + > "Cannot directly invoke the abstract method init() for the type I\n" + >- "----------\n" + >- "2. WARNING in p1\\X.java (at line 10)\n" + >- " private void init(){} \n" + >- " ^^^^^^\n" + >- "The method init() from the type AbstractZ is never used locally\n" + > "----------\n" > ); > } >@@ -10565,37 +10296,22 @@ > "} \n" > }, > "----------\n" + >- "1. WARNING in p1\\X.java (at line 5)\n" + >- " class Local extends C { \n" + >- " ^^^^^\n" + >- "The type Local is never used locally\n" + >- "----------\n" + >- "2. WARNING in p1\\X.java (at line 8)\n" + >+ "1. WARNING in p1\\X.java (at line 8)\n" + > " public final int CST2 = 12; \n" + > " ^^^^\n" + > "The field Local.CST2 is hiding a field from type C\n" + > "----------\n" + >- "3. WARNING in p1\\X.java (at line 8)\n" + >- " public final int CST2 = 12; \n" + >- " ^^^^\n" + >- "The field Local.CST2 is never read locally\n" + >- "----------\n" + >- "4. WARNING in p1\\X.java (at line 9)\n" + >- " void foo(int i){ \n" + >- " ^^^^^^^^^^\n" + >- "The method foo(int) from the type Local is never used locally\n" + >- "----------\n" + >- "5. ERROR in p1\\X.java (at line 11)\n" + >+ "2. ERROR in p1\\X.java (at line 11)\n" + > " case this.CST : \n" + > " ^^^^^^^^\n" + > "case expressions must be constant expressions\n" + > "----------\n" + >- "6. ERROR in p1\\X.java (at line 15)\n" + >+ "3. ERROR in p1\\X.java (at line 15)\n" + > " case super.CST2 : \n" + > " ^^^^^^^^^^\n" + > "case expressions must be constant expressions\n" + > "----------\n" + >- "7. ERROR in p1\\X.java (at line 17)\n" + >+ "4. ERROR in p1\\X.java (at line 17)\n" + > " case X.this.CST3 : \n" + > " ^^^^^^^^^^^\n" + > "case expressions must be constant expressions\n" + >@@ -11685,12 +11401,7 @@ > }, > null, customOptions, > "----------\n" + >- "1. WARNING in Test.java (at line 3)\n" + >- " private void doTest() { \n" + >- " ^^^^^^^^\n" + >- "The method doTest() from the type Test is never used locally\n" + >- "----------\n" + >- "2. WARNING in Test.java (at line 12)\n" + >+ "1. WARNING in Test.java (at line 12)\n" + > " int i = 0; \n" + > " ^\n" + > "The local variable i is never read\n" + >@@ -12271,17 +11982,7 @@ > "} \n", > }, > "----------\n" + >- "1. WARNING in TestEclipseBug.java (at line 2)\n" + >- " private Object root; \n" + >- " ^^^^\n" + >- "The field TestEclipseBug.root is never read locally\n" + >- "----------\n" + >- "2. WARNING in TestEclipseBug.java (at line 3)\n" + >- " private Number count; \n" + >- " ^^^^^\n" + >- "The field TestEclipseBug.count is never read locally\n" + >- "----------\n" + >- "3. ERROR in TestEclipseBug.java (at line 12)\n" + >+ "1. ERROR in TestEclipseBug.java (at line 12)\n" + > " this(objEntityName); // recursive constructor call \n" + > " ^^^^^^^^^^^^^^^^^^^^\n" + > "Recursive constructor invocation TestEclipseBug(String)\n" + >@@ -12307,17 +12008,6 @@ > "} \n", > }, > "----------\n" + >- "1. WARNING in p\\X.java (at line 3)\n" + >- " private class Y { \n" + >- " ^\n" + >- "The type X.Y is never used locally\n" + >- "----------\n" + >- "2. WARNING in p\\X.java (at line 4)\n" + >- " public class Z { \n" + >- " ^\n" + >- "The type X.Y.Z is never used locally\n" + >- "----------\n" + >- "----------\n" + > "1. ERROR in q\\Y.java (at line 2)\n" + > " import p.X.Y.Z; \n" + > " ^^^^^\n" + >@@ -12422,12 +12112,7 @@ > " } \n"+ > "} \n" > }, >- "----------\n" + >- "1. WARNING in X.java (at line 2)\n" + >- " private int foo() { \n" + >- " ^^^^^\n" + >- "The method foo() from the type X is never used locally\n" + >- "----------\n", >+ "", > null, null, JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings); > } > // no private unused if syntax error >@@ -12473,12 +12158,6 @@ > "} \n", > }, > "----------\n" + >- "1. WARNING in X.java (at line 2)\n" + >- " private int foo() { \n" + >- " ^^^^^\n" + >- "The method foo() from the type X is never used locally\n" + >- "----------\n" + >- "----------\n" + > "1. ERROR in Y.java (at line 1)\n" + > " public class Y extends X { \n" + > " ^\n" + >@@ -12971,17 +12650,7 @@ > "} \n", > }, > "----------\n" + >- "1. WARNING in X.java (at line 2)\n" + >- " private void foo(int i) { \n" + >- " ^^^^^^^^^^\n" + >- "The method foo(int) from the type X is never used locally\n" + >- "----------\n" + >- "2. WARNING in X.java (at line 5)\n" + >- " void bar() { \n" + >- " ^^^^^\n" + >- "The method bar() from the type new Object(){} is never used locally\n" + >- "----------\n" + >- "3. WARNING in X.java (at line 6)\n" + >+ "1. WARNING in X.java (at line 6)\n" + > " foo(2); \n" + > " ^^^^^^\n" + > "Access to enclosing method foo(int) from the type X is emulated by a synthetic accessor method\n" + >@@ -13010,17 +12679,7 @@ > "} \n", > }, > "----------\n" + >- "1. WARNING in X.java (at line 2)\n" + >- " private class Member { \n" + >- " ^^^^^^\n" + >- "The type X.Member is never used locally\n" + >- "----------\n" + >- "2. WARNING in X.java (at line 3)\n" + >- " private Member foo(int i) { \n" + >- " ^^^^^^^^^^\n" + >- "The method foo(int) from the type X.Member is never used locally\n" + >- "----------\n" + >- "3. WARNING in X.java (at line 7)\n" + >+ "1. WARNING in X.java (at line 7)\n" + > " return foo(2); \n" + > " ^^^^^^\n" + > "Access to enclosing method foo(int) from the type X.Member is emulated by a synthetic accessor method\n" + >@@ -13046,17 +12705,12 @@ > "} \n", > }, > "----------\n" + >- "1. WARNING in X.java (at line 2)\n" + >- " private int field = \n" + >- " ^^^^^\n" + >- "The field X.field is never read locally\n" + >- "----------\n" + >- "2. WARNING in X.java (at line 5)\n" + >+ "1. WARNING in X.java (at line 5)\n" + > " field = 0; \n" + > " ^^^^^\n" + > "Write access to enclosing field X.field is emulated by a synthetic accessor method\n" + > "----------\n" + >- "3. WARNING in X.java (at line 6)\n" + >+ "2. WARNING in X.java (at line 6)\n" + > " return field; \n" + > " ^^^^^\n" + > "Read access to enclosing field X.field is emulated by a synthetic accessor method\n" + >@@ -13366,12 +13020,7 @@ > }, > null, customOptions, > "----------\n" + >- "1. WARNING in X.java (at line 2)\n" + >- " private int x = 0;\n" + >- " ^\n" + >- "The field X.x is never read locally\n" + >- "----------\n" + >- "2. ERROR in X.java (at line 3)\n" + >+ "1. ERROR in X.java (at line 3)\n" + > " int foo(int x) { \n" + > " ^\n" + > "The parameter x is hiding a field from type X\n" + >@@ -13399,22 +13048,12 @@ > "} \n", > }, > "----------\n" + >- "1. WARNING in X.java (at line 3)\n" + >- " private X nextX; \n" + >- " ^^^^^\n" + >- "The field X.nextX is never read locally\n" + >- "----------\n" + >- "2. WARNING in X.java (at line 7)\n" + >- " void bar() { \n" + >- " ^^^^^\n" + >- "The method bar() from the type new Object(){} is never used locally\n" + >- "----------\n" + >- "3. WARNING in X.java (at line 8)\n" + >+ "1. WARNING in X.java (at line 8)\n" + > " someX.nextX = null; \n" + > " ^^^^^\n" + > "Read access to enclosing field X.someX is emulated by a synthetic accessor method\n" + > "----------\n" + >- "4. WARNING in X.java (at line 8)\n" + >+ "2. WARNING in X.java (at line 8)\n" + > " someX.nextX = null; \n" + > " ^^^^^\n" + > "Write access to enclosing field X.nextX is emulated by a synthetic accessor method\n" + >@@ -13874,11 +13513,6 @@ > "----------\n" + > "11. WARNING in p\\X.java (at line 13)\n" + > " class Object { }; \n" + >- " ^^^^^^\n" + >- "The type Object is never used locally\n" + >- "----------\n" + >- "12. WARNING in p\\X.java (at line 13)\n" + >- " class Object { }; \n" + > " ^\n" + > "Unnecessary semicolon\n" + > "----------\n", >@@ -13935,22 +13569,17 @@ > " ^\n" + > "Unnecessary semicolon\n" + > "----------\n" + >- "6. WARNING in X.java (at line 9)\n" + >- " class L {\n" + >- " ^\n" + >- "The type L is never used locally\n" + >- "----------\n" + >- "7. WARNING in X.java (at line 10)\n" + >+ "6. WARNING in X.java (at line 10)\n" + > " };//6\n" + > " ^\n" + > "Unnecessary semicolon\n" + > "----------\n" + >- "8. WARNING in X.java (at line 11)\n" + >+ "7. WARNING in X.java (at line 11)\n" + > " };//7\n" + > " ^\n" + > "Unnecessary semicolon\n" + > "----------\n" + >- "9. WARNING in X.java (at line 12)\n" + >+ "8. WARNING in X.java (at line 12)\n" + > " };//8\n" + > " ^\n" + > "Unnecessary semicolon\n" + >@@ -15406,11 +15035,11 @@ > "}\n" > }, > null, customOptions, >- "----------\n" + >- "1. ERROR in X.java (at line 6)\n" + >- " private final int unused = 0;\n" + >- " ^^^^^^\n" + >- "The field X.unused is never read locally\n" + >+ "----------\n" + >+ "1. ERROR in X.java (at line 6)\n" + >+ " private final int unused = 0;\n" + >+ " ^^^^^^\n" + >+ "The field X.unused is never read locally\n" + > "----------\n", > JavacTestOptions.Excuse.EclipseWarningConfiguredAsError); > } >@@ -16385,57 +16014,7 @@ > " }\n" + > "}\n" > }, >- "----------\n" + >- "1. WARNING in X.java (at line 4)\n" + >- " int unused1 = this.unused1 + 1;\n" + >- " ^^^^^^^\n" + >- "The field new Object(){}.unused1 is never read locally\n" + >- "----------\n" + >- "2. WARNING in X.java (at line 5)\n" + >- " void foo1() {}\n" + >- " ^^^^^^\n" + >- "The method foo1() from the type new Object(){} is never used locally\n" + >- "----------\n" + >- "3. WARNING in X.java (at line 8)\n" + >- " class Local {\n" + >- " ^^^^^\n" + >- "The type Local is never used locally\n" + >- "----------\n" + >- "4. WARNING in X.java (at line 9)\n" + >- " class LMember implements Runnable {\n" + >- " ^^^^^^^\n" + >- "The type Local.LMember is never used locally\n" + >- "----------\n" + >- "5. WARNING in X.java (at line 10)\n" + >- " LMember(int i) {}\n" + >- " ^^^^^^^^^^^^^^\n" + >- "The constructor Local.LMember(int) is never used locally\n" + >- "----------\n" + >- "6. WARNING in X.java (at line 11)\n" + >- " int unused2;\n" + >- " ^^^^^^^\n" + >- "The field Local.LMember.unused2 is never read locally\n" + >- "----------\n" + >- "7. WARNING in X.java (at line 12)\n" + >- " void foo2() {}\n" + >- " ^^^^^^\n" + >- "The method foo2() from the type Local.LMember is never used locally\n" + >- "----------\n" + >- "8. WARNING in X.java (at line 15)\n" + >- " Local(int i) {}\n" + >- " ^^^^^^^^^^^^\n" + >- "The constructor Local(int) is never used locally\n" + >- "----------\n" + >- "9. WARNING in X.java (at line 16)\n" + >- " int unused3;\n" + >- " ^^^^^^^\n" + >- "The field Local.unused3 is never read locally\n" + >- "----------\n" + >- "10. WARNING in X.java (at line 17)\n" + >- " void foo3() {}\n" + >- " ^^^^^^\n" + >- "The method foo3() from the type Local is never used locally\n" + >- "----------\n", >+ "", > null, null, JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings); > } > public void test441() { >@@ -16492,45 +16071,10 @@ > "} \n" > }, > "----------\n" + >- "1. WARNING in X.java (at line 2)\n" + >- " private class M { \n" + >- " ^\n" + >- "The type X.M is never used locally\n" + >- "----------\n" + >- "2. WARNING in X.java (at line 3)\n" + >- " private class Member1 {} \n" + >- " ^^^^^^^\n" + >- "The type X.M.Member1 is never used locally\n" + >- "----------\n" + >- "3. WARNING in X.java (at line 4)\n" + >- " private class Member2 extends M { \n" + >- " ^^^^^^^\n" + >- "The type X.M.Member2 is never used locally\n" + >- "----------\n" + >- "4. WARNING in X.java (at line 4)\n" + >+ "1. WARNING in X.java (at line 4)\n" + > " private class Member2 extends M { \n" + > " ^^^^^^^\n" + > "Access to enclosing constructor X.M() is emulated by a synthetic accessor method\n" + >- "----------\n" + >- "5. WARNING in X.java (at line 8)\n" + >- " class Local1 {} \n" + >- " ^^^^^^\n" + >- "The type Local1 is never used locally\n" + >- "----------\n" + >- "6. WARNING in X.java (at line 9)\n" + >- " class Local2 { \n" + >- " ^^^^^^\n" + >- "The type Local2 is never used locally\n" + >- "----------\n" + >- "7. WARNING in X.java (at line 11)\n" + >- " class LMember2 extends Local2 { \n" + >- " ^^^^^^^^\n" + >- "The type Local2.LMember2 is never used locally\n" + >- "----------\n" + >- "8. WARNING in X.java (at line 13)\n" + >- " LMember1 m1;\n" + >- " ^^\n" + >- "The field Local2.m1 is never read locally\n" + > "----------\n", > null, null, JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings); > >@@ -16562,45 +16106,10 @@ > "} \n" > }, > "----------\n" + >- "1. WARNING in X.java (at line 2)\n" + >- " private class M { \n" + >- " ^\n" + >- "The type X.M is never used locally\n" + >- "----------\n" + >- "2. WARNING in X.java (at line 3)\n" + >- " private class Member1 {} \n" + >- " ^^^^^^^\n" + >- "The type X.M.Member1 is never used locally\n" + >- "----------\n" + >- "3. WARNING in X.java (at line 4)\n" + >+ "1. WARNING in X.java (at line 4)\n" + > " private class Member2 extends M { \n" + > " ^^^^^^^\n" + > "Access to enclosing constructor X.M() is emulated by a synthetic accessor method\n" + >- "----------\n" + >- "4. WARNING in X.java (at line 6)\n" + >- " M.Member2 m2;\n" + >- " ^^\n" + >- "The field X.M.m2 is never read locally\n" + >- "----------\n" + >- "5. WARNING in X.java (at line 9)\n" + >- " class Local1 {} \n" + >- " ^^^^^^\n" + >- "The type Local1 is never used locally\n" + >- "----------\n" + >- "6. WARNING in X.java (at line 10)\n" + >- " class Local2 { \n" + >- " ^^^^^^\n" + >- "The type Local2 is never used locally\n" + >- "----------\n" + >- "7. WARNING in X.java (at line 11)\n" + >- " class LMember1 {} \n" + >- " ^^^^^^^^\n" + >- "The type Local2.LMember1 is never used locally\n" + >- "----------\n" + >- "8. WARNING in X.java (at line 12)\n" + >- " class LMember2 extends Local2 { \n" + >- " ^^^^^^^^\n" + >- "The type Local2.LMember2 is never used locally\n" + > "----------\n", > null, null, JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings); > >@@ -16637,32 +16146,27 @@ > "} \n" > }, > "----------\n" + >- "1. WARNING in X.java (at line 2)\n" + >- " private class M { \n" + >- " ^\n" + >- "The type X.M is never used locally\n" + >- "----------\n" + >- "2. ERROR in X.java (at line 4)\n" + >+ "1. ERROR in X.java (at line 4)\n" + > " static{} \n" + > " ^\n" + > "Cannot define static initializer in inner type X.M.Member1\n" + > "----------\n" + >- "3. ERROR in X.java (at line 7)\n" + >+ "2. ERROR in X.java (at line 7)\n" + > " static{} \n" + > " ^\n" + > "Cannot define static initializer in inner type X.M.Member2\n" + > "----------\n" + >- "4. ERROR in X.java (at line 12)\n" + >+ "3. ERROR in X.java (at line 12)\n" + > " static{} \n" + > " ^\n" + > "Cannot define static initializer in inner type Local1\n" + > "----------\n" + >- "5. ERROR in X.java (at line 16)\n" + >+ "4. ERROR in X.java (at line 16)\n" + > " static{} \n" + > " ^\n" + > "Cannot define static initializer in inner type Local2.LMember1\n" + > "----------\n" + >- "6. ERROR in X.java (at line 19)\n" + >+ "5. ERROR in X.java (at line 19)\n" + > " static{} \n" + > " ^\n" + > "Cannot define static initializer in inner type Local2.LMember2\n" + >#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:05:54 -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:05:54 -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<T> 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<T> 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<T> 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<T> 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<T> 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<T> 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<T> 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:05:55 -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:05:56 -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<R> is never used locally\n" + >- "----------\n" + >- "2. WARNING in test\\Foo.java (at line 5)\n" + >- " private class Bar {} \n" + >- " ^^^\n" + >- "The type Foo<R>.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<MPair<K,V>> {}\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<K,V>.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>.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<T>.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<T>.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<T>.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>.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<E> 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<? extends String>) {}\n" + > " ^^^^^^^^^^^^^^^^^\n" + > "Cannot perform instanceof check against parameterized type List<? extends String>. 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<E> 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<? extends String>[]) {}\n" + > " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + > "Cannot perform instanceof check against parameterized type List<? extends String>[]. 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<T>.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<X<?>> l2 = castList(l1, List.class);\n" + > " ^^^^^^^^^^^^^^^^^^^^^^^^\n" + > "Type mismatch: cannot convert from List<List> to List<X<?>>\n" + > "----------\n" + >- "3. WARNING in X.java (at line 22)\n" + >+ "2. WARNING in X.java (at line 22)\n" + > " List<X> l3 = l2;\n" + > " ^\n" + > "X is a raw type. References to generic type X<T> should be parameterized\n" + > "----------\n" + >- "4. ERROR in X.java (at line 22)\n" + >+ "3. ERROR in X.java (at line 22)\n" + > " List<X> l3 = l2;\n" + > " ^^\n" + > "Type mismatch: cannot convert from List<X<?>> to List<X>\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<X<String>> to List<X>\n" + >@@ -36767,30 +36729,10 @@ > " ^\n" + > "The nested type T is hiding the type parameter T of type Y<T>\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<T>.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<T>.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<T> 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<T> 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>(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<String, String> entry : myMap().entrySet()) {\n" + > " ^^^^^^^^^^^^^^^^^^\n" + > "Type mismatch: cannot convert from element type Object to Map.Entry<String,String>\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<T>.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<T>.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<T>.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<T>.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<T>.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<T>.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<T>.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<T>.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<T>.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<T>.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<T>.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<T>.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<T>.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().<String> 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().<String> 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<T extends Secondary.Private> {\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<X.Private,Secondary.SecondaryPrivate> {\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<X.Private,Secondary.SecondaryPrivate> {\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<X.Inter.Private> {\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<IReferencedInterface> {}\n" > }, > "----------\n" + >- "1. WARNING in AnotherClass.java (at line 3)\n" + >- " private AnotherClass<IReferencedInterface> 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<capture#1-of ? extends IReferencedInterface> to AnotherClass<IReferencedInterface>\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:05:56 -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:05:56 -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"); >+ } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 324848
:
178645
|
178650