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 84439 Details for
Bug 196200
[jsr269] Need annotation bindings even when code contains errors
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
More advanced patch v5
196200s.txt (text/plain), 295.32 KB, created by
Philipe Mulet
on 2007-12-04 13:00:35 EST
(
hide
)
Description:
More advanced patch v5
Filename:
MIME Type:
Creator:
Philipe Mulet
Created:
2007-12-04 13:00:35 EST
Size:
295.32 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests >Index: Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/FromJikesPRs.java >=================================================================== >RCS file: /home/cvs/numbat/org.eclipse.jdt.core.tests/Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/FromJikesPRs.java,v >retrieving revision 1.25 >diff -u -r1.25 FromJikesPRs.java >--- Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/FromJikesPRs.java 6 Mar 2007 04:29:57 -0000 1.25 >+++ Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/FromJikesPRs.java 4 Dec 2007 16:30:38 -0000 >@@ -335,12 +335,7 @@ > "} \n" > }, > "----------\n" + >- "1. WARNING in Outer.java (at line 2)\n" + >- " private class Inner {} \n" + >- " ^^^^^\n" + >- "The type Outer.Inner is never used locally\n" + >- "----------\n" + >- "2. ERROR in Outer.java (at line 4)\n" + >+ "1. ERROR in Outer.java (at line 4)\n" + > " new Outer(){}.new Inner(){}; \n" + > " ^^^^^\n" + > "The type Outer.Inner is not visible\n" + >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.40 >diff -u -r1.40 InnerClassTest.java >--- Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/InnerClassTest.java 16 Oct 2007 10:24:34 -0000 1.40 >+++ Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/InnerClassTest.java 4 Dec 2007 16:30:41 -0000 >@@ -7688,8 +7688,12 @@ > " A.E ae = new A().new A.E();\n" + > " ^\n" + > "A cannot be resolved to a type\n" + >- "----------\n" >- ); >+ "----------\n" + >+ "3. ERROR in InnerClassTests\\PassingParameters\\Test05.java (at line 5)\n" + >+ " System.out.println( ae.varE );\n" + >+ " ^^\n" + >+ "A cannot be resolved to a type\n" + >+ "----------\n"); > } > public void test163() { > this.runConformTest(new String[] { >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.307 >diff -u -r1.307 NegativeTest.java >--- Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/NegativeTest.java 8 Nov 2007 16:28:45 -0000 1.307 >+++ Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/NegativeTest.java 4 Dec 2007 16:30:43 -0000 >@@ -3803,8 +3803,7 @@ > " int t = new Test1xHelp().x;\n" + > " ^^^^^^^^^^\n" + > "Test1xHelp cannot be resolved to a type\n" + >- "----------\n" >- ); >+ "----------\n"); > } > public void test096() { > this.runNegativeTest( >@@ -6106,8 +6105,12 @@ > " Zork z = null; // variable type does not exist\n" + > " ^^^^\n" + > "Zork cannot be resolved to a type\n" + >- "----------\n" >- ); >+ "----------\n" + >+ "2. ERROR in p\\AIB.java (at line 9)\n" + >+ " z.zork();\n" + >+ " ^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n"); > } > public void test170() { > this.runNegativeTest( >@@ -6140,17 +6143,32 @@ > " ^^^^\n" + > "Zork cannot be resolved to a type\n" + > "----------\n" + >- "2. ERROR in p\\AJB.java (at line 15)\n" + >+ "2. ERROR in p\\AJB.java (at line 9)\n" + >+ " z.zork();\n" + >+ " ^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "3. ERROR in p\\AJB.java (at line 10)\n" + >+ " z.foo.bar.zork();\n" + >+ " ^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "4. ERROR in p\\AJB.java (at line 11)\n" + >+ " zork(z.foo);\n" + >+ " ^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "5. ERROR in p\\AJB.java (at line 15)\n" + > " void bar(Zork x){\n" + > " ^^^^\n" + > "Zork cannot be resolved to a type\n" + > "----------\n" + >- "3. ERROR in p\\AJB.java (at line 16)\n" + >+ "6. ERROR in p\\AJB.java (at line 16)\n" + > " Object x = z;\n" + > " ^\n" + > "Duplicate local variable x\n" + > "----------\n" + >- "4. ERROR in p\\AJB.java (at line 16)\n" + >+ "7. ERROR in p\\AJB.java (at line 16)\n" + > " Object x = z;\n" + > " ^\n" + > "Cannot refer to a non-final variable z inside an inner class defined in a different method\n" + >@@ -8291,12 +8309,12 @@ > "----------\n" + > "1. ERROR in p\\r2\\CMain.java (at line 20)\n" + > " p1.p2.i = 3;\n" + >- " ^^^^^^^\n" + >+ " ^^^^^\n" + > "The type P2 is not visible\n" + > "----------\n" + > "2. ERROR in p\\r2\\CMain.java (at line 21)\n" + > " System.out.println(p1.p2.i);\n" + >- " ^^^^^^^\n" + >+ " ^^^^^\n" + > "The type P2 is not visible\n" + > "----------\n" + > "----------\n" + >@@ -8772,20 +8790,12 @@ > "}", > > }, >- "----------\n" + >- "1. ERROR in p\\k\\ExtendsA.java (at line 4)\n" + >- " 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 3)\n" + >- " private class Inner {\n" + >- " ^^^^^\n" + >- "The type AA.Inner is never used locally\n" + >- "----------\n" >- >- ); >+ "----------\n" + >+ "1. ERROR in p\\k\\ExtendsA.java (at line 4)\n" + >+ " int i = new AA().new Inner().i; // THIS LINE SHOULD CAUSE AN ERROR\n" + >+ " ^^^^^\n" + >+ "The type AA.Inner is not visible\n" + >+ "----------\n" ); > } > public void test227() { > this.runNegativeTest( >@@ -9412,6 +9422,11 @@ > " void foo(IA5 ia5) throws CloneNotSupportedException {\n" + > " ^^^\n" + > "IA5 cannot be resolved to a type\n" + >+ "----------\n" + >+ "2. ERROR in p\\c\\A6.java (at line 7)\n" + >+ " ia5.clone();\n" + >+ " ^^^^^\n" + >+ "The method clone() from the type Object is not visible\n" + > "----------\n" > ); > } >@@ -10043,6 +10058,11 @@ > " int foo(Zork z){ \n" + > " ^^^^\n" + > "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 6)\n" + >+ " return z.i; \n" + >+ " ^\n" + >+ "Zork cannot be resolved to a type\n" + > "----------\n"); > } > >@@ -11902,12 +11922,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" + >- "----------\n" + > "1. ERROR in q\\Y.java (at line 2)\n" + > " import p.X.Y.Z; \n" + > " ^^^^^\n" + >@@ -12124,27 +12138,22 @@ > "} \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" + >+ "1. WARNING in X.java (at line 3)\n" + > " private int f; \n" + > " ^\n" + > "The field X.f is never read locally\n" + > "----------\n" + >- "3. ERROR in X.java (at line 6)\n" + >+ "2. ERROR in X.java (at line 6)\n" + > " int y = new X().f; \n" + > " ^\n" + > "The field X.f is not visible\n" + > "----------\n" + >- "4. ERROR in X.java (at line 7)\n" + >+ "3. ERROR in X.java (at line 7)\n" + > " X.M xm = new X().new M(); \n" + > " ^^^\n" + > "The type X.M is not visible\n" + > "----------\n" + >- "5. ERROR in X.java (at line 7)\n" + >+ "4. ERROR in X.java (at line 7)\n" + > " X.M xm = new X().new M(); \n" + > " ^\n" + > "The type X.M is not visible\n" + >@@ -12170,37 +12179,32 @@ > "} \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" + >+ "1. WARNING in X.java (at line 3)\n" + > " { X.this.foo(); } \n" + > " ^^^^^^^^^^^^\n" + > "Access to enclosing method foo() from the type X is emulated by a synthetic accessor method. Increasing its visibility will improve your performance\n" + > "----------\n" + >- "3. WARNING in X.java (at line 4)\n" + >+ "2. WARNING in X.java (at line 4)\n" + > " { X.this.f++; } \n" + > " ^\n" + > "Read access to enclosing field X.f is emulated by a synthetic accessor method. Increasing its visibility will improve your performance\n" + > "----------\n" + >- "4. WARNING in X.java (at line 4)\n" + >+ "3. WARNING in X.java (at line 4)\n" + > " { X.this.f++; } \n" + > " ^\n" + > "Write access to enclosing field X.f is emulated by a synthetic accessor method. Increasing its visibility will improve your performance\n" + > "----------\n" + >- "5. ERROR in X.java (at line 10)\n" + >+ "4. ERROR in X.java (at line 10)\n" + > " int y = new X().f; \n" + > " ^\n" + > "The field X.f is not visible\n" + > "----------\n" + >- "6. ERROR in X.java (at line 11)\n" + >+ "5. ERROR in X.java (at line 11)\n" + > " X.M xm = new X().new M(); \n" + > " ^^^\n" + > "The type X.M is not visible\n" + > "----------\n" + >- "7. ERROR in X.java (at line 11)\n" + >+ "6. ERROR in X.java (at line 11)\n" + > " X.M xm = new X().new M(); \n" + > " ^\n" + > "The type X.M is not visible\n" + >@@ -15791,6 +15795,11 @@ > " Zork zork() {\n" + > " ^^^^\n" + > "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 3)\n" + >+ " return this;\n" + >+ " ^^^^\n" + >+ "Type mismatch: cannot convert from X to Zork\n" + > "----------\n"); > } > /* >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/JavaSearchTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchTests.java,v >retrieving revision 1.169 >diff -u -r1.169 JavaSearchTests.java >--- src/org/eclipse/jdt/core/tests/model/JavaSearchTests.java 27 Nov 2007 08:42:06 -0000 1.169 >+++ src/org/eclipse/jdt/core/tests/model/JavaSearchTests.java 4 Dec 2007 16:30:58 -0000 >@@ -2989,6 +2989,8 @@ > */ > public void testTypeReference26() throws CoreException { // was testInnacurateTypeReference2 > >+ this.resultCollector.showAccuracy = true; >+ this.resultCollector.showSelection = true; > search( > "p.Zork", > TYPE, >@@ -2998,9 +3000,9 @@ > }), > this.resultCollector); > assertSearchResults( >- "src/b5/A.java b5.A.{} [Zork]\n" + >- "src/b5/A.java b5.A.{} [Zork]\n" + >- "src/b5/A.java b5.A.{} [Zork]", >+ "src/b5/A.java b5.A.{} [ §|Zork|§[] zork = new Zork[0];] POTENTIAL_MATCH\n" + >+ "src/b5/A.java b5.A.{} [ Zork[] zork = new §|Zork|§[0];] POTENTIAL_MATCH\n" + >+ "src/b5/A.java b5.A.{} [ int i = §|Zork|§.foo;] POTENTIAL_MATCH", > this.resultCollector); > } > /** >Index: src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java,v >retrieving revision 1.122 >diff -u -r1.122 ReconcilerTests.java >--- src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java 29 Nov 2007 12:59:09 -0000 1.122 >+++ src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java 4 Dec 2007 16:30:58 -0000 >@@ -2027,8 +2027,12 @@ > this.workingCopy.open(null); > assertProblems( > "Unexpected problems", >- "----------\n" + >- "----------\n" // shouldn't report problem against p2.X01 >+ "----------\n" + >+ "1. ERROR in /Reconciler/src/p2/X01.java (at line 2)\n" + >+ " public class X01 extends p1.X01 {\n" + >+ " ^^^\n" + >+ "The type X01 must implement the inherited abstract method X01.foo(Zork)\n" + >+ "----------\n" > ); > } finally { > deleteFile("/Reconciler/src/p1/X01.java"); >@@ -3764,19 +3768,17 @@ > this.problemRequestor.initialize(sourcesAsCharArrays[2]); > this.workingCopies[2] = getCompilationUnit("/P3/Y.java").getWorkingCopy(this.wcOwner, null); > assertProblems("Working copy should have problems:", >- "----------\n" + >- "1. ERROR in /P3/Y.java (at line 1)\n" + >- " class Y implements I {\n" + >- " ^\n" + >-// we miss the first diagnostic - see justification in bugzilla >-// "The type Y must implement the inherited abstract method I.bar(X)\n" + >-// "----------\n" + >-// "2. ERROR in /P3/Y.java (at line 1)\n" + >-// " class Y implements I {\n" + >-// " ^\n" + >- "The type Y must implement the inherited abstract method I.foo()\n" + >- "----------\n" >- ); >+ "----------\n" + >+ "1. ERROR in /P3/Y.java (at line 1)\n" + >+ " class Y implements I {\n" + >+ " ^\n" + >+ "The type Y must implement the inherited abstract method I.bar(X)\n" + >+ "----------\n" + >+ "2. ERROR in /P3/Y.java (at line 1)\n" + >+ " class Y implements I {\n" + >+ " ^\n" + >+ "The type Y must implement the inherited abstract method I.foo()\n" + >+ "----------\n"); > } finally { > deleteProject("P1"); > deleteProject("P2"); >Index: src/org/eclipse/jdt/core/tests/model/JavaSearchJavadocTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchJavadocTests.java,v >retrieving revision 1.32 >diff -u -r1.32 JavaSearchJavadocTests.java >--- src/org/eclipse/jdt/core/tests/model/JavaSearchJavadocTests.java 27 Nov 2007 11:44:25 -0000 1.32 >+++ src/org/eclipse/jdt/core/tests/model/JavaSearchJavadocTests.java 4 Dec 2007 16:30:57 -0000 >@@ -853,28 +853,32 @@ > * Test fix for bug 54962. > * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=54962">54962</a> > * @throws CoreException >+ * TODO (frederic) should no longer get POTENTIAL after 196200 got fixed > */ > public void testBug54962() throws CoreException { > setJavadocOptions(); > this.resultCollector.showInsideDoc = true; >+ this.resultCollector.showSelection = true; > IPackageDeclaration packDecl = getCompilationUnit("JavaSearch", "src", "j6", "Bug54962.java").getPackageDeclaration("j6"); > search(packDecl, REFERENCES, getJavaSearchScope()); > assertSearchResults( >- "src/j6/Bug54962.java j6.Bug54962 [j6] EXACT_MATCH INSIDE_JAVADOC\n" + >- "src/j6/Bug54962.java j6.Bug54962 [j6] POTENTIAL_MATCH INSIDE_JAVADOC\n" + >- "src/j6/Bug54962.java j6.Bug54962 [j6] EXACT_MATCH INSIDE_JAVADOC\n" + >- "src/j7/qua/li/fied/Bug54962a.java [j6] EXACT_MATCH OUTSIDE_JAVADOC", >+ "src/j6/Bug54962.java j6.Bug54962 [ * @see §|j6|§] EXACT_MATCH INSIDE_JAVADOC\n" + >+ "src/j6/Bug54962.java j6.Bug54962 [ * @see §|j6|§.BUG54962] POTENTIAL_MATCH INSIDE_JAVADOC\n" + >+ "src/j6/Bug54962.java j6.Bug54962 [ * @see §|j6|§.Bug54962] EXACT_MATCH INSIDE_JAVADOC\n" + >+ "src/j7/qua/li/fied/Bug54962a.java [import §|j6|§.Bug54962;] EXACT_MATCH OUTSIDE_JAVADOC", > this.resultCollector); > } >+ // TODO (frederic) should no longer get POTENTIAL after 196200 got fixed > public void testBug54962qualified() throws CoreException { > setJavadocOptions(); > this.resultCollector.showInsideDoc = true; >+ this.resultCollector.showSelection = true; > IPackageDeclaration packDecl = getCompilationUnit("JavaSearch", "src", "j7.qua.li.fied", "Bug54962a.java").getPackageDeclaration("j7.qua.li.fied"); > search(packDecl, REFERENCES, getJavaSearchScope()); > assertSearchResults( >- "src/j7/qua/li/fied/Bug54962a.java j7.qua.li.fied.Bug54962a [j7.qua.li.fied] EXACT_MATCH INSIDE_JAVADOC\n" + >- "src/j7/qua/li/fied/Bug54962a.java j7.qua.li.fied.Bug54962a [j7.qua.li.fied] POTENTIAL_MATCH INSIDE_JAVADOC\n" + >- "src/j7/qua/li/fied/Bug54962a.java j7.qua.li.fied.Bug54962a [j7.qua.li.fied] EXACT_MATCH INSIDE_JAVADOC", >+ "src/j7/qua/li/fied/Bug54962a.java j7.qua.li.fied.Bug54962a [ * @see §|j7.qua.li.fied|§] EXACT_MATCH INSIDE_JAVADOC\n" + >+ "src/j7/qua/li/fied/Bug54962a.java j7.qua.li.fied.Bug54962a [ * @see §|j7.qua.li.fied|§.BUG54962a] POTENTIAL_MATCH INSIDE_JAVADOC\n" + >+ "src/j7/qua/li/fied/Bug54962a.java j7.qua.li.fied.Bug54962a [ * @see §|j7.qua.li.fied|§.Bug54962a] EXACT_MATCH INSIDE_JAVADOC", > this.resultCollector); > } > >Index: src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java,v >retrieving revision 1.134 >diff -u -r1.134 ASTConverterTestAST3_2.java >--- src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java 6 Nov 2007 08:39:39 -0000 1.134 >+++ src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java 4 Dec 2007 16:30:56 -0000 >@@ -6571,8 +6571,8 @@ > assertEquals("Wrong size", 1, fragments.size()); > VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0); > IVariableBinding binding = fragment.resolveBinding(); >- assertNull("Got a binding", binding); >- >+ assertNotNull("No binding", binding); >+ assertEquals("LX;.foo(Z)V#z", binding.getKey()); > node = getASTNode(unit, 0, 0, 1); > assertEquals("Not an if statement", ASTNode.IF_STATEMENT, node.getNodeType()); > IfStatement ifStatement = (IfStatement) node; >@@ -6596,7 +6596,8 @@ > assertEquals("Not a simple name", ASTNode.SIMPLE_NAME, expression2.getNodeType()); > SimpleName simpleName = (SimpleName) expression2; > IBinding binding2 = simpleName.resolveBinding(); >- assertNull("Got a binding", binding2); >+ assertNotNull("No binding", binding2); >+ assertEquals("LX;.foo(Z)V#z", binding2.getKey()); > } finally { > if (workingCopy != null) > workingCopy.discardWorkingCopy(); >@@ -8726,8 +8727,12 @@ > false); > assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); > CompilationUnit unit = (CompilationUnit) node; >- String expectedError = "List cannot be resolved to a type"; >- assertProblemsSize(unit, 1, expectedError); >+ String expectedError = >+ "List cannot be resolved to a type\n" + >+ "Type mismatch: cannot convert from ArrayList to List\n" + >+ "List cannot be resolved to a type\n" + >+ "Type mismatch: cannot convert from List to String"; >+ assertProblemsSize(unit, 4, expectedError); > node = getASTNode(unit, 0, 0, 0); > assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType()); > VariableDeclarationStatement statement = (VariableDeclarationStatement) node; >@@ -8735,7 +8740,8 @@ > assertEquals("No fragments", 1, fragments.size()); > VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0); > IVariableBinding variableBinding = fragment.resolveBinding(); >- assertNull("No binding", variableBinding); >+ assertNotNull("No binding", variableBinding); >+ assertEquals("LX;.foo()Ljava/lang/String;#c", variableBinding.getKey()); > } finally { > if (workingCopy != null) > workingCopy.discardWorkingCopy(); >@@ -8769,7 +8775,8 @@ > assertEquals("Not a method declaration", ASTNode.METHOD_DECLARATION, node.getNodeType()); > MethodDeclaration declaration = (MethodDeclaration) node; > IMethodBinding binding = declaration.resolveBinding(); >- assertNull("Got a binding", binding); >+ assertNotNull("No binding", binding); >+ assertEquals("LX;.foo()LList;", binding.getKey()); > } finally { > if (workingCopy != null) > workingCopy.discardWorkingCopy(); >@@ -8815,8 +8822,12 @@ > ASTNode node = runConversion(AST.JLS3, workingCopy, true, true, true); > assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); > CompilationUnit unit = (CompilationUnit) node; >- String expectedError = "List cannot be resolved to a type"; >- assertProblemsSize(unit, 1, expectedError); >+ String expectedError = >+ "List cannot be resolved to a type\n" + >+ "Type mismatch: cannot convert from ArrayList to List\n" + >+ "List cannot be resolved to a type\n" + >+ "Type mismatch: cannot convert from List to String"; >+ assertProblemsSize(unit, 4, expectedError); > node = getASTNode(unit, 0, 0, 0); > assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType()); > VariableDeclarationStatement statement = (VariableDeclarationStatement) node; >@@ -8857,8 +8868,12 @@ > ASTNode node = runConversion(AST.JLS3, workingCopy, true, true, true); > assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); > CompilationUnit unit = (CompilationUnit) node; >- String expectedError = "List cannot be resolved to a type"; >- assertProblemsSize(unit, 1, expectedError); >+ String expectedError = >+ "List cannot be resolved to a type\n" + >+ "Type mismatch: cannot convert from ArrayList to List[][]\n" + >+ "Cannot invoke add(null) on the array type List[][]\n" + >+ "Type mismatch: cannot convert from List[][] to String" ; >+ assertProblemsSize(unit, 4, expectedError); > node = getASTNode(unit, 0, 0, 0); > assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType()); > VariableDeclarationStatement statement = (VariableDeclarationStatement) node; >@@ -8926,8 +8941,12 @@ > ASTNode node = runConversion(AST.JLS3, workingCopy, true, true, true); > assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); > CompilationUnit unit = (CompilationUnit) node; >- String expectedError = "List cannot be resolved to a type"; >- assertProblemsSize(unit, 1, expectedError); >+ String expectedError = >+ "List cannot be resolved to a type\n" + >+ "Type mismatch: cannot convert from ArrayList to List[][]\n" + >+ "Cannot invoke add(null) on the array type List[][]\n" + >+ "Type mismatch: cannot convert from List[][] to String"; >+ assertProblemsSize(unit, 4, expectedError); > assertTrue("No binding recovery", unit.getAST().hasBindingsRecovery()); > node = getASTNode(unit, 0, 0, 0); > assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType()); >Index: src/org/eclipse/jdt/core/tests/dom/ASTConverterAST3Test.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterAST3Test.java,v >retrieving revision 1.22 >diff -u -r1.22 ASTConverterAST3Test.java >--- src/org/eclipse/jdt/core/tests/dom/ASTConverterAST3Test.java 20 Mar 2006 17:23:38 -0000 1.22 >+++ src/org/eclipse/jdt/core/tests/dom/ASTConverterAST3Test.java 4 Dec 2007 16:30:50 -0000 >@@ -5419,7 +5419,8 @@ > assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$ > VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0); > IVariableBinding variableBinding = fragment.resolveBinding(); >- assertNull("binding not null", variableBinding); //$NON-NLS-1$ >+ assertNotNull("No binding", variableBinding); //$NON-NLS-1$ >+ assertEquals("Ltest0234/Test;.field)LList;", variableBinding.getKey()); > } > > /** >@@ -6945,8 +6946,8 @@ > assertNotNull("No compilation unit", result); //$NON-NLS-1$ > assertTrue("result is not a compilation unit", result instanceof CompilationUnit); //$NON-NLS-1$ > CompilationUnit compilationUnit = (CompilationUnit) result; >- assertEquals("Wrong size", 2, compilationUnit.getMessages().length); //$NON-NLS-1$ >- assertEquals("Wrong size", 2, compilationUnit.getProblems().length); //$NON-NLS-1$ >+ assertEquals("Wrong size", 1, compilationUnit.getMessages().length); //$NON-NLS-1$ >+ assertEquals("Wrong size", 1, compilationUnit.getProblems().length); //$NON-NLS-1$ > ASTNode node = getASTNode(compilationUnit, 0, 1, 0); > assertTrue("Not an ExpressionStatement", node instanceof ExpressionStatement); //$NON-NLS-1$ > ExpressionStatement expressionStatement = (ExpressionStatement) node; >Index: src/org/eclipse/jdt/core/tests/dom/ASTConverterTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTest.java,v >retrieving revision 1.79 >diff -u -r1.79 ASTConverterTest.java >--- src/org/eclipse/jdt/core/tests/dom/ASTConverterTest.java 27 Apr 2007 16:02:33 -0000 1.79 >+++ src/org/eclipse/jdt/core/tests/dom/ASTConverterTest.java 4 Dec 2007 16:30:53 -0000 >@@ -5573,7 +5573,8 @@ > assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$ > VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0); > IVariableBinding variableBinding = fragment.resolveBinding(); >- assertNull("binding not null", variableBinding); //$NON-NLS-1$ >+ assertNotNull("No binding", variableBinding); //$NON-NLS-1$ >+ assertEquals("Ltest0234/Test;.field)LList;", variableBinding.getKey()); > } > > /** >@@ -7116,8 +7117,8 @@ > assertNotNull("No compilation unit", result); //$NON-NLS-1$ > assertTrue("result is not a compilation unit", result instanceof CompilationUnit); //$NON-NLS-1$ > CompilationUnit compilationUnit = (CompilationUnit) result; >- assertEquals("Wrong size", 2, compilationUnit.getMessages().length); //$NON-NLS-1$ >- assertEquals("Wrong size", 2, compilationUnit.getProblems().length); //$NON-NLS-1$ >+ assertEquals("Wrong size", 1, compilationUnit.getMessages().length); //$NON-NLS-1$ >+ assertEquals("Wrong size", 1, compilationUnit.getProblems().length); //$NON-NLS-1$ > ASTNode node = getASTNode(compilationUnit, 0, 1, 0); > assertTrue("Not an ExpressionStatement", node instanceof ExpressionStatement); //$NON-NLS-1$ > ExpressionStatement expressionStatement = (ExpressionStatement) node; >Index: src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java,v >retrieving revision 1.258 >diff -u -r1.258 ASTConverter15Test.java >--- src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java 6 Nov 2007 08:39:11 -0000 1.258 >+++ src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java 4 Dec 2007 16:30:47 -0000 >@@ -2902,9 +2902,8 @@ > this.workingCopy, > false); > IBinding binding = ((MethodDeclaration) node).resolveBinding(); >- assertEquals( >- null, >- binding); >+ assertNotNull("No binding", binding); >+ assertEquals("LX;.foo<T:Ljava/lang/Object;>(LNonExisting;)V", binding.getKey()); > } > > /* >@@ -4164,11 +4163,12 @@ > assertNotNull("No node", node); > assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); > CompilationUnit compilationUnit = (CompilationUnit) node; >- assertProblemsSize(compilationUnit, 4, >- "URL cannot be resolved to a type\n" + >- "URL cannot be resolved to a type\n" + >- "URL cannot be resolved to a type\n" + >- "URL cannot be resolved to a type"); >+ assertProblemsSize(compilationUnit, 5, >+ "URL cannot be resolved to a type\n" + >+ "URL cannot be resolved to a type\n" + >+ "URL cannot be resolved to a type\n" + >+ "Cannot instantiate the type List<URL>\n" + >+ "URL cannot be resolved to a type"); > compilationUnit.accept(new ASTVisitor() { > public boolean visit(ParameterizedType type) { > checkSourceRange(type, "java.util.List<URL>", contents); >@@ -7606,9 +7606,9 @@ > assertNotNull("No binding", typeBinding); > IMethodBinding[] methodBindings = typeBinding.getDeclaredMethods(); > assertNotNull("No method bindings", methodBindings); >- assertEquals("wrong size", 1, methodBindings.length); >- assertFalse("Method is not the method foo", "foo".equals(methodBindings[0].getName())); >- assertNotNull("No return type", methodBindings[0].getReturnType()); >+ assertEquals("wrong size", 2, methodBindings.length); >+ assertEquals("Ltest0237/X;.()V", methodBindings[0].getKey()); >+ assertEquals("Ltest0237/X;.foo()LZork;", methodBindings[1].getKey()); > } > > /* >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/parser/ComplianceDiagnoseTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ComplianceDiagnoseTest.java,v >retrieving revision 1.33 >diff -u -r1.33 ComplianceDiagnoseTest.java >--- src/org/eclipse/jdt/core/tests/compiler/parser/ComplianceDiagnoseTest.java 16 Oct 2007 10:24:52 -0000 1.33 >+++ src/org/eclipse/jdt/core/tests/compiler/parser/ComplianceDiagnoseTest.java 4 Dec 2007 16:31:00 -0000 >@@ -484,6 +484,11 @@ > " <Y1, Y2>this(null);\n" + > " ^^\n" + > "Y2 cannot be resolved to a type\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 3)\n" + >+ " <Y1, Y2>this(null);\n" + >+ " ^^^^^^^^^^^\n" + >+ "The constructor X(null) is undefined\n" + > "----------\n"; > > runComplianceParserTest( >@@ -2029,11 +2034,6 @@ > " <String>super(\"SUCCESS\");\n" + > " ^^^^^^\n" + > "Syntax error, parameterized types are only available if source level is 5.0\n" + >- "----------\n" + >- "6. ERROR in X.java (at line 9)\n" + >- " <String>super(\"SUCCESS\");\n" + >- " ^^^^^^^^^^^^^^^^^\n" + >- "The constructor X(String) is undefined\n" + > "----------\n"; > String expected14ProblemLog = > expected13ProblemLog; >Index: src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java,v >retrieving revision 1.174 >diff -u -r1.174 AnnotationTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java 30 Nov 2007 19:18:53 -0000 1.174 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java 4 Dec 2007 16:31:01 -0000 >@@ -6016,18 +6016,27 @@ > "\n", // ================= > }, > "----------\n" + >- "1. ERROR in X.java (at line 3)\n" + >- " y.initialize(null, null, null);\n" + >- " ^^^^^^^^^^\n" + >- "The method initialize(null, null, null) is undefined for the type Y\n" + >- "----------\n" + >+ "1. WARNING in Y.java (at line 6)\n" + >+ " public void initialize(Zork z, String s) {\n" + >+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + >+ "The deprecated method initialize(Zork, String) of type Y should be annotated with @Deprecated\n" + > "----------\n" + >- "1. ERROR in Y.java (at line 6)\n" + >+ "2. ERROR in Y.java (at line 6)\n" + > " public void initialize(Zork z, String s) {\n" + > " ^^^^\n" + > "Zork cannot be resolved to a type\n" + > "----------\n" + >- "2. ERROR in Y.java (at line 9)\n" + >+ "3. ERROR in Y.java (at line 6)\n" + >+ " public void initialize(Zork z, String s) {\n" + >+ " ^\n" + >+ "Javadoc: Missing tag for parameter z\n" + >+ "----------\n" + >+ "4. ERROR in Y.java (at line 6)\n" + >+ " public void initialize(Zork z, String s) {\n" + >+ " ^\n" + >+ "Javadoc: Missing tag for parameter s\n" + >+ "----------\n" + >+ "5. ERROR in Y.java (at line 9)\n" + > " public void initialize(Zork z, String s, Thread t) {\n" + > " ^^^^\n" + > "Zork cannot be resolved to a type\n" + >@@ -6058,13 +6067,23 @@ > "1. ERROR in X.java (at line 3)\n" + > " int i = y.initialize;\n" + > " ^^^^^^^^^^^^\n" + >- "y.initialize cannot be resolved or is not a field\n" + >+ "Type mismatch: cannot convert from Zork to int\n" + >+ "----------\n" + >+ "2. WARNING in X.java (at line 3)\n" + >+ " int i = y.initialize;\n" + >+ " ^^^^^^^^^^\n" + >+ "The field Y.initialize is deprecated\n" + > "----------\n" + > "----------\n" + > "1. ERROR in Y.java (at line 6)\n" + > " public Zork initialize;\n" + > " ^^^^\n" + > "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "2. WARNING in Y.java (at line 6)\n" + >+ " public Zork initialize;\n" + >+ " ^^^^^^^^^^\n" + >+ "The deprecated field Y.initialize should be annotated with @Deprecated\n" + > "----------\n"); > } > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=110593 - variation >@@ -6791,8 +6810,8 @@ > "----------\n" + > "1. ERROR in X.java (at line 2)\n" + > " @Ann(m=bar(null))\n" + >- " ^^^\n" + >- "The method bar(null) is undefined for the type X\n" + >+ " ^^^^^^^^^\n" + >+ "Type mismatch: cannot convert from NonExisting to String\n" + > "----------\n" + > "2. ERROR in X.java (at line 4)\n" + > " private NonExisting bar(NonExisting ne){}\n" + >@@ -6853,8 +6872,8 @@ > "----------\n" + > "1. ERROR in X.java (at line 2)\n" + > " @Ann(m=bar())\n" + >- " ^^^\n" + >- "The method bar() is undefined for the type X\n" + >+ " ^^^^^\n" + >+ "Type mismatch: cannot convert from NonExisting to String\n" + > "----------\n" + > "2. ERROR in X.java (at line 4)\n" + > " private NonExisting bar(){}\n" + >@@ -6880,14 +6899,19 @@ > "1. ERROR in X.java (at line 2)\n" + > " @Ann(m=foo)\n" + > " ^^^\n" + >- "foo cannot be resolved\n" + >+ "Cannot reference a field before it is defined\n" + > "----------\n" + >- "2. ERROR in X.java (at line 3)\n" + >+ "2. ERROR in X.java (at line 2)\n" + >+ " @Ann(m=foo)\n" + >+ " ^^^\n" + >+ "Type mismatch: cannot convert from NonExisting to String\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 3)\n" + > " private NonExisting foo;\n" + > " ^^^^^^^^^^^\n" + > "NonExisting cannot be resolved to a type\n" + > "----------\n" + >- "3. ERROR in X.java (at line 4)\n" + >+ "4. ERROR in X.java (at line 4)\n" + > " private NonExisting bar;\n" + > " ^^^^^^^^^^^\n" + > "NonExisting cannot be resolved to a type\n" + >@@ -7590,10 +7614,15 @@ > "----------\n" + > "3. ERROR in X.java (at line 6)\n" + > " @Annot(value={x}, classe={Zork.class,zork})\n" + >+ " ^^^^^^^^^^\n" + >+ "Type mismatch: cannot convert from Class<Zork> to Class<X>\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 6)\n" + >+ " @Annot(value={x}, classe={Zork.class,zork})\n" + > " ^^^^\n" + > "zork cannot be resolved\n" + > "----------\n" + >- "4. ERROR in X.java (at line 6)\n" + >+ "5. ERROR in X.java (at line 6)\n" + > " @Annot(value={x}, classe={Zork.class,zork})\n" + > " ^^^^\n" + > "The value for annotation attribute X.Annot.classe must be a class literal\n" + >@@ -7832,6 +7861,11 @@ > " ArrayList al = null;\n" + > " ^^^^^^^^^\n" + > "ArrayList cannot be resolved to a type\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 6)\n" + >+ " List<String> ls = al;\n" + >+ " ^^\n" + >+ "Type mismatch: cannot convert from ArrayList to List<String>\n" + > "----------\n"); > } > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=207758 - variation >@@ -7853,8 +7887,8 @@ > "----------\n" + > "1. ERROR in X.java (at line 5)\n" + > " List<String> ls = bar();\n" + >- " ^^^\n" + >- "The method bar() is undefined for the type X\n" + >+ " ^^^^^\n" + >+ "Type mismatch: cannot convert from ArrayList to List<String>\n" + > "----------\n" + > "2. ERROR in X.java (at line 7)\n" + > " ArrayList bar() {\n" + >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.675 >diff -u -r1.675 GenericTypeTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java 22 Nov 2007 09:23:27 -0000 1.675 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java 4 Dec 2007 16:31:12 -0000 >@@ -1113,6 +1113,11 @@ > "----------\n" + > "1. ERROR in X.java (at line 2)\n" + > " public Object<T> var;\n" + >+ " ^^^^^^\n" + >+ "The type Object is not generic; it cannot be parameterized with arguments <T>\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 2)\n" + >+ " public Object<T> var;\n" + > " ^\n" + > "T cannot be resolved to a type\n" + > "----------\n"); >@@ -3989,10 +3994,15 @@ > "----------\n" + > "1. ERROR in X.java (at line 2)\n" + > " <T extends X<W>.Z> foo() {}\n" + >+ " ^\n" + >+ "The type X is not generic; it cannot be parameterized with arguments <W>\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 2)\n" + >+ " <T extends X<W>.Z> foo() {}\n" + > " ^\n" + > "W cannot be resolved to a type\n" + > "----------\n" + >- "2. ERROR in X.java (at line 2)\n" + >+ "3. ERROR in X.java (at line 2)\n" + > " <T extends X<W>.Z> foo() {}\n" + > " ^^^^^\n" + > "Return type for the method is missing\n" + >@@ -17020,7 +17030,12 @@ > "}\n", > }, > "----------\n" + >- "1. ERROR in X.java (at line 5)\n" + >+ "1. WARNING in X.java (at line 2)\n" + >+ " <T, U extends T, V extends T> T cond1(boolean z, U x1, V x2) {\n" + >+ " ^\n" + >+ "The parameter z is hiding a field from type X\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 5)\n" + > " Zork z;\n" + > " ^^^^\n" + > "Zork cannot be resolved to a type\n" + >@@ -18783,22 +18798,22 @@ > " private Bucket[] buckets = new X.Bucket[100];\n" + > "}\n", > }, >- "----------\n" + >- "1. ERROR in X.java (at line 6)\n" + >- " private static class Bucket extends LinkedList<MPair<K,V>> {}\n" + >- " ^\n" + >- "Cannot make a static reference to the non-static type K\n" + >- "----------\n" + >- "2. ERROR in X.java (at line 6)\n" + >- " 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" + >+ "1. ERROR in X.java (at line 6)\n" + >+ " private static class Bucket extends LinkedList<MPair<K,V>> {}\n" + >+ " ^\n" + >+ "Cannot make a static reference to the non-static type K\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 6)\n" + >+ " 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"); > } > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=84973 > public void test0613() { >@@ -26723,7 +26738,12 @@ > " ^^^^^^^\n" + > "Generic cannot be resolved to a type\n" + > "----------\n" + >- "3. ERROR in X.java (at line 10)\n" + >+ "3. ERROR in X.java (at line 8)\n" + >+ " aGeneric.size();\n" + >+ " ^^^^^^^^\n" + >+ "Generic cannot be resolved to a type\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 10)\n" + > " Zork z;\n" + > " ^^^^\n" + > "Zork cannot be resolved to a type\n" + >@@ -31261,7 +31281,12 @@ > "}", // ================= > }, > "----------\n" + >- "1. ERROR in X.java (at line 3)\n" + >+ "1. WARNING in X.java (at line 3)\n" + >+ " public class X extends ArrayList<Bean> {\n" + >+ " ^\n" + >+ "The serializable class X does not declare a static final serialVersionUID field of type long\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 3)\n" + > " public class X extends ArrayList<Bean> {\n" + > " ^^^^\n" + > "Bean cannot be resolved to a type\n" + >@@ -39683,7 +39708,7 @@ > "3. ERROR in X.java (at line 4)\n" + > " Runnable r = x.get();\n" + > " ^^^^^^^\n" + >- "Type mismatch: cannot convert from Object to Runnable\n" + >+ "Type mismatch: cannot convert from Zork to Runnable\n" + > "----------\n"); > } > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=203587 >@@ -40231,6 +40256,11 @@ > " X.<Zork>foo();\n" + > " ^^^^\n" + > "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 5)\n" + >+ " X.<Zork>foo();\n" + >+ " ^^^\n" + >+ "The method foo() of type X is not generic; it cannot be parameterized with arguments <Zork>\n" + > "----------\n" > : "----------\n" + > "1. WARNING in X.java (at line 4)\n" + >@@ -40242,6 +40272,11 @@ > " X.<Zork>foo();\n" + > " ^^^^\n" + > "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "3. WARNING in X.java (at line 5)\n" + >+ " X.<Zork>foo();\n" + >+ " ^^^^\n" + >+ "Unused type arguments for the non generic method foo() of type X; it should not be parameterized with arguments <Zork>\n" + > "----------\n"; > > this.runNegativeTest( >@@ -40730,7 +40765,7 @@ > "----------\n" + > "4. ERROR in X.java (at line 8)\n" + > " int pval = myA.box.t.pval;// intermediate access through P already flagged as error\n" + >- " ^^^^^^^^^^^^^^\n" + >+ " ^^^^^^^^^\n" + > "The type A.P is not visible\n" + > "----------\n" + > "----------\n" + >@@ -40795,7 +40830,7 @@ > "----------\n" + > "4. ERROR in X.java (at line 8)\n" + > " int pval = myA.box.t.pval;// intermediate access through P already flagged as error\n" + >- " ^^^^^^^^^^^^^^\n" + >+ " ^^^^^^^^^\n" + > "The type A.P is not visible\n" + > "----------\n"); > } >@@ -40854,7 +40889,7 @@ > "----------\n" + > "4. ERROR in X.java (at line 8)\n" + > " int pval = myA.box.t.pval;// intermediate access through P already flagged as error\n" + >- " ^^^^^^^^^^^^^^\n" + >+ " ^^^^^^^^^\n" + > "The type A.P is not visible\n" + > "----------\n"); > } >@@ -40977,4 +41012,23 @@ > "Cannot cast from Set<String> to String\n" + > "----------\n"); > } >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=207959 >+public void test1222() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", >+ "public class X<T extends Zork & Runnable> {\n" + >+ " T get() { return null; }\n" + >+ " void foo2(X<T> x2) {\n" + >+ " Runnable r = x2.get();\n" + >+ " } \n" + >+ "}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 1)\n" + >+ " public class X<T extends Zork & Runnable> {\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n"); >+} > } >Index: src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_3.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_3.java,v >retrieving revision 1.29 >diff -u -r1.29 JavadocTest_1_3.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_3.java 4 Oct 2007 13:02:14 -0000 1.29 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_3.java 4 Dec 2007 16:31:18 -0000 >@@ -1450,25 +1450,20 @@ > "----------\n" + > "3. ERROR in X.java (at line 5)\n" + > " public class X extends G<Exception> {\n" + >- " ^\n" + >- "The type G is not generic; it cannot be parameterized with arguments <Exception>\n" + >- "----------\n" + >- "4. ERROR in X.java (at line 5)\n" + >- " public class X extends G<Exception> {\n" + > " ^^^^^^^^^\n" + > "Syntax error, parameterized types are only available if source level is 5.0\n" + > "----------\n" + >- "5. ERROR in X.java (at line 6)\n" + >+ "4. ERROR in X.java (at line 6)\n" + > " X(Exception exc) { super(exc);}\n" + > " ^^^^^^^^^^^\n" + >- "The constructor Object(Exception) is undefined\n" + >+ "The constructor G(Exception) is undefined\n" + > "----------\n" + >- "6. ERROR in X.java (at line 8)\n" + >+ "5. ERROR in X.java (at line 8)\n" + > " class G<E extends Exception> {\n" + > " ^^^^^^^^^^^^^^^^^^^\n" + > "Syntax error, type parameters are only available if source level is 5.0\n" + > "----------\n" + >- "7. ERROR in X.java (at line 9)\n" + >+ "6. ERROR in X.java (at line 9)\n" + > " G(E e) {}\n" + > " ^\n" + > "E cannot be resolved to a type\n" + >@@ -1523,15 +1518,10 @@ > " ^^^^^^^^^^^^^^^^^^^^\n" + > "Syntax error, type parameters are only available if source level is 5.0\n" + > "----------\n" + >- "5. ERROR in X.java (at line 13)\n" + >- " /** Tests the method{@link ComparableUtils#compareTo(Object, Object, Class)} and\n" + >- " ^^^^^^^^^\n" + >- "Javadoc: The method compareTo(X, X) in the type ComparableUtils is not applicable for the arguments (Object, Object, Class)\n" + >- "----------\n" + >- "6. ERROR in X.java (at line 14)\n" + >+ "5. ERROR in X.java (at line 14)\n" + > " * {@link ComparableUtils#compareTo(Object, Object)}.\n" + > " ^^^^^^^^^\n" + >- "Javadoc: The method compareTo(X, X) in the type ComparableUtils is not applicable for the arguments (Object, Object)\n" + >+ "Javadoc: The method compareTo(Object, Object, Class) in the type ComparableUtils is not applicable for the arguments (Object, Object)\n" + > "----------\n"); > } > >@@ -1626,17 +1616,21 @@ > " ^\n" + > "E cannot be resolved to a type\n" + > "----------\n" + >- "12. ERROR in Test.java (at line 19)\n" + >- " Sub (E e) {super(null);}\n" + >- " ^^^^^^^^^^^^\n" + >- "The constructor Object(null) is undefined\n" + >- "----------\n" + >- "13. ERROR in Test.java (at line 20)\n" + >+ "12. ERROR in Test.java (at line 20)\n" + > " public boolean add(E e) {\n" + > " ^\n" + > "E cannot be resolved to a type\n" + >- "----------\n" >- ); >+ "----------\n" + >+ "13. ERROR in Test.java (at line 21)\n" + >+ " if (e.doubleValue() > 0)\n" + >+ " ^\n" + >+ "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "14. ERROR in Test.java (at line 23)\n" + >+ " return super.add(e);\n" + >+ " ^^^\n" + >+ "The method add(T) in the type Test is not applicable for the arguments (E)\n" + >+ "----------\n"); > } > public void testBug83127b() { > reportMissingJavadocTags = CompilerOptions.IGNORE; >@@ -1715,15 +1709,20 @@ > " ^\n" + > "E cannot be resolved to a type\n" + > "----------\n" + >- "10. ERROR in Test.java (at line 19)\n" + >- " Sub (E e) {super(null);}\n" + >- " ^^^^^^^^^^^^\n" + >- "The constructor Object(null) is undefined\n" + >- "----------\n" + >- "11. ERROR in Test.java (at line 20)\n" + >+ "10. ERROR in Test.java (at line 20)\n" + > " public boolean add(E e) {\n" + > " ^\n" + > "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "11. ERROR in Test.java (at line 21)\n" + >+ " if (e.doubleValue() > 0)\n" + >+ " ^\n" + >+ "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "12. ERROR in Test.java (at line 23)\n" + >+ " return super.add(e);\n" + >+ " ^^^\n" + >+ "The method add(T) in the type Test is not applicable for the arguments (E)\n" + > "----------\n" > ); > } >@@ -1801,15 +1800,20 @@ > " ^\n" + > "E cannot be resolved to a type\n" + > "----------\n" + >- "10. ERROR in Test.java (at line 16)\n" + >- " Sub (E e) {super(null);}\n" + >- " ^^^^^^^^^^^^\n" + >- "The constructor Object(null) is undefined\n" + >- "----------\n" + >- "11. ERROR in Test.java (at line 17)\n" + >+ "10. ERROR in Test.java (at line 17)\n" + > " public boolean add(E e) {\n" + > " ^\n" + > "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "11. ERROR in Test.java (at line 18)\n" + >+ " if (e.doubleValue() > 0)\n" + >+ " ^\n" + >+ "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "12. ERROR in Test.java (at line 20)\n" + >+ " return super.add(e);\n" + >+ " ^^^\n" + >+ "The method add(T) in the type Test is not applicable for the arguments (E)\n" + > "----------\n" > ); > } >@@ -1908,15 +1912,20 @@ > " ^\n" + > "E cannot be resolved to a type\n" + > "----------\n" + >- "10. ERROR in Test.java (at line 16)\n" + >- " Sub (E e) {super(null);}\n" + >- " ^^^^^^^^^^^^\n" + >- "The constructor Object(null) is undefined\n" + >- "----------\n" + >- "11. ERROR in Test.java (at line 17)\n" + >+ "10. ERROR in Test.java (at line 17)\n" + > " public boolean add(E e) {\n" + > " ^\n" + > "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "11. ERROR in Test.java (at line 18)\n" + >+ " if (e.doubleValue() > 0)\n" + >+ " ^\n" + >+ "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "12. ERROR in Test.java (at line 20)\n" + >+ " return super.add(e);\n" + >+ " ^^^\n" + >+ "The method add(T) in the type Test is not applicable for the arguments (E)\n" + > "----------\n" > ); > } >@@ -1973,7 +1982,7 @@ > "1. ERROR in Test.java (at line 2)\n" + > " * @see Unrelated1#add(Object)\n" + > " ^^^\n" + >- "Javadoc: The method add(Object) is undefined for the type Unrelated1\n" + >+ "Javadoc: The method add(E) in the type Unrelated1 is not applicable for the arguments (Object)\n" + > "----------\n" + > "2. ERROR in Test.java (at line 3)\n" + > " * @see Unrelated1#Unrelated1(Object)\n" + >@@ -2015,15 +2024,20 @@ > " ^\n" + > "E cannot be resolved to a type\n" + > "----------\n" + >- "10. ERROR in Test.java (at line 16)\n" + >- " Sub (E e) {super(null);}\n" + >- " ^^^^^^^^^^^^\n" + >- "The constructor Object(null) is undefined\n" + >- "----------\n" + >- "11. ERROR in Test.java (at line 17)\n" + >+ "10. ERROR in Test.java (at line 17)\n" + > " public boolean add(E e) {\n" + > " ^\n" + > "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "11. ERROR in Test.java (at line 18)\n" + >+ " if (e.doubleValue() > 0)\n" + >+ " ^\n" + >+ "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "12. ERROR in Test.java (at line 20)\n" + >+ " return super.add(e);\n" + >+ " ^^^\n" + >+ "The method add(T) in the type Test is not applicable for the arguments (E)\n" + > "----------\n" > ); > } >@@ -2060,76 +2074,81 @@ > "}\n" > }, > "----------\n" + >- "1. ERROR in Unrelated1.java (at line 1)\r\n" + >- " public class Unrelated1<E extends Number> {\r\n" + >+ "1. ERROR in Unrelated1.java (at line 1)\n" + >+ " public class Unrelated1<E extends Number> {\n" + > " ^^^^^^^^^^^^^^^^\n" + > "Syntax error, type parameters are only available if source level is 5.0\n" + > "----------\n" + >- "2. ERROR in Unrelated1.java (at line 2)\r\n" + >- " public Unrelated1(E e) {}\r\n" + >+ "2. ERROR in Unrelated1.java (at line 2)\n" + >+ " public Unrelated1(E e) {}\n" + > " ^\n" + > "E cannot be resolved to a type\n" + > "----------\n" + >- "3. ERROR in Unrelated1.java (at line 3)\r\n" + >- " public boolean add(E e) { return false; }\r\n" + >+ "3. ERROR in Unrelated1.java (at line 3)\n" + >+ " public boolean add(E e) { return false; }\n" + > " ^\n" + > "E cannot be resolved to a type\n" + > "----------\n" + > "----------\n" + >- "1. ERROR in Test.java (at line 2)\r\n" + >- " * @see Unrelated1#add(Number)\r\n" + >+ "1. ERROR in Test.java (at line 2)\n" + >+ " * @see Unrelated1#add(Number)\n" + > " ^^^\n" + >- "Javadoc: The method add(Number) is undefined for the type Unrelated1\n" + >+ "Javadoc: The method add(E) in the type Unrelated1 is not applicable for the arguments (Number)\n" + > "----------\n" + >- "2. ERROR in Test.java (at line 3)\r\n" + >- " * @see Unrelated1#Unrelated1(Number)\r\n" + >+ "2. ERROR in Test.java (at line 3)\n" + >+ " * @see Unrelated1#Unrelated1(Number)\n" + > " ^^^^^^^^^^^^^^^^^^\n" + > "Javadoc: The constructor Unrelated1(Number) is undefined\n" + > "----------\n" + >- "3. ERROR in Test.java (at line 8)\r\n" + >- " public class Test<T>{\r\n" + >+ "3. ERROR in Test.java (at line 8)\n" + >+ " public class Test<T>{\n" + > " ^\n" + > "Syntax error, type parameters are only available if source level is 5.0\n" + > "----------\n" + >- "4. ERROR in Test.java (at line 9)\r\n" + >- " Test(T t) {}\r\n" + >+ "4. ERROR in Test.java (at line 9)\n" + >+ " Test(T t) {}\n" + > " ^\n" + > "T cannot be resolved to a type\n" + > "----------\n" + >- "5. ERROR in Test.java (at line 10)\r\n" + >- " public boolean add(T t) {\r\n" + >+ "5. ERROR in Test.java (at line 10)\n" + >+ " public boolean add(T t) {\n" + > " ^\n" + > "T cannot be resolved to a type\n" + > "----------\n" + >- "6. ERROR in Test.java (at line 14)\r\n" + >- " class Sub<E extends Number> extends Test<E> {\r\n" + >+ "6. ERROR in Test.java (at line 14)\n" + >+ " class Sub<E extends Number> extends Test<E> {\n" + > " ^^^^^^^^^^^^^^^^\n" + > "Syntax error, type parameters are only available if source level is 5.0\n" + > "----------\n" + >- "7. ERROR in Test.java (at line 14)\r\n" + >- " class Sub<E extends Number> extends Test<E> {\r\n" + >+ "7. ERROR in Test.java (at line 14)\n" + >+ " class Sub<E extends Number> extends Test<E> {\n" + > " ^\n" + > "Syntax error, parameterized types are only available if source level is 5.0\n" + > "----------\n" + >- "8. ERROR in Test.java (at line 14)\r\n" + >- " class Sub<E extends Number> extends Test<E> {\r\n" + >+ "8. ERROR in Test.java (at line 14)\n" + >+ " class Sub<E extends Number> extends Test<E> {\n" + > " ^\n" + > "E cannot be resolved to a type\n" + > "----------\n" + >- "9. ERROR in Test.java (at line 15)\r\n" + >- " Sub (E e) {super(null);}\r\n" + >+ "9. ERROR in Test.java (at line 15)\n" + >+ " Sub (E e) {super(null);}\n" + > " ^\n" + > "E cannot be resolved to a type\n" + > "----------\n" + >- "10. ERROR in Test.java (at line 15)\r\n" + >- " Sub (E e) {super(null);}\r\n" + >- " ^^^^^^^^^^^^\n" + >- "The constructor Object(null) is undefined\n" + >- "----------\n" + >- "11. ERROR in Test.java (at line 16)\r\n" + >- " public boolean add(E e) {\r\n" + >+ "10. ERROR in Test.java (at line 16)\n" + >+ " public boolean add(E e) {\n" + > " ^\n" + > "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "11. ERROR in Test.java (at line 17)\n" + >+ " if (e.doubleValue() > 0)\n" + >+ " ^\n" + >+ "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "12. ERROR in Test.java (at line 19)\n" + >+ " return super.add(e);\n" + >+ " ^^^\n" + >+ "The method add(T) in the type Test is not applicable for the arguments (E)\n" + > "----------\n" > ); > } >@@ -2187,7 +2206,7 @@ > "1. ERROR in Test.java (at line 2)\n" + > " * @see Unrelated1#add(Integer)\n" + > " ^^^\n" + >- "Javadoc: The method add(Integer) is undefined for the type Unrelated1\n" + >+ "Javadoc: The method add(E) in the type Unrelated1 is not applicable for the arguments (Integer)\n" + > "----------\n" + > "2. ERROR in Test.java (at line 3)\n" + > " * @see Unrelated1#Unrelated1(Integer)\n" + >@@ -2229,15 +2248,20 @@ > " ^\n" + > "E cannot be resolved to a type\n" + > "----------\n" + >- "10. ERROR in Test.java (at line 17)\n" + >- " Sub (E e) {super(null);}\n" + >- " ^^^^^^^^^^^^\n" + >- "The constructor Object(null) is undefined\n" + >- "----------\n" + >- "11. ERROR in Test.java (at line 18)\n" + >+ "10. ERROR in Test.java (at line 18)\n" + > " public boolean add(E e) {\n" + > " ^\n" + > "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "11. ERROR in Test.java (at line 19)\n" + >+ " if (e.doubleValue() > 0)\n" + >+ " ^\n" + >+ "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "12. ERROR in Test.java (at line 21)\n" + >+ " return super.add(e);\n" + >+ " ^^^\n" + >+ "The method add(T) in the type Test is not applicable for the arguments (E)\n" + > "----------\n" > ); > } >@@ -2327,15 +2351,20 @@ > " ^\n" + > "E cannot be resolved to a type\n" + > "----------\n" + >- "9. ERROR in Test.java (at line 18)\n" + >- " Sub (E e) {super(null);}\n" + >- " ^^^^^^^^^^^^\n" + >- "The constructor Object(null) is undefined\n" + >- "----------\n" + >- "10. ERROR in Test.java (at line 19)\n" + >+ "9. ERROR in Test.java (at line 19)\n" + > " public boolean add(E e) {\n" + > " ^\n" + > "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "10. ERROR in Test.java (at line 20)\n" + >+ " if (e.doubleValue() > 0)\n" + >+ " ^\n" + >+ "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "11. ERROR in Test.java (at line 22)\n" + >+ " return super.add(e);\n" + >+ " ^^^\n" + >+ "The method add(T) in the type Test is not applicable for the arguments (E)\n" + > "----------\n"); > } > >@@ -3707,32 +3736,21 @@ > "}\n" > }, > "----------\n" + >- "1. ERROR in Test.java (at line 3)\n" + >- " * @see Test#field\n" + >- " ^^^^^\n" + >- "Javadoc: field cannot be resolved or is not a field\n" + >- "----------\n" + >- "2. ERROR in Test.java (at line 4)\n" + >- " * @see Test#foo()\n" + >- " ^^^\n" + >- "Javadoc: The method foo() is undefined for the type Test\n" + >- "----------\n" + >- "3. ERROR in Test.java (at line 6)\n" + >+ "1. ERROR in Test.java (at line 6)\n" + > " public class Test<T> {\n" + > " ^\n" + > "Syntax error, type parameters are only available if source level is 5.0\n" + > "----------\n" + >- "4. ERROR in Test.java (at line 7)\n" + >+ "2. ERROR in Test.java (at line 7)\n" + > " T field;\n" + > " ^\n" + > "T cannot be resolved to a type\n" + > "----------\n" + >- "5. ERROR in Test.java (at line 8)\n" + >+ "3. ERROR in Test.java (at line 8)\n" + > " T foo() { return null; }\n" + > " ^\n" + > "T cannot be resolved to a type\n" + >- "----------\n" >- ); >+ "----------\n"); > } > > /** >Index: src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java,v >retrieving revision 1.140 >diff -u -r1.140 MethodVerifyTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java 8 Nov 2007 16:28:43 -0000 1.140 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java 4 Dec 2007 16:31:21 -0000 >@@ -7098,8 +7098,28 @@ > "----------\n" + > "2. ERROR in X.java (at line 6)\n" + > " Object foo() {\n" + >+ " ^^^^^^\n" + >+ "The return type is incompatible with Y.foo()\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 6)\n" + >+ " Object foo() {\n" + >+ " ^^^^^\n" + >+ "The method X.foo() is overriding a method without making a super invocation\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 8)\n" + >+ " Object foo() {\n" + >+ " ^^^^^^\n" + >+ "The return type is incompatible with Y.foo()\n" + >+ "----------\n" + >+ "5. WARNING in X.java (at line 8)\n" + >+ " Object foo() {\n" + > " ^^^^^\n" + >- mustOverrideMessage("foo()", "X") + >+ "The method foo() of type new Y(){} should be tagged with @Override since it actually overrides a superclass method\n" + >+ "----------\n" + >+ "6. ERROR in X.java (at line 8)\n" + >+ " Object foo() {\n" + >+ " ^^^^^\n" + >+ "The method new Y(){}.foo() is overriding a method without making a super invocation\n" + > "----------\n", > null, > true, >Index: src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_4.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_4.java,v >retrieving revision 1.32 >diff -u -r1.32 JavadocTest_1_4.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_4.java 4 Oct 2007 13:02:14 -0000 1.32 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_4.java 4 Dec 2007 16:31:19 -0000 >@@ -1451,30 +1451,24 @@ > "----------\n" + > "3. ERROR in X.java (at line 5)\n" + > " public class X extends G<Exception> {\n" + >- " ^\n" + >- "The type G is not generic; it cannot be parameterized with arguments <Exception>\n" + >- "----------\n" + >- "4. ERROR in X.java (at line 5)\n" + >- " public class X extends G<Exception> {\n" + > " ^^^^^^^^^\n" + > "Syntax error, parameterized types are only available if source level is 5.0\n" + > "----------\n" + >- "5. ERROR in X.java (at line 6)\n" + >+ "4. ERROR in X.java (at line 6)\n" + > " X(Exception exc) { super(exc);}\n" + > " ^^^^^^^^^^^\n" + >- "The constructor Object(Exception) is undefined\n" + >+ "The constructor G(Exception) is undefined\n" + > "----------\n" + >- "6. ERROR in X.java (at line 8)\n" + >+ "5. ERROR in X.java (at line 8)\n" + > " class G<E extends Exception> {\n" + > " ^^^^^^^^^^^^^^^^^^^\n" + > "Syntax error, type parameters are only available if source level is 5.0\n" + > "----------\n" + >- "7. ERROR in X.java (at line 9)\n" + >+ "6. ERROR in X.java (at line 9)\n" + > " G(E e) {}\n" + > " ^\n" + > "E cannot be resolved to a type\n" + >- "----------\n" >- ); >+ "----------\n"); > } > > /** >@@ -1524,17 +1518,11 @@ > " ^^^^^^^^^^^^^^^^^^^^\n" + > "Syntax error, type parameters are only available if source level is 5.0\n" + > "----------\n" + >- "5. ERROR in X.java (at line 13)\n" + >- " /** Tests the method{@link ComparableUtils#compareTo(Object, Object, Class)} and\n" + >- " ^^^^^^^^^\n" + >- "Javadoc: The method compareTo(X, X) in the type ComparableUtils is not applicable for the arguments (Object, Object, Class)\n" + >- "----------\n" + >- "6. ERROR in X.java (at line 14)\n" + >+ "5. ERROR in X.java (at line 14)\n" + > " * {@link ComparableUtils#compareTo(Object, Object)}.\n" + > " ^^^^^^^^^\n" + >- "Javadoc: The method compareTo(X, X) in the type ComparableUtils is not applicable for the arguments (Object, Object)\n" + >- "----------\n" >- ); >+ "Javadoc: The method compareTo(Object, Object, Class) in the type ComparableUtils is not applicable for the arguments (Object, Object)\n" + >+ "----------\n"); > } > > /** >@@ -1628,17 +1616,21 @@ > " ^\n" + > "E cannot be resolved to a type\n" + > "----------\n" + >- "12. ERROR in Test.java (at line 19)\n" + >- " Sub (E e) {super(null);}\n" + >- " ^^^^^^^^^^^^\n" + >- "The constructor Object(null) is undefined\n" + >- "----------\n" + >- "13. ERROR in Test.java (at line 20)\n" + >+ "12. ERROR in Test.java (at line 20)\n" + > " public boolean add(E e) {\n" + > " ^\n" + > "E cannot be resolved to a type\n" + >- "----------\n" >- ); >+ "----------\n" + >+ "13. ERROR in Test.java (at line 21)\n" + >+ " if (e.doubleValue() > 0)\n" + >+ " ^\n" + >+ "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "14. ERROR in Test.java (at line 23)\n" + >+ " return super.add(e);\n" + >+ " ^^^\n" + >+ "The method add(T) in the type Test is not applicable for the arguments (E)\n" + >+ "----------\n"); > } > public void testBug83127b() { > reportMissingJavadocTags = CompilerOptions.IGNORE; >@@ -1717,15 +1709,20 @@ > " ^\n" + > "E cannot be resolved to a type\n" + > "----------\n" + >- "10. ERROR in Test.java (at line 19)\n" + >- " Sub (E e) {super(null);}\n" + >- " ^^^^^^^^^^^^\n" + >- "The constructor Object(null) is undefined\n" + >- "----------\n" + >- "11. ERROR in Test.java (at line 20)\n" + >+ "10. ERROR in Test.java (at line 20)\n" + > " public boolean add(E e) {\n" + > " ^\n" + > "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "11. ERROR in Test.java (at line 21)\n" + >+ " if (e.doubleValue() > 0)\n" + >+ " ^\n" + >+ "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "12. ERROR in Test.java (at line 23)\n" + >+ " return super.add(e);\n" + >+ " ^^^\n" + >+ "The method add(T) in the type Test is not applicable for the arguments (E)\n" + > "----------\n" > ); > } >@@ -1803,15 +1800,20 @@ > " ^\n" + > "E cannot be resolved to a type\n" + > "----------\n" + >- "10. ERROR in Test.java (at line 16)\n" + >- " Sub (E e) {super(null);}\n" + >- " ^^^^^^^^^^^^\n" + >- "The constructor Object(null) is undefined\n" + >- "----------\n" + >- "11. ERROR in Test.java (at line 17)\n" + >+ "10. ERROR in Test.java (at line 17)\n" + > " public boolean add(E e) {\n" + > " ^\n" + > "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "11. ERROR in Test.java (at line 18)\n" + >+ " if (e.doubleValue() > 0)\n" + >+ " ^\n" + >+ "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "12. ERROR in Test.java (at line 20)\n" + >+ " return super.add(e);\n" + >+ " ^^^\n" + >+ "The method add(T) in the type Test is not applicable for the arguments (E)\n" + > "----------\n" > ); > } >@@ -1910,15 +1912,20 @@ > " ^\n" + > "E cannot be resolved to a type\n" + > "----------\n" + >- "10. ERROR in Test.java (at line 16)\n" + >- " Sub (E e) {super(null);}\n" + >- " ^^^^^^^^^^^^\n" + >- "The constructor Object(null) is undefined\n" + >- "----------\n" + >- "11. ERROR in Test.java (at line 17)\n" + >+ "10. ERROR in Test.java (at line 17)\n" + > " public boolean add(E e) {\n" + > " ^\n" + > "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "11. ERROR in Test.java (at line 18)\n" + >+ " if (e.doubleValue() > 0)\n" + >+ " ^\n" + >+ "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "12. ERROR in Test.java (at line 20)\n" + >+ " return super.add(e);\n" + >+ " ^^^\n" + >+ "The method add(T) in the type Test is not applicable for the arguments (E)\n" + > "----------\n" > ); > } >@@ -1975,7 +1982,7 @@ > "1. ERROR in Test.java (at line 2)\n" + > " * @see Unrelated1#add(Object)\n" + > " ^^^\n" + >- "Javadoc: The method add(Object) is undefined for the type Unrelated1\n" + >+ "Javadoc: The method add(E) in the type Unrelated1 is not applicable for the arguments (Object)\n" + > "----------\n" + > "2. ERROR in Test.java (at line 3)\n" + > " * @see Unrelated1#Unrelated1(Object)\n" + >@@ -2017,15 +2024,20 @@ > " ^\n" + > "E cannot be resolved to a type\n" + > "----------\n" + >- "10. ERROR in Test.java (at line 16)\n" + >- " Sub (E e) {super(null);}\n" + >- " ^^^^^^^^^^^^\n" + >- "The constructor Object(null) is undefined\n" + >- "----------\n" + >- "11. ERROR in Test.java (at line 17)\n" + >+ "10. ERROR in Test.java (at line 17)\n" + > " public boolean add(E e) {\n" + > " ^\n" + > "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "11. ERROR in Test.java (at line 18)\n" + >+ " if (e.doubleValue() > 0)\n" + >+ " ^\n" + >+ "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "12. ERROR in Test.java (at line 20)\n" + >+ " return super.add(e);\n" + >+ " ^^^\n" + >+ "The method add(T) in the type Test is not applicable for the arguments (E)\n" + > "----------\n" > ); > } >@@ -2062,76 +2074,81 @@ > "}\n" > }, > "----------\n" + >- "1. ERROR in Unrelated1.java (at line 1)\r\n" + >- " public class Unrelated1<E extends Number> {\r\n" + >+ "1. ERROR in Unrelated1.java (at line 1)\n" + >+ " public class Unrelated1<E extends Number> {\n" + > " ^^^^^^^^^^^^^^^^\n" + > "Syntax error, type parameters are only available if source level is 5.0\n" + > "----------\n" + >- "2. ERROR in Unrelated1.java (at line 2)\r\n" + >- " public Unrelated1(E e) {}\r\n" + >+ "2. ERROR in Unrelated1.java (at line 2)\n" + >+ " public Unrelated1(E e) {}\n" + > " ^\n" + > "E cannot be resolved to a type\n" + > "----------\n" + >- "3. ERROR in Unrelated1.java (at line 3)\r\n" + >- " public boolean add(E e) { return false; }\r\n" + >+ "3. ERROR in Unrelated1.java (at line 3)\n" + >+ " public boolean add(E e) { return false; }\n" + > " ^\n" + > "E cannot be resolved to a type\n" + > "----------\n" + > "----------\n" + >- "1. ERROR in Test.java (at line 2)\r\n" + >- " * @see Unrelated1#add(Number)\r\n" + >+ "1. ERROR in Test.java (at line 2)\n" + >+ " * @see Unrelated1#add(Number)\n" + > " ^^^\n" + >- "Javadoc: The method add(Number) is undefined for the type Unrelated1\n" + >+ "Javadoc: The method add(E) in the type Unrelated1 is not applicable for the arguments (Number)\n" + > "----------\n" + >- "2. ERROR in Test.java (at line 3)\r\n" + >- " * @see Unrelated1#Unrelated1(Number)\r\n" + >+ "2. ERROR in Test.java (at line 3)\n" + >+ " * @see Unrelated1#Unrelated1(Number)\n" + > " ^^^^^^^^^^^^^^^^^^\n" + > "Javadoc: The constructor Unrelated1(Number) is undefined\n" + > "----------\n" + >- "3. ERROR in Test.java (at line 8)\r\n" + >- " public class Test<T>{\r\n" + >+ "3. ERROR in Test.java (at line 8)\n" + >+ " public class Test<T>{\n" + > " ^\n" + > "Syntax error, type parameters are only available if source level is 5.0\n" + > "----------\n" + >- "4. ERROR in Test.java (at line 9)\r\n" + >- " Test(T t) {}\r\n" + >+ "4. ERROR in Test.java (at line 9)\n" + >+ " Test(T t) {}\n" + > " ^\n" + > "T cannot be resolved to a type\n" + > "----------\n" + >- "5. ERROR in Test.java (at line 10)\r\n" + >- " public boolean add(T t) {\r\n" + >+ "5. ERROR in Test.java (at line 10)\n" + >+ " public boolean add(T t) {\n" + > " ^\n" + > "T cannot be resolved to a type\n" + > "----------\n" + >- "6. ERROR in Test.java (at line 14)\r\n" + >- " class Sub<E extends Number> extends Test<E> {\r\n" + >+ "6. ERROR in Test.java (at line 14)\n" + >+ " class Sub<E extends Number> extends Test<E> {\n" + > " ^^^^^^^^^^^^^^^^\n" + > "Syntax error, type parameters are only available if source level is 5.0\n" + > "----------\n" + >- "7. ERROR in Test.java (at line 14)\r\n" + >- " class Sub<E extends Number> extends Test<E> {\r\n" + >+ "7. ERROR in Test.java (at line 14)\n" + >+ " class Sub<E extends Number> extends Test<E> {\n" + > " ^\n" + > "Syntax error, parameterized types are only available if source level is 5.0\n" + > "----------\n" + >- "8. ERROR in Test.java (at line 14)\r\n" + >- " class Sub<E extends Number> extends Test<E> {\r\n" + >+ "8. ERROR in Test.java (at line 14)\n" + >+ " class Sub<E extends Number> extends Test<E> {\n" + > " ^\n" + > "E cannot be resolved to a type\n" + > "----------\n" + >- "9. ERROR in Test.java (at line 15)\r\n" + >- " Sub (E e) {super(null);}\r\n" + >+ "9. ERROR in Test.java (at line 15)\n" + >+ " Sub (E e) {super(null);}\n" + > " ^\n" + > "E cannot be resolved to a type\n" + > "----------\n" + >- "10. ERROR in Test.java (at line 15)\r\n" + >- " Sub (E e) {super(null);}\r\n" + >- " ^^^^^^^^^^^^\n" + >- "The constructor Object(null) is undefined\n" + >- "----------\n" + >- "11. ERROR in Test.java (at line 16)\r\n" + >- " public boolean add(E e) {\r\n" + >+ "10. ERROR in Test.java (at line 16)\n" + >+ " public boolean add(E e) {\n" + > " ^\n" + > "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "11. ERROR in Test.java (at line 17)\n" + >+ " if (e.doubleValue() > 0)\n" + >+ " ^\n" + >+ "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "12. ERROR in Test.java (at line 19)\n" + >+ " return super.add(e);\n" + >+ " ^^^\n" + >+ "The method add(T) in the type Test is not applicable for the arguments (E)\n" + > "----------\n" > ); > } >@@ -2189,7 +2206,7 @@ > "1. ERROR in Test.java (at line 2)\n" + > " * @see Unrelated1#add(Integer)\n" + > " ^^^\n" + >- "Javadoc: The method add(Integer) is undefined for the type Unrelated1\n" + >+ "Javadoc: The method add(E) in the type Unrelated1 is not applicable for the arguments (Integer)\n" + > "----------\n" + > "2. ERROR in Test.java (at line 3)\n" + > " * @see Unrelated1#Unrelated1(Integer)\n" + >@@ -2231,15 +2248,20 @@ > " ^\n" + > "E cannot be resolved to a type\n" + > "----------\n" + >- "10. ERROR in Test.java (at line 17)\n" + >- " Sub (E e) {super(null);}\n" + >- " ^^^^^^^^^^^^\n" + >- "The constructor Object(null) is undefined\n" + >- "----------\n" + >- "11. ERROR in Test.java (at line 18)\n" + >+ "10. ERROR in Test.java (at line 18)\n" + > " public boolean add(E e) {\n" + > " ^\n" + > "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "11. ERROR in Test.java (at line 19)\n" + >+ " if (e.doubleValue() > 0)\n" + >+ " ^\n" + >+ "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "12. ERROR in Test.java (at line 21)\n" + >+ " return super.add(e);\n" + >+ " ^^^\n" + >+ "The method add(T) in the type Test is not applicable for the arguments (E)\n" + > "----------\n" > ); > } >@@ -2329,15 +2351,20 @@ > " ^\n" + > "E cannot be resolved to a type\n" + > "----------\n" + >- "9. ERROR in Test.java (at line 18)\n" + >- " Sub (E e) {super(null);}\n" + >- " ^^^^^^^^^^^^\n" + >- "The constructor Object(null) is undefined\n" + >- "----------\n" + >- "10. ERROR in Test.java (at line 19)\n" + >+ "9. ERROR in Test.java (at line 19)\n" + > " public boolean add(E e) {\n" + > " ^\n" + > "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "10. ERROR in Test.java (at line 20)\n" + >+ " if (e.doubleValue() > 0)\n" + >+ " ^\n" + >+ "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "11. ERROR in Test.java (at line 22)\n" + >+ " return super.add(e);\n" + >+ " ^^^\n" + >+ "The method add(T) in the type Test is not applicable for the arguments (E)\n" + > "----------\n" > ); > } >@@ -3701,27 +3728,17 @@ > "}\n" > }, > "----------\n" + >- "1. ERROR in Test.java (at line 3)\n" + >- " * @see Test#field\n" + >- " ^^^^^\n" + >- "Javadoc: field cannot be resolved or is not a field\n" + >- "----------\n" + >- "2. ERROR in Test.java (at line 4)\n" + >- " * @see Test#foo()\n" + >- " ^^^\n" + >- "Javadoc: The method foo() is undefined for the type Test\n" + >- "----------\n" + >- "3. ERROR in Test.java (at line 6)\n" + >+ "1. ERROR in Test.java (at line 6)\n" + > " public class Test<T> {\n" + > " ^\n" + > "Syntax error, type parameters are only available if source level is 5.0\n" + > "----------\n" + >- "4. ERROR in Test.java (at line 7)\n" + >+ "2. ERROR in Test.java (at line 7)\n" + > " T field;\n" + > " ^\n" + > "T cannot be resolved to a type\n" + > "----------\n" + >- "5. ERROR in Test.java (at line 8)\n" + >+ "3. ERROR in Test.java (at line 8)\n" + > " T foo() { return null; }\n" + > " ^\n" + > "T cannot be resolved to a type\n" + >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.94 >diff -u -r1.94 Compliance_1_3.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_3.java 2 Nov 2007 12:22:52 -0000 1.94 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_3.java 4 Dec 2007 16:31:01 -0000 >@@ -1278,10 +1278,20 @@ > " ^^^^^^^\n" + > "The type Homonym is defined in an inherited type and an enclosing scope\n" + > "----------\n" + >- "3. ERROR in X.java (at line 13)\n" + >+ "3. ERROR in X.java (at line 6)\n" + >+ " class Y extends Homonym {}; \n" + >+ " ^^^^^^^\n" + >+ "The type X.Homonym cannot be the superclass of Y; a superclass must be a class\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 13)\n" + > " class Y extends Homonym {}; \n" + > " ^^^^^^^\n" + > "The type Homonym is defined in an inherited type and an enclosing scope\n" + >+ "----------\n" + >+ "5. ERROR in X.java (at line 13)\n" + >+ " class Y extends Homonym {}; \n" + >+ " ^^^^^^^\n" + >+ "The type X.Homonym cannot be the superclass of Y; a superclass must be a class\n" + > "----------\n"); > } > /* >Index: src/org/eclipse/jdt/core/tests/compiler/regression/ProblemTypeAndMethodTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ProblemTypeAndMethodTest.java,v >retrieving revision 1.1 >diff -u -r1.1 ProblemTypeAndMethodTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/ProblemTypeAndMethodTest.java 6 Sep 2006 02:03:27 -0000 1.1 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/ProblemTypeAndMethodTest.java 4 Dec 2007 16:31:21 -0000 >@@ -12,6 +12,7 @@ > > import java.io.File; > >+import org.eclipse.jdt.core.tests.util.Util; > import org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader; > import org.eclipse.jdt.internal.compiler.env.IBinaryMethod; > >@@ -114,4 +115,289 @@ > } > assertEquals("Wrong number of foo method", 1, counter); > } >+ >+public void test002() { >+ this.runNegativeTest(new String[] { >+ "X.java", >+ "public class X extends Zork {\n" + >+ " void foo() {\n" + >+ " Zork z = this;\n" + >+ " String s = this;\n" + >+ " Zork2 z2 = this;\n" + >+ " }\n" + >+ "}\n", >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 1)\n" + >+ " public class X extends Zork {\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 3)\n" + >+ " Zork z = this;\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 4)\n" + >+ " String s = this;\n" + >+ " ^^^^\n" + >+ "Type mismatch: cannot convert from X to String\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 5)\n" + >+ " Zork2 z2 = this;\n" + >+ " ^^^^^\n" + >+ "Zork2 cannot be resolved to a type\n" + >+ "----------\n" + >+ "5. ERROR in X.java (at line 5)\n" + >+ " Zork2 z2 = this;\n" + >+ " ^^^^\n" + >+ "Type mismatch: cannot convert from X to Zork2\n" + >+ "----------\n"); >+} >+ >+public void test003() { >+ this.runNegativeTest(new String[] { >+ "X.java", >+ "public class X {\n" + >+ " Zork field;\n" + >+ " \n" + >+ " void foo(Y y) {\n" + >+ " Object o = y.foo();\n" + >+ " Object s = y.slot;\n" + >+ " y.bar(null);\n" + >+ " Object s2 = new Y().slot;\n" + >+ " Object f = field;\n" + >+ " }\n" + >+ "}\n" + >+ "class Y {\n" + >+ " Zork foo() { return null; }\n" + >+ " void bar(Zork z) {}\n" + >+ " Zork slot;\n" + >+ "}\n", >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 2)\n" + >+ " Zork field;\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 13)\n" + >+ " Zork foo() { return null; }\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 14)\n" + >+ " void bar(Zork z) {}\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 15)\n" + >+ " Zork slot;\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n"); >+} >+ >+ >+public void test004() { >+ this.runConformTest( >+ new String[] { >+ "p/OtherFoo.java", //----------------------------------------------------------------------- >+ "package p;\n" + >+ "\n" + >+ "import q.Zork;\n" + >+ "\n" + >+ "public class OtherFoo extends Zork{\n" + >+ " public class OtherMember extends Zork {}\n" + >+ " public Zork foo;\n" + >+ " public Zork bar() { return null; }\n" + >+ " public void baz(Zork z) {}\n" + >+ "}\n", >+ "q/Zork.java", //----------------------------------------------------------------------- >+ "package q;\n" + >+ "public class Zork {\n" + >+ "}\n", >+ }, >+ ""); >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "import p.OtherFoo;\n" + >+ "import q.Zork;\n" + >+ "\n" + >+ "public class X {\n" + >+ " void foo() {\n" + >+ " OtherFoo ofoo;\n" + >+ " String s1 = ofoo.foo;\n" + >+ " String s2 = ofoo.bar();\n" + >+ " String s3 = ofoo.new OtherMember();\n" + >+ " ofoo.baz(this);\n" + >+ " }\n" + >+ " void bar() {\n" + >+ " OtherX ox;\n" + >+ " String s1 = ox.foo;\n" + >+ " String s2 = ox.bar();\n" + >+ " String s3 = ox.new OtherMember();\n" + >+ " ox.baz(this);\n" + >+ " }\n" + >+ "} \n" + >+ "\n" + >+ "class OtherX {\n" + >+ " public class OtherMember extends Zork {}\n" + >+ " public Zork foo;\n" + >+ " public Zork bar() { return null; }\n" + >+ " public void baz(Zork z) {}\n" + >+ "}\n", >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 7)\n" + >+ " String s1 = ofoo.foo;\n" + >+ " ^^^^^^^^\n" + >+ "Type mismatch: cannot convert from Zork to String\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 8)\n" + >+ " String s2 = ofoo.bar();\n" + >+ " ^^^^^^^^^^\n" + >+ "Type mismatch: cannot convert from Zork to String\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 9)\n" + >+ " String s3 = ofoo.new OtherMember();\n" + >+ " ^^^^^^^^^^^^^^^^^^^^^^\n" + >+ "Type mismatch: cannot convert from OtherFoo.OtherMember to String\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 10)\n" + >+ " ofoo.baz(this);\n" + >+ " ^^^\n" + >+ "The method baz(Zork) in the type OtherFoo is not applicable for the arguments (X)\n" + >+ "----------\n" + >+ "5. ERROR in X.java (at line 14)\n" + >+ " String s1 = ox.foo;\n" + >+ " ^^^^^^\n" + >+ "Type mismatch: cannot convert from Zork to String\n" + >+ "----------\n" + >+ "6. ERROR in X.java (at line 15)\n" + >+ " String s2 = ox.bar();\n" + >+ " ^^^^^^^^\n" + >+ "Type mismatch: cannot convert from Zork to String\n" + >+ "----------\n" + >+ "7. ERROR in X.java (at line 16)\n" + >+ " String s3 = ox.new OtherMember();\n" + >+ " ^^^^^^^^^^^^^^^^^^^^\n" + >+ "Type mismatch: cannot convert from OtherX.OtherMember to String\n" + >+ "----------\n" + >+ "8. ERROR in X.java (at line 17)\n" + >+ " ox.baz(this);\n" + >+ " ^^^\n" + >+ "The method baz(Zork) in the type OtherX is not applicable for the arguments (X)\n" + >+ "----------\n", >+ null, >+ false); >+ >+ // delete binary file Zork (i.e. simulate removing it from classpath for subsequent compile) >+ Util.delete(new File(OUTPUT_DIR, "q" + File.separator + "Zork.class")); >+ >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "import p.OtherFoo;\n" + >+ "import q.Zork;\n" + >+ "\n" + >+ "public class X {\n" + >+ " void foo() {\n" + >+ " OtherFoo ofoo;\n" + >+ " String s1 = ofoo.foo;\n" + >+ " String s2 = ofoo.bar();\n" + >+ " String s3 = ofoo.new OtherMember();\n" + >+ " ofoo.baz(this);\n" + >+ " }\n" + >+ " void bar() {\n" + >+ " OtherX ox;\n" + >+ " String s1 = ox.foo;\n" + >+ " String s2 = ox.bar();\n" + >+ " String s3 = ox.new OtherMember();\n" + >+ " ox.baz(this);\n" + >+ " }\n" + >+ "} \n" + >+ "\n" + >+ "class OtherX {\n" + >+ " public class OtherMember extends Zork {}\n" + >+ " public Zork foo;\n" + >+ " public Zork bar() { return null; }\n" + >+ " public void baz(Zork z) {}\n" + >+ "}\n", >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 1)\n" + >+ " import p.OtherFoo;\n" + >+ " ^\n" + >+ "The type q.Zork cannot be resolved. It is indirectly referenced from required .class files\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 2)\n" + >+ " import q.Zork;\n" + >+ " ^^^^^^\n" + >+ "The import q.Zork cannot be resolved\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 7)\n" + >+ " String s1 = ofoo.foo;\n" + >+ " ^^^^^^^^\n" + >+ "Type mismatch: cannot convert from Zork to String\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 8)\n" + >+ " String s2 = ofoo.bar();\n" + >+ " ^^^^^^^^^^\n" + >+ "Type mismatch: cannot convert from Zork to String\n" + >+ "----------\n" + >+ "5. ERROR in X.java (at line 9)\n" + >+ " String s3 = ofoo.new OtherMember();\n" + >+ " ^^^^^^^^^^^^^^^^^^^^^^\n" + >+ "Type mismatch: cannot convert from OtherFoo.OtherMember to String\n" + >+ "----------\n" + >+ "6. ERROR in X.java (at line 10)\n" + >+ " ofoo.baz(this);\n" + >+ " ^^^\n" + >+ "The method baz(Zork) in the type OtherFoo is not applicable for the arguments (X)\n" + >+ "----------\n" + >+ "7. ERROR in X.java (at line 14)\n" + >+ " String s1 = ox.foo;\n" + >+ " ^^^^^^\n" + >+ "Type mismatch: cannot convert from Zork to String\n" + >+ "----------\n" + >+ "8. ERROR in X.java (at line 15)\n" + >+ " String s2 = ox.bar();\n" + >+ " ^^^^^^^^\n" + >+ "Type mismatch: cannot convert from Zork to String\n" + >+ "----------\n" + >+ "9. ERROR in X.java (at line 16)\n" + >+ " String s3 = ox.new OtherMember();\n" + >+ " ^^^^^^^^^^^^^^^^^^^^\n" + >+ "Type mismatch: cannot convert from OtherX.OtherMember to String\n" + >+ "----------\n" + >+ "10. ERROR in X.java (at line 17)\n" + >+ " ox.baz(this);\n" + >+ " ^^^\n" + >+ "The method baz(Zork) in the type OtherX is not applicable for the arguments (X)\n" + >+ "----------\n" + >+ "11. ERROR in X.java (at line 22)\n" + >+ " public class OtherMember extends Zork {}\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "12. ERROR in X.java (at line 23)\n" + >+ " public Zork foo;\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "13. ERROR in X.java (at line 24)\n" + >+ " public Zork bar() { return null; }\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "14. ERROR in X.java (at line 25)\n" + >+ " public void baz(Zork z) {}\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n", >+ null, >+ false); >+} > } >Index: src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForMethod.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForMethod.java,v >retrieving revision 1.24 >diff -u -r1.24 JavadocTestForMethod.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForMethod.java 3 Oct 2006 15:19:13 -0000 1.24 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForMethod.java 4 Dec 2007 16:31:17 -0000 >@@ -946,22 +946,32 @@ > + " public void p_foo(inr a, inx b, inq c) {\n" > + " }\n" > + "}\n" }, >- "----------\n" >- + "1. ERROR in X.java (at line 8)\n" >- + " public void p_foo(inr a, inx b, inq c) {\n" >- + " ^^^\n" >- + "inr cannot be resolved to a type\n" >- + "----------\n" >- + "2. ERROR in X.java (at line 8)\n" >- + " public void p_foo(inr a, inx b, inq c) {\n" >- + " ^^^\n" >- + "inx cannot be resolved to a type\n" >- + "----------\n" >- + "3. ERROR in X.java (at line 8)\n" >- + " public void p_foo(inr a, inx b, inq c) {\n" >- + " ^^^\n" >- + "inq cannot be resolved to a type\n" >- + "----------\n"); >+ "----------\n" + >+ "1. ERROR in X.java (at line 5)\n" + >+ " * @param b Valid param\n" + >+ " ^\n" + >+ "Javadoc: Duplicate tag for parameter\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 8)\n" + >+ " public void p_foo(inr a, inx b, inq c) {\n" + >+ " ^^^\n" + >+ "inr cannot be resolved to a type\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 8)\n" + >+ " public void p_foo(inr a, inx b, inq c) {\n" + >+ " ^\n" + >+ "Javadoc: Missing tag for parameter a\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 8)\n" + >+ " public void p_foo(inr a, inx b, inq c) {\n" + >+ " ^^^\n" + >+ "inx cannot be resolved to a type\n" + >+ "----------\n" + >+ "5. ERROR in X.java (at line 8)\n" + >+ " public void p_foo(inr a, inx b, inq c) {\n" + >+ " ^^^\n" + >+ "inq cannot be resolved to a type\n" + >+ "----------\n"); > } > > public void test037() { >Index: src/org/eclipse/jdt/core/tests/compiler/regression/TryStatementTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TryStatementTest.java,v >retrieving revision 1.44 >diff -u -r1.44 TryStatementTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/TryStatementTest.java 16 Oct 2007 10:24:51 -0000 1.44 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/TryStatementTest.java 4 Dec 2007 16:31:23 -0000 >@@ -5772,15 +5772,25 @@ > "}\n" > }, > "----------\n" + >- "1. ERROR in X.java (at line 4)\r\n" + >- " Zork z = null;\r\n" + >+ "1. ERROR in X.java (at line 4)\n" + >+ " Zork z = null;\n" + > " ^^^^\n" + > "Zork cannot be resolved to a type\n" + > "----------\n" + >- "2. ERROR in X.java (at line 6)\r\n" + >- " } catch(Zork z) {\r\n" + >+ "2. ERROR in X.java (at line 5)\n" + >+ " z.foo();\n" + >+ " ^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 6)\n" + >+ " } catch(Zork z) {\n" + > " ^^^^\n" + > "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 7)\n" + >+ " z.foo();\n" + >+ " ^\n" + >+ "Zork cannot be resolved to a type\n" + > "----------\n"); > } > public static Class testClass() { >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.29 >diff -u -r1.29 InnerEmulationTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest.java 21 Nov 2007 14:15:12 -0000 1.29 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest.java 4 Dec 2007 16:31:14 -0000 >@@ -1168,20 +1168,14 @@ > "----------\n" + > "2. ERROR in p2\\c2.java (at line 6)\n" + > " myC1a = new c1m().new c1a(); \n" + >- " ^^^^^\n" + >- "myC1a cannot be resolved\n" + >- "----------\n" + >- "3. ERROR in p2\\c2.java (at line 6)\n" + >- " myC1a = new c1m().new c1a(); \n" + > " ^^^\n" + > "The type c1.c1m.c1a is not visible\n" + > "----------\n" + >- "4. ERROR in p2\\c2.java (at line 7)\n" + >+ "3. ERROR in p2\\c2.java (at line 7)\n" + > " myC1a.foo(); \n" + > " ^^^^^\n" + >- "myC1a cannot be resolved\n" + >- "----------\n" >- ); >+ "The type c1.c1m.c1a is not visible\n" + >+ "----------\n"); > } > /** > * Compatability - Compiler does not comply with 1.1 standard. >@@ -1229,25 +1223,19 @@ > "----------\n" + > "2. ERROR in p2\\c2.java (at line 6)\n" + > " myC1a = new c1m().new c1a(); \n" + >- " ^^^^^\n" + >- "myC1a cannot be resolved\n" + >- "----------\n" + >- "3. ERROR in p2\\c2.java (at line 6)\n" + >- " myC1a = new c1m().new c1a(); \n" + > " ^^^^^^^^^\n" + > "The constructor c1.c1m() is not visible\n" + > "----------\n" + >- "4. ERROR in p2\\c2.java (at line 6)\n" + >+ "3. ERROR in p2\\c2.java (at line 6)\n" + > " myC1a = new c1m().new c1a(); \n" + > " ^^^\n" + > "The type c1.c1m.c1a is not visible\n" + > "----------\n" + >- "5. ERROR in p2\\c2.java (at line 7)\n" + >+ "4. ERROR in p2\\c2.java (at line 7)\n" + > " myC1a.foo(); \n" + > " ^^^^^\n" + >- "myC1a cannot be resolved\n" + >- "----------\n" >- ); >+ "The type c1.c1m.c1a is not visible\n" + >+ "----------\n"); > } > /** > * Compatability - Compiler does not comply with 1.1 standard. >@@ -1336,20 +1324,14 @@ > "----------\n" + > "3. ERROR in p2\\c2.java (at line 6)\n" + > " myC1a = new c1a(); \n" + >- " ^^^^^\n" + >- "myC1a cannot be resolved\n" + >- "----------\n" + >- "4. ERROR in p2\\c2.java (at line 6)\n" + >- " myC1a = new c1a(); \n" + > " ^^^\n" + > "c1a cannot be resolved to a type\n" + > "----------\n" + >- "5. ERROR in p2\\c2.java (at line 7)\n" + >+ "4. ERROR in p2\\c2.java (at line 7)\n" + > " myC1a.foo(); \n" + > " ^^^^^\n" + >- "myC1a cannot be resolved\n" + >- "----------\n" >- ); >+ "c1a cannot be resolved to a type\n" + >+ "----------\n"); > } > /** > * Compatability - Compiler does not comply with 1.1 standard. >@@ -1400,21 +1382,14 @@ > "----------\n" + > "3. ERROR in p2\\c2.java (at line 6)\n" + > " myC1a = new c1a(); \n" + >- " ^^^^^\n" + >- "myC1a cannot be resolved\n" + >- "----------\n" + >- "4. ERROR in p2\\c2.java (at line 6)\n" + >- " myC1a = new c1a(); \n" + > " ^^^\n" + > "The type c1a is not visible\n" + > "----------\n" + >- "5. ERROR in p2\\c2.java (at line 7)\n" + >+ "4. ERROR in p2\\c2.java (at line 7)\n" + > " myC1a.foo(); \n" + > " ^^^^^\n" + >- "myC1a cannot be resolved\n" + >- "----------\n" >- >- ); >+ "The type c1.c1a is not visible\n" + >+ "----------\n"); > } > /** > * VerifyError using .class literal inside inner classes >@@ -5999,50 +5974,65 @@ > " ^^^^^\n" + > "Zork1 cannot be resolved to a type\n" + > "----------\n" + >- "7. ERROR in X.java (at line 19)\n" + >+ "7. WARNING in X.java (at line 14)\n" + >+ " Zork1 z;\n" + >+ " ^\n" + >+ "The local variable z is hiding a field from type X.Member\n" + >+ "----------\n" + >+ "8. ERROR in X.java (at line 19)\n" + > " new X().new IM();\n" + > " ^^\n" + > "Cannot instantiate the type X.IM\n" + > "----------\n" + >- "8. ERROR in X.java (at line 20)\n" + >+ "9. ERROR in X.java (at line 20)\n" + > " class Local extends X { \n" + > " ^\n" + > "The type Local cannot subclass the final class X\n" + > "----------\n" + >- "9. ERROR in X.java (at line 21)\n" + >+ "10. ERROR in X.java (at line 21)\n" + > " ZorkLocal z;\n" + > " ^^^^^^^^^\n" + > "ZorkLocal cannot be resolved to a type\n" + > "----------\n" + >- "10. ERROR in X.java (at line 23)\n" + >+ "11. ERROR in X.java (at line 23)\n" + > " this.bar();\n" + > " ^^^\n" + > "The method bar() is undefined for the type Local\n" + > "----------\n" + >- "11. ERROR in X.java (at line 24)\n" + >+ "12. ERROR in X.java (at line 24)\n" + > " Zork3 z;\n" + > " ^^^^^\n" + > "Zork3 cannot be resolved to a type\n" + > "----------\n" + >- "12. ERROR in X.java (at line 27)\n" + >+ "13. WARNING in X.java (at line 24)\n" + >+ " Zork3 z;\n" + >+ " ^\n" + >+ "The local variable z is hiding a field from type Local\n" + >+ "----------\n" + >+ "14. ERROR in X.java (at line 27)\n" + > " new X() {\n" + > " ^\n" + > "An anonymous class cannot subclass the final class X\n" + > "----------\n" + >- "13. ERROR in X.java (at line 28)\n" + >+ "15. ERROR in X.java (at line 28)\n" + > " ZorkAnonymous2 z; \n" + > " ^^^^^^^^^^^^^^\n" + > "ZorkAnonymous2 cannot be resolved to a type\n" + > "----------\n" + >- "14. ERROR in X.java (at line 30)\n" + >+ "16. ERROR in X.java (at line 30)\n" + > " this.bar();\n" + > " ^^^\n" + > "The method bar() is undefined for the type new X(){}\n" + > "----------\n" + >- "15. ERROR in X.java (at line 31)\n" + >+ "17. ERROR in X.java (at line 31)\n" + > " Zork4 z;\n" + > " ^^^^^\n" + > "Zork4 cannot be resolved to a type\n" + >+ "----------\n" + >+ "18. WARNING in X.java (at line 31)\n" + >+ " Zork4 z;\n" + >+ " ^\n" + >+ "The local variable z is hiding a field from type new X(){}\n" + > "----------\n"); > } > public static Class testClass() { >Index: src/org/eclipse/jdt/core/tests/compiler/regression/LookupTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LookupTest.java,v >retrieving revision 1.70 >diff -u -r1.70 LookupTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/LookupTest.java 16 Oct 2007 10:24:51 -0000 1.70 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/LookupTest.java 4 Dec 2007 16:31:20 -0000 >@@ -1121,7 +1121,7 @@ > "----------\n" + > "2. ERROR in X.java (at line 4)\n" + > " System.out.println(p.Bar.array.length);\n" + >- " ^^^^^^^^^^^^^^^^^^\n" + >+ " ^^^^^^^^^^^\n" + > "The type Z is not visible\n" + > "----------\n" + > "3. ERROR in X.java (at line 5)\n" + >@@ -1819,22 +1819,26 @@ > "}\n", > }, > "----------\n" + >- "1. ERROR in A.java (at line 4)\r\n" + >- " B b = new B();\r\n" + >+ "1. ERROR in A.java (at line 4)\n" + >+ " B b = new B();\n" + > " ^\n" + > "The type B is not visible\n" + > "----------\n" + >- "2. ERROR in A.java (at line 4)\r\n" + >- " B b = new B();\r\n" + >+ "2. ERROR in A.java (at line 4)\n" + >+ " B b = new B();\n" + > " ^\n" + > "The type B is not visible\n" + > "----------\n" + >- "3. ERROR in A.java (at line 6)\r\n" + >- " String s2 = B.str;\r\n" + >+ "3. ERROR in A.java (at line 5)\n" + >+ " String s1 = b.str;\n" + > " ^\n" + > "The type B is not visible\n" + >- "----------\n" >- ); >+ "----------\n" + >+ "4. ERROR in A.java (at line 6)\n" + >+ " String s2 = B.str;\n" + >+ " ^\n" + >+ "The type B is not visible\n" + >+ "----------\n"); > } > // final method in static inner class still found in extending classes > public void test056() { >@@ -1936,11 +1940,6 @@ > " Zork bb() {\n" + > " ^^^^\n" + > "Zork cannot be resolved to a type\n" + >- "----------\n" + >- "2. ERROR in X.java (at line 10)\n" + >- " this.bb();\n" + >- " ^^\n" + >- "The method bb() is undefined for the type X\n" + > "----------\n"); > } > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=132813 - variation >@@ -1974,11 +1973,6 @@ > " Zork bb() {\n" + > " ^^^^\n" + > "Zork cannot be resolved to a type\n" + >- "----------\n" + >- "3. ERROR in X.java (at line 10)\n" + >- " this.bb();\n" + >- " ^^\n" + >- "The method bb() is undefined for the type X\n" + > "----------\n"); > } > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=134839 >@@ -2868,6 +2862,30 @@ > }, > "set(1)"); > } >+ >+public void test086() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //=================== >+ "public class X {\n" + >+ " public static void main(String[] arguments) {\n" + >+ " Y y = new Y();\n" + >+ " System.out.println(y.array[0]);\n" + >+ " System.out.println(y.length);\n" + >+ " }\n" + >+ "}\n" + >+ "class Y {\n" + >+ " private class Invisible {}\n" + >+ " Invisible[] array;\n" + >+ "}\n", // ================= >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 5)\n" + >+ " System.out.println(y.length);\n" + >+ " ^^^^^^^^\n" + >+ "y.length cannot be resolved or is not a field\n" + >+ "----------\n"); >+} > public static Class testClass() { return LookupTest.class; > } > } >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/VariableBinding.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/VariableBinding.java,v >retrieving revision 1.27 >diff -u -r1.27 VariableBinding.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/VariableBinding.java 29 Mar 2006 02:45:26 -0000 1.27 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/VariableBinding.java 4 Dec 2007 16:31:38 -0000 >@@ -27,6 +27,9 @@ > this.type = type; > this.modifiers = modifiers; > this.constant = constant; >+ if (type != null) { >+ this.tagBits |= (type.tagBits & TagBits.HasMissingType); >+ } > } > > public Constant constant() { >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java,v >retrieving revision 1.155 >diff -u -r1.155 ClassScope.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java 21 Nov 2007 14:15:23 -0000 1.155 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java 4 Dec 2007 16:31:34 -0000 >@@ -857,7 +857,7 @@ > TypeReference superclassRef = referenceContext.superclass; > ReferenceBinding superclass = findSupertype(superclassRef); > if (superclass != null) { // is null if a cycle was detected cycle or a problem >- if (!superclass.isClass()) { >+ if (!superclass.isClass() && (superclass.tagBits & TagBits.HasMissingType) == 0) { > problemReporter().superclassMustBeAClass(sourceType, superclassRef, superclass); > } else if (superclass.isFinal()) { > problemReporter().classExtendFinalClass(sourceType, superclassRef, superclass); >@@ -865,6 +865,11 @@ > problemReporter().superTypeCannotUseWildcard(sourceType, superclassRef, superclass); > } else if (superclass.erasure().id == T_JavaLangEnum) { > problemReporter().cannotExtendEnum(sourceType, superclassRef, superclass); >+ } else if ((superclass.tagBits & TagBits.HierarchyHasProblems) != 0 >+ || !superclassRef.resolvedType.isValidBinding()) { >+ sourceType.superclass = superclass; >+ sourceType.tagBits |= TagBits.HierarchyHasProblems; // propagate if missing supertype >+ return superclassRef.resolvedType.isValidBinding(); // reported some error against the source type ? > } else { > // only want to reach here when no errors are reported > sourceType.superclass = superclass; >@@ -888,7 +893,7 @@ > // arity check for well-known Enum<E> > TypeVariableBinding[] refTypeVariables = rootEnumType.typeVariables(); > if (refTypeVariables == Binding.NO_TYPE_VARIABLES) { // check generic >- problemReporter().nonGenericTypeCannotBeParameterized(null, rootEnumType, new TypeBinding[]{ sourceType }); >+ problemReporter().nonGenericTypeCannotBeParameterized(0, null, rootEnumType, new TypeBinding[]{ sourceType }); > return false; // cannot reach here as AbortCompilation is thrown > } else if (1 != refTypeVariables.length) { // check arity > problemReporter().incorrectArityForParameterizedType(null, rootEnumType, new TypeBinding[]{ sourceType }); >@@ -896,6 +901,7 @@ > } > // check argument type compatibility > ParameterizedTypeBinding superType = environment().createParameterizedType(rootEnumType, new TypeBinding[]{ environment().convertToRawType(sourceType) } , null); >+ sourceType.tagBits |= (superType.tagBits & TagBits.HierarchyHasProblems); // propagate if missing supertpye > sourceType.superclass = superType; > // bound check (in case of bogus definition of Enum type) > if (refTypeVariables[0].boundCheck(superType, sourceType) != TypeConstants.OK) { >@@ -941,16 +947,18 @@ > noProblems = false; > continue nextInterface; > } >- superInterfaceRef.resolvedType = superInterface; // hold onto the problem type >+ > // check for simple interface collisions > // Check for a duplicate interface once the name is resolved, otherwise we may be confused (ie : a.b.I and c.d.I) > for (int j = 0; j < i; j++) { > if (interfaceBindings[j] == superInterface) { > problemReporter().duplicateSuperinterface(sourceType, superInterfaceRef, superInterface); >+ sourceType.tagBits |= TagBits.HierarchyHasProblems; >+ noProblems = false; > continue nextInterface; > } > } >- if (!superInterface.isInterface()) { >+ if (!superInterface.isInterface() && (superInterface.tagBits & TagBits.HasMissingType) == 0) { > problemReporter().superinterfaceMustBeAnInterface(sourceType, superInterfaceRef, superInterface); > sourceType.tagBits |= TagBits.HierarchyHasProblems; > noProblems = false; >@@ -964,6 +972,11 @@ > noProblems = false; > continue nextInterface; > } >+ if ((superInterface.tagBits & TagBits.HierarchyHasProblems) != 0 >+ || !superInterfaceRef.resolvedType.isValidBinding()) { >+ sourceType.tagBits |= TagBits.HierarchyHasProblems; // propagate if missing supertype >+ noProblems &= superInterfaceRef.resolvedType.isValidBinding(); >+ } > // only want to reach here when no errors are reported > interfaceBindings[count++] = superInterface; > } >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java,v >retrieving revision 1.110 >diff -u -r1.110 CompilationUnitScope.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java 24 Sep 2007 22:49:54 -0000 1.110 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java 4 Dec 2007 16:31:34 -0000 >@@ -562,7 +562,11 @@ > > if (importBinding == null || !importBinding.isValidBinding()) { > // create a proxy for the missing BinaryType >- BinaryTypeBinding missingObject = environment.cacheMissingBinaryType(JAVA_LANG_OBJECT, this.referenceContext); >+ problemReporter().isClassPathCorrect( >+ JAVA_LANG_OBJECT, >+ this.referenceContext, >+ environment.missingClassFileLocation); >+ BinaryTypeBinding missingObject = environment.createMissingType(null, JAVA_LANG_OBJECT); > importBinding = missingObject.fPackage; > } > >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/PackageBinding.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/PackageBinding.java,v >retrieving revision 1.42 >diff -u -r1.42 PackageBinding.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/PackageBinding.java 6 Mar 2007 02:38:50 -0000 1.42 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/PackageBinding.java 4 Dec 2007 16:31:35 -0000 >@@ -135,7 +135,7 @@ > > typeBinding = BinaryTypeBinding.resolveType(typeBinding, environment, false); // no raw conversion for now > if (typeBinding.isNestedType()) >- return new ProblemReferenceBinding(name, typeBinding, ProblemReasons.InternalNameProvided); >+ return new ProblemReferenceBinding(new char[][]{ name }, typeBinding, ProblemReasons.InternalNameProvided); > return typeBinding; > } > /* Answer the type named name if it exists in the cache. >@@ -166,7 +166,7 @@ > if (typeBinding != null && typeBinding != LookupEnvironment.TheNotFoundType) { > typeBinding = BinaryTypeBinding.resolveType(typeBinding, environment, false); // no raw conversion for now > if (typeBinding.isNestedType()) >- return new ProblemReferenceBinding(name, typeBinding, ProblemReasons.InternalNameProvided); >+ return new ProblemReferenceBinding(new char[][]{name}, typeBinding, ProblemReasons.InternalNameProvided); > return typeBinding; > } > >@@ -177,7 +177,7 @@ > if (typeBinding == null) { // have not looked for it before > if ((typeBinding = environment.askForType(this, name)) != null) { > if (typeBinding.isNestedType()) >- return new ProblemReferenceBinding(name, typeBinding, ProblemReasons.InternalNameProvided); >+ return new ProblemReferenceBinding(new char[][]{name}, typeBinding, ProblemReasons.InternalNameProvided); > return typeBinding; > } > >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java,v >retrieving revision 1.115 >diff -u -r1.115 ReferenceBinding.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java 9 Oct 2007 20:30:15 -0000 1.115 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java 4 Dec 2007 16:31:35 -0000 >@@ -319,14 +319,6 @@ > return invocationType.fPackage == this.fPackage; > } > >-/** >- * In case of problems, returns the closest match found. It may not be perfect match, but the >- * result of a best effort to improve fault-tolerance. >-*/ >-public ReferenceBinding closestMatch() { >- return this; // by default, the closest match is the binding itself >-} >- > public char[] computeGenericTypeSignature(TypeVariableBinding[] typeVariables) { > > boolean isMemberOfGeneric = isMemberType() && (enclosingType().modifiers & ExtraCompilerModifiers.AccGenericSignature) != 0; >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java,v >retrieving revision 1.320 >diff -u -r1.320 Scope.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java 2 Nov 2007 18:12:33 -0000 1.320 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java 4 Dec 2007 16:31:37 -0000 >@@ -509,8 +509,7 @@ > typeVariable.tagBits |= TagBits.HierarchyHasProblems; > continue nextBound; > } else { >- typeRef.resolvedType = superType; // hold onto the problem type >- boolean didAlreadyComplain = false; >+ boolean didAlreadyComplain = !typeRef.resolvedType.isValidBinding(); > if (isFirstBoundTypeVariable && j == 0) { > problemReporter().noAdditionalBoundAfterTypeVariable(typeRef); > typeVariable.tagBits |= TagBits.HierarchyHasProblems; >@@ -754,7 +753,7 @@ > ? memberType.canBeSeenBy(getCurrentPackage()) > : memberType.canBeSeenBy(enclosingType, enclosingReceiverType)) > return memberType; >- return new ProblemReferenceBinding(typeName, memberType, ProblemReasons.NotVisible); >+ return new ProblemReferenceBinding(new char[][]{typeName}, memberType, ProblemReasons.NotVisible); > } > return null; > } >@@ -948,7 +947,7 @@ > ? memberType.canBeSeenBy(currentPackage) > : memberType.canBeSeenBy(enclosingType, enclosingSourceType)) > return memberType; >- return new ProblemReferenceBinding(typeName, memberType, ProblemReasons.NotVisible); >+ return new ProblemReferenceBinding(new char[][]{typeName}, memberType, ProblemReasons.NotVisible); > } > > // collect all superinterfaces of receiverType until the memberType is found in a supertype >@@ -999,7 +998,7 @@ > if (visibleMemberType == null) > visibleMemberType = memberType; > else >- return new ProblemReferenceBinding(typeName, visibleMemberType, ProblemReasons.Ambiguous); >+ return new ProblemReferenceBinding(new char[][]{typeName}, visibleMemberType, ProblemReasons.Ambiguous); > } else { > notVisible = memberType; > } >@@ -1016,7 +1015,7 @@ > if (visibleMemberType == null) { > visibleMemberType = memberType; > } else { >- ambiguous = new ProblemReferenceBinding(typeName, visibleMemberType, ProblemReasons.Ambiguous); >+ ambiguous = new ProblemReferenceBinding(new char[][]{typeName}, visibleMemberType, ProblemReasons.Ambiguous); > break done; > } > } else { >@@ -1040,7 +1039,7 @@ > if (visibleMemberType != null) > return visibleMemberType; > if (notVisible != null) >- return new ProblemReferenceBinding(typeName, notVisible, ProblemReasons.NotVisible); >+ return new ProblemReferenceBinding(new char[][]{typeName}, notVisible, ProblemReasons.NotVisible); > return null; > } > >@@ -1369,7 +1368,7 @@ > > if (typeBinding.isValidBinding()) { > if (declarationPackage != invocationPackage && !typeBinding.canBeSeenBy(invocationPackage)) >- return new ProblemReferenceBinding(typeName, typeBinding, ProblemReasons.NotVisible); >+ return new ProblemReferenceBinding(new char[][]{typeName}, typeBinding, ProblemReasons.NotVisible); > } > return typeBinding; > } >@@ -1589,7 +1588,11 @@ > } > if (foundInImport) > // Answer error binding -- import on demand conflict; name found in two import on demand packages. >- return new ProblemReferenceBinding(name, null, ProblemReasons.Ambiguous); >+ return new ProblemFieldBinding( >+ foundField, // closest match >+ foundField.declaringClass, >+ name, >+ ProblemReasons.Ambiguous); > foundField = temp; > foundInImport = true; > } >@@ -2047,7 +2050,9 @@ > public final ReferenceBinding getMemberType(char[] typeName, ReferenceBinding enclosingType) { > ReferenceBinding memberType = findMemberType(typeName, enclosingType); > if (memberType != null) return memberType; >- return new ProblemReferenceBinding(typeName, null, ProblemReasons.NotFound); >+ char[][] compoundName = new char[][] { typeName }; >+ ReferenceBinding missingType = environment().createMissingType(compilationUnitScope().getCurrentPackage(), compoundName); >+ return new ProblemReferenceBinding(compoundName, missingType, ProblemReasons.NotFound); > } > > public MethodBinding getMethod(TypeBinding receiverType, char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite) { >@@ -2103,8 +2108,10 @@ > public final Binding getPackage(char[][] compoundName) { > compilationUnitScope().recordQualifiedReference(compoundName); > Binding binding = getTypeOrPackage(compoundName[0], Binding.TYPE | Binding.PACKAGE); >- if (binding == null) >- return new ProblemReferenceBinding(compoundName[0], null, ProblemReasons.NotFound); >+ if (binding == null) { >+ char[][] qName = new char[][] { compoundName[0] }; >+ return new ProblemReferenceBinding(qName, environment().createMissingType(compilationUnitScope().getCurrentPackage(), qName), ProblemReasons.NotFound); >+ } > if (!binding.isValidBinding()) > return binding; > >@@ -2114,21 +2121,19 @@ > PackageBinding packageBinding = (PackageBinding) binding; > while (currentIndex < compoundName.length) { > binding = packageBinding.getTypeOrPackage(compoundName[currentIndex++]); >- if (binding == null) >- return new ProblemReferenceBinding( >- CharOperation.subarray(compoundName, 0, currentIndex), >- null, >- ProblemReasons.NotFound); >+ if (binding == null) { >+ return new ProblemReferenceBinding(CharOperation.subarray(compoundName, 0, currentIndex), null /* no closest match since search for pkg*/, ProblemReasons.NotFound); >+ } > if (!binding.isValidBinding()) > return new ProblemReferenceBinding( > CharOperation.subarray(compoundName, 0, currentIndex), >- binding instanceof ReferenceBinding ? ((ReferenceBinding)binding).closestMatch() : null, >+ binding instanceof ReferenceBinding ? (ReferenceBinding)((ReferenceBinding)binding).closestMatch() : null, > binding.problemId()); > if (!(binding instanceof PackageBinding)) > return packageBinding; > packageBinding = (PackageBinding) binding; > } >- return new ProblemReferenceBinding(compoundName, null, ProblemReasons.NotFound); >+ return new ProblemReferenceBinding(compoundName, null /* no closest match since search for pkg*/, ProblemReasons.NotFound); > } > > /* Answer the type binding that corresponds the given name, starting the lookup in the receiver. >@@ -2153,21 +2158,22 @@ > return getType(name); > > Binding binding = packageBinding.getTypeOrPackage(name); >- if (binding == null) >+ if (binding == null) { > return new ProblemReferenceBinding( > CharOperation.arrayConcat(packageBinding.compoundName, name), > null, > ProblemReasons.NotFound); >- if (!binding.isValidBinding()) >- return new ProblemReferenceBinding( >- CharOperation.arrayConcat(packageBinding.compoundName, name), >- binding instanceof ReferenceBinding ? ((ReferenceBinding)binding).closestMatch() : null, >- binding.problemId()); >- >+ } >+ if (!binding.isValidBinding()) { >+ return new ProblemReferenceBinding( >+ binding instanceof ReferenceBinding ? ((ReferenceBinding)binding).compoundName : CharOperation.arrayConcat(packageBinding.compoundName, name), >+ binding instanceof ReferenceBinding ? (ReferenceBinding)((ReferenceBinding)binding).closestMatch() : null, >+ binding.problemId()); >+ } > ReferenceBinding typeBinding = (ReferenceBinding) binding; > if (!typeBinding.canBeSeenBy(this)) > return new ProblemReferenceBinding( >- CharOperation.arrayConcat(packageBinding.compoundName, name), >+ typeBinding.compoundName, > typeBinding, > ProblemReasons.NotVisible); > return typeBinding; >@@ -2187,38 +2193,43 @@ > > CompilationUnitScope unitScope = compilationUnitScope(); > unitScope.recordQualifiedReference(compoundName); >- Binding binding = >- getTypeOrPackage(compoundName[0], typeNameLength == 1 ? Binding.TYPE : Binding.TYPE | Binding.PACKAGE); >- if (binding == null) >- return new ProblemReferenceBinding(compoundName[0], null, ProblemReasons.NotFound); >- if (!binding.isValidBinding()) >+ Binding binding = getTypeOrPackage(compoundName[0], typeNameLength == 1 ? Binding.TYPE : Binding.TYPE | Binding.PACKAGE); >+ if (binding == null) { >+ char[][] qName = new char[][] { compoundName[0] }; >+ return new ProblemReferenceBinding(qName, environment().createMissingType(compilationUnitScope().getCurrentPackage(), qName), ProblemReasons.NotFound); >+ } >+ if (!binding.isValidBinding()) { > return (ReferenceBinding) binding; >- >+ } > int currentIndex = 1; > boolean checkVisibility = false; > if (binding instanceof PackageBinding) { > PackageBinding packageBinding = (PackageBinding) binding; > while (currentIndex < typeNameLength) { > binding = packageBinding.getTypeOrPackage(compoundName[currentIndex++]); // does not check visibility >- if (binding == null) >+ if (binding == null) { >+ char[][] qName = CharOperation.subarray(compoundName, 0, currentIndex); > return new ProblemReferenceBinding( >- CharOperation.subarray(compoundName, 0, currentIndex), >- null, >+ qName, >+ environment().createMissingType(packageBinding, qName), > ProblemReasons.NotFound); >+ } > if (!binding.isValidBinding()) > return new ProblemReferenceBinding( > CharOperation.subarray(compoundName, 0, currentIndex), >- binding instanceof ReferenceBinding ? ((ReferenceBinding)binding).closestMatch() : null, >+ binding instanceof ReferenceBinding ? (ReferenceBinding)((ReferenceBinding)binding).closestMatch() : null, > binding.problemId()); > if (!(binding instanceof PackageBinding)) > break; > packageBinding = (PackageBinding) binding; > } >- if (binding instanceof PackageBinding) >+ if (binding instanceof PackageBinding) { >+ char[][] qName = CharOperation.subarray(compoundName, 0, currentIndex); > return new ProblemReferenceBinding( >- CharOperation.subarray(compoundName, 0, currentIndex), >- null, >+ qName, >+ environment().createMissingType(null, qName), > ProblemReasons.NotFound); >+ } > checkVisibility = true; > } > >@@ -2239,12 +2250,12 @@ > ProblemReferenceBinding problemBinding = (ProblemReferenceBinding) typeBinding; > return new ProblemReferenceBinding( > CharOperation.subarray(compoundName, 0, currentIndex), >- problemBinding.closestMatch(), >+ problemBinding.closestReferenceMatch(), > typeBinding.problemId()); > } > return new ProblemReferenceBinding( > CharOperation.subarray(compoundName, 0, currentIndex), >- ((ReferenceBinding)binding).closestMatch(), >+ (ReferenceBinding)((ReferenceBinding)binding).closestMatch(), > typeBinding.problemId()); > } > } >@@ -2288,7 +2299,7 @@ > ReferenceBinding localType = ((BlockScope) scope).findLocalType(name); // looks in this scope only > if (localType != null) { > if (foundType != null && foundType != localType) >- return new ProblemReferenceBinding(name, foundType, ProblemReasons.InheritedNameHidesEnclosingName); >+ return new ProblemReferenceBinding(new char[][]{name}, foundType, ProblemReasons.InheritedNameHidesEnclosingName); > return localType; > } > break; >@@ -2315,19 +2326,19 @@ > // supercedes any potential InheritedNameHidesEnclosingName problem > return memberType; > // make the user qualify the type, likely wants the first inherited type >- return new ProblemReferenceBinding(name, foundType, ProblemReasons.InheritedNameHidesEnclosingName); >+ return new ProblemReferenceBinding(new char[][]{name}, foundType, ProblemReasons.InheritedNameHidesEnclosingName); > } > if (memberType.isValidBinding()) { > if (sourceType == memberType.enclosingType() || compilerOptions().complianceLevel >= ClassFileConstants.JDK1_4) { > if (insideStaticContext && !memberType.isStatic() && sourceType.isGenericType()) >- return new ProblemReferenceBinding(name, memberType, ProblemReasons.NonStaticReferenceInStaticContext); >+ return new ProblemReferenceBinding(new char[][]{name}, memberType, ProblemReasons.NonStaticReferenceInStaticContext); > // found a valid type in the 'immediate' scope (ie. not inherited) > // OR in 1.4 mode (inherited shadows enclosing) > if (foundType == null) > return memberType; > // if a valid type was found, complain when another is found in an 'immediate' enclosing type (ie. not inherited) > if (foundType.isValidBinding() && foundType != memberType) >- return new ProblemReferenceBinding(name, foundType, ProblemReasons.InheritedNameHidesEnclosingName); >+ return new ProblemReferenceBinding(new char[][]{name}, foundType, ProblemReasons.InheritedNameHidesEnclosingName); > } > } > if (foundType == null || (foundType.problemId() == ProblemReasons.NotVisible && memberType.problemId() != ProblemReasons.NotVisible)) >@@ -2338,14 +2349,14 @@ > TypeVariableBinding typeVariable = sourceType.getTypeVariable(name); > if (typeVariable != null) { > if (insideStaticContext) // do not consider this type modifiers: access is legite within same type >- return new ProblemReferenceBinding(name, typeVariable, ProblemReasons.NonStaticReferenceInStaticContext); >+ return new ProblemReferenceBinding(new char[][]{name}, typeVariable, ProblemReasons.NonStaticReferenceInStaticContext); > return typeVariable; > } > insideStaticContext |= sourceType.isStatic(); > insideTypeAnnotation = false; > if (CharOperation.equals(sourceType.sourceName, name)) { > if (foundType != null && foundType != sourceType && foundType.problemId() != ProblemReasons.NotVisible) >- return new ProblemReferenceBinding(name, foundType, ProblemReasons.InheritedNameHidesEnclosingName); >+ return new ProblemReferenceBinding(new char[][]{name}, foundType, ProblemReasons.InheritedNameHidesEnclosingName); > return sourceType; > } > break; >@@ -2362,26 +2373,26 @@ > CompilationUnitScope unitScope = (CompilationUnitScope) scope; > HashtableOfObject typeOrPackageCache = unitScope.typeOrPackageCache; > if (typeOrPackageCache != null) { >- Binding binding = (Binding) typeOrPackageCache.get(name); >- if (binding != null) { // can also include NotFound ProblemReferenceBindings if we already know this name is not found >- if (binding instanceof ImportBinding) { // single type import cached in faultInImports(), replace it in the cache with the type >- ImportReference importReference = ((ImportBinding) binding).reference; >+ Binding cachedBinding = (Binding) typeOrPackageCache.get(name); >+ if (cachedBinding != null) { // can also include NotFound ProblemReferenceBindings if we already know this name is not found >+ if (cachedBinding instanceof ImportBinding) { // single type import cached in faultInImports(), replace it in the cache with the type >+ ImportReference importReference = ((ImportBinding) cachedBinding).reference; > if (importReference != null) { > importReference.bits |= ASTNode.Used; > } >- if (binding instanceof ImportConflictBinding) >- typeOrPackageCache.put(name, binding = ((ImportConflictBinding) binding).conflictingTypeBinding); // already know its visible >+ if (cachedBinding instanceof ImportConflictBinding) >+ typeOrPackageCache.put(name, cachedBinding = ((ImportConflictBinding) cachedBinding).conflictingTypeBinding); // already know its visible > else >- typeOrPackageCache.put(name, binding = ((ImportBinding) binding).resolvedImport); // already know its visible >+ typeOrPackageCache.put(name, cachedBinding = ((ImportBinding) cachedBinding).resolvedImport); // already know its visible > } > if ((mask & Binding.TYPE) != 0) { >- if (foundType != null && foundType.problemId() != ProblemReasons.NotVisible && binding.problemId() != ProblemReasons.Ambiguous) >+ if (foundType != null && foundType.problemId() != ProblemReasons.NotVisible && cachedBinding.problemId() != ProblemReasons.Ambiguous) > return foundType; // problem type from above supercedes NotFound type but not Ambiguous import case >- if (binding instanceof ReferenceBinding) >- return binding; // cached type found in previous walk below >+ if (cachedBinding instanceof ReferenceBinding) >+ return cachedBinding; // cached type found in previous walk below > } >- if ((mask & Binding.PACKAGE) != 0 && binding instanceof PackageBinding) >- return binding; // cached package found in previous walk below >+ if ((mask & Binding.PACKAGE) != 0 && cachedBinding instanceof PackageBinding) >+ return cachedBinding; // cached package found in previous walk below > } > } > >@@ -2415,9 +2426,16 @@ > unitScope.recordReference(currentPackage.compoundName, name); > Binding binding = currentPackage.getTypeOrPackage(name); > if (binding instanceof ReferenceBinding) { >- if (typeOrPackageCache != null) >- typeOrPackageCache.put(name, binding); >- return binding; // type is always visible to its own package >+ ReferenceBinding referenceType = (ReferenceBinding) binding;; >+ if ((referenceType.tagBits & TagBits.HasMissingType) != 0) { >+ referenceType = new ProblemReferenceBinding(referenceType.compoundName, referenceType, ProblemReasons.NotFound); >+ if (typeOrPackageCache != null && (mask & Binding.PACKAGE) != 0) // only put NotFound type in cache if you know its not a package >+ typeOrPackageCache.put(name, referenceType); >+ } else { >+ if (typeOrPackageCache != null) >+ typeOrPackageCache.put(name, referenceType); >+ } >+ return referenceType; // type is always visible to its own package > } > > // check on demand imports >@@ -2446,7 +2464,7 @@ > } > if (foundInImport) { > // Answer error binding -- import on demand conflict; name found in two import on demand packages. >- temp = new ProblemReferenceBinding(name, type, ProblemReasons.Ambiguous); >+ temp = new ProblemReferenceBinding(new char[][]{name}, type, ProblemReasons.Ambiguous); > if (typeOrPackageCache != null) > typeOrPackageCache.put(name, temp); > return temp; >@@ -2479,7 +2497,13 @@ > > // Answer error binding -- could not find name > if (foundType == null) { >- foundType = new ProblemReferenceBinding(name, null, ProblemReasons.NotFound); >+ char[][] qName = new char[][] { name }; >+ foundType = new ProblemReferenceBinding(qName, environment().createMissingType(unitScope.fPackage, qName), ProblemReasons.NotFound); >+ if (typeOrPackageCache != null && (mask & Binding.PACKAGE) != 0) // only put NotFound type in cache if you know its not a package >+ typeOrPackageCache.put(name, foundType); >+ } >+ if ((foundType.tagBits & TagBits.HasMissingType) != 0) { >+ foundType = new ProblemReferenceBinding(foundType.compoundName, foundType, ProblemReasons.NotFound); > if (typeOrPackageCache != null && (mask & Binding.PACKAGE) != 0) // only put NotFound type in cache if you know its not a package > typeOrPackageCache.put(name, foundType); > } >@@ -2514,7 +2538,7 @@ > if (!binding.isValidBinding()) > return new ProblemReferenceBinding( > CharOperation.subarray(compoundName, 0, currentIndex), >- binding instanceof ReferenceBinding ? ((ReferenceBinding)binding).closestMatch() : null, >+ binding instanceof ReferenceBinding ? (ReferenceBinding)((ReferenceBinding)binding).closestMatch() : null, > binding.problemId()); > if (!(binding instanceof PackageBinding)) > break; >@@ -2540,7 +2564,7 @@ > if (!typeBinding.isValidBinding()) > return new ProblemReferenceBinding( > CharOperation.subarray(compoundName, 0, currentIndex), >- ((ReferenceBinding)binding).closestMatch(), >+ (ReferenceBinding)typeBinding.closestMatch(), > typeBinding.problemId()); > > if (typeBinding.isGenericType()) { >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/ProblemReferenceBinding.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ProblemReferenceBinding.java,v >retrieving revision 1.18 >diff -u -r1.18 ProblemReferenceBinding.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/ProblemReferenceBinding.java 20 Oct 2006 11:02:03 -0000 1.18 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/ProblemReferenceBinding.java 4 Dec 2007 16:31:35 -0000 >@@ -21,14 +21,18 @@ > this.closestMatch = closestMatch; > this.problemReason = problemReason; > } >-public ProblemReferenceBinding(char[] name, ReferenceBinding closestMatch, int problemReason) { >- this(new char[][] {name}, closestMatch, problemReason); >+ >+/** >+ * @see org.eclipse.jdt.internal.compiler.lookup.TypeBinding#closestMatch() >+ */ >+public TypeBinding closestMatch() { >+ return this.closestMatch; > } > > /** >- * @see org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding#closestMatch() >+ * @see org.eclipse.jdt.internal.compiler.lookup.TypeBinding#closestMatch() > */ >-public ReferenceBinding closestMatch() { >+public ReferenceBinding closestReferenceMatch() { > return this.closestMatch; > } > >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/MissingBinaryTypeBinding.java >=================================================================== >RCS file: compiler/org/eclipse/jdt/internal/compiler/lookup/MissingBinaryTypeBinding.java >diff -N compiler/org/eclipse/jdt/internal/compiler/lookup/MissingBinaryTypeBinding.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/MissingBinaryTypeBinding.java 22 Dec 2006 16:02:08 -0000 1.1 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,58 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2000, 2006 IBM Corporation and others. >- * All rights reserved. This program and the accompanying materials >- * are made available under the terms of the Eclipse Public License v1.0 >- * which accompanies this distribution, and is available at >- * http://www.eclipse.org/legal/epl-v10.html >- * >- * Contributors: >- * IBM Corporation - initial API and implementation >- *******************************************************************************/ >-package org.eclipse.jdt.internal.compiler.lookup; >- >-import org.eclipse.jdt.core.compiler.CharOperation; >-import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration; >-import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; >- >-public class MissingBinaryTypeBinding extends BinaryTypeBinding { >- >-/** >- * Special constructor for constructing proxies of missing binary types (114349) >- * @param packageBinding >- * @param compoundName >- * @param environment >- */ >-public MissingBinaryTypeBinding(PackageBinding packageBinding, char[][] compoundName, LookupEnvironment environment) { >- this.compoundName = compoundName; >- computeId(); >- this.tagBits |= TagBits.IsBinaryBinding | TagBits.HierarchyHasProblems; >- this.environment = environment; >- this.fPackage = packageBinding; >- this.fileName = CharOperation.concatWith(compoundName, '/'); >- this.sourceName = compoundName[compoundName.length - 1]; // [java][util][Map$Entry] >- this.modifiers = ClassFileConstants.AccPublic; >- this.superclass = null; // will be fixed up using #setMissingSuperclass(...) >- this.superInterfaces = Binding.NO_SUPERINTERFACES; >- this.typeVariables = Binding.NO_TYPE_VARIABLES; >- this.memberTypes = Binding.NO_MEMBER_TYPES; >- this.fields = Binding.NO_FIELDS; >- this.methods = Binding.NO_METHODS; >-} >- >-/** >- * Missing binary type will answer <code>false</code> to #isValidBinding() >- * @see org.eclipse.jdt.internal.compiler.lookup.Binding#problemId() >- */ >-public int problemId() { >- return ProblemReasons.NotFound; >-} >- >-/** >- * Only used to fixup the superclass hierarchy of proxy binary types >- * @param missingSuperclass >- * @see LookupEnvironment#cacheMissingBinaryType(char[][], CompilationUnitDeclaration) >- */ >-void setMissingSuperclass(ReferenceBinding missingSuperclass) { >- this.superclass = missingSuperclass; >-} >-} >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/WildcardBinding.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/WildcardBinding.java,v >retrieving revision 1.64 >diff -u -r1.64 WildcardBinding.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/WildcardBinding.java 24 Sep 2007 22:49:54 -0000 1.64 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/WildcardBinding.java 4 Dec 2007 16:31:38 -0000 >@@ -404,7 +404,7 @@ > this.fPackage = someGenericType.getPackage(); > } > if (someBound != null) { >- this.tagBits |= someBound.tagBits & TagBits.HasTypeVariable; >+ this.tagBits |= someBound.tagBits & (TagBits.HasTypeVariable | TagBits.HasMissingType); > } > } > >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.108 >diff -u -r1.108 BlockScope.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java 24 Sep 2007 22:49:54 -0000 1.108 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java 4 Dec 2007 16:31:34 -0000 >@@ -436,7 +436,7 @@ > if (!binding.isValidBinding()) > return new ProblemReferenceBinding( > CharOperation.subarray(compoundName, 0, currentIndex), >- ((ReferenceBinding)binding).closestMatch(), >+ (ReferenceBinding)((ReferenceBinding)binding).closestMatch(), > binding.problemId()); > if (!((ReferenceBinding) binding).canBeSeenBy(this)) > return new ProblemReferenceBinding( >@@ -495,7 +495,7 @@ > if (!binding.isValidBinding()) > return new ProblemReferenceBinding( > CharOperation.subarray(compoundName, 0, currentIndex), >- ((ReferenceBinding)binding).closestMatch(), >+ (ReferenceBinding)((ReferenceBinding)binding).closestMatch(), > binding.problemId()); > if (invocationSite instanceof ASTNode) { > referenceBinding = (ReferenceBinding) binding; >@@ -560,7 +560,7 @@ > if (!binding.isValidBinding()) > return new ProblemReferenceBinding( > CharOperation.subarray(compoundName, 0, currentIndex), >- ((ReferenceBinding)binding).closestMatch(), >+ (ReferenceBinding)((ReferenceBinding)binding).closestMatch(), > binding.problemId()); > if (!((ReferenceBinding) binding).canBeSeenBy(this)) > return new ProblemReferenceBinding( >@@ -602,7 +602,7 @@ > if (!binding.isValidBinding()) { > return new ProblemReferenceBinding( > CharOperation.subarray(compoundName, 0, currentIndex), >- ((ReferenceBinding)binding).closestMatch(), >+ (ReferenceBinding)((ReferenceBinding)binding).closestMatch(), > binding.problemId()); > } > } >@@ -623,7 +623,7 @@ > if (variableBinding == null) { > return new ProblemFieldBinding( > null, >- null, >+ typeBinding instanceof ReferenceBinding ? (ReferenceBinding) typeBinding : null, > CharOperation.concatWith(CharOperation.subarray(compoundName, 0, currentIndex), '.'), > ProblemReasons.NotFound); > } >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java,v >retrieving revision 1.99 >diff -u -r1.99 ParameterizedTypeBinding.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java 9 Oct 2007 20:30:15 -0000 1.99 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java 4 Dec 2007 16:31:35 -0000 >@@ -72,7 +72,10 @@ > for (int i = 0, length = typeVariables.length; i < length; i++) { > if (typeVariables[i].boundCheck(this, this.arguments[i]) != TypeConstants.OK) { > hasErrors = true; >- scope.problemReporter().typeMismatchError(this.arguments[i], typeVariables[i], this.type, argumentReferences[i]); >+ if ((this.arguments[i].tagBits & TagBits.HasMissingType) == 0) { >+ // do not report secondary error, if type reference already got complained against >+ scope.problemReporter().typeMismatchError(this.arguments[i], typeVariables[i], this.type, argumentReferences[i]); >+ } > } > } > } >@@ -612,7 +615,7 @@ > this.modifiers |= ExtraCompilerModifiers.AccGenericSignature; > } else if (this.enclosingType != null) { > this.modifiers |= (this.enclosingType.modifiers & ExtraCompilerModifiers.AccGenericSignature); >- this.tagBits |= this.enclosingType.tagBits & TagBits.HasTypeVariable; >+ this.tagBits |= this.enclosingType.tagBits & (TagBits.HasTypeVariable | TagBits.HasMissingType); > } > if (someArguments != null) { > this.arguments = someArguments; >@@ -632,10 +635,10 @@ > this.tagBits |= TagBits.IsBoundParameterizedType; > break; > } >- this.tagBits |= someArgument.tagBits & TagBits.HasTypeVariable; >+ this.tagBits |= someArgument.tagBits & (TagBits.HasTypeVariable | TagBits.HasMissingType); > } > } >- this.tagBits |= someType.tagBits & (TagBits.IsLocalType| TagBits.IsMemberType | TagBits.IsNestedType); >+ this.tagBits |= someType.tagBits & (TagBits.IsLocalType| TagBits.IsMemberType | TagBits.IsNestedType | TagBits.HasMissingType); > this.tagBits &= ~(TagBits.AreFieldsComplete|TagBits.AreMethodsComplete); > } > >@@ -807,7 +810,7 @@ > // arity check > TypeVariableBinding[] refTypeVariables = resolvedType.typeVariables(); > if (refTypeVariables == Binding.NO_TYPE_VARIABLES) { // check generic >- this.environment.problemReporter.nonGenericTypeCannotBeParameterized(null, resolvedType, this.arguments); >+ this.environment.problemReporter.nonGenericTypeCannotBeParameterized(0, null, resolvedType, this.arguments); > return this; // cannot reach here as AbortCompilation is thrown > } else if (argLength != refTypeVariables.length) { // check arity > this.environment.problemReporter.incorrectArityForParameterizedType(null, resolvedType, this.arguments); >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/UnresolvedReferenceBinding.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/UnresolvedReferenceBinding.java,v >retrieving revision 1.29 >diff -u -r1.29 UnresolvedReferenceBinding.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/UnresolvedReferenceBinding.java 27 Apr 2007 15:51:39 -0000 1.29 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/UnresolvedReferenceBinding.java 4 Dec 2007 16:31:38 -0000 >@@ -45,11 +45,17 @@ > ReferenceBinding targetType = this.resolvedType; > if (targetType == null) { > targetType = this.fPackage.getType0(this.compoundName[this.compoundName.length - 1]); >- if (targetType == this) >+ if (targetType == this) { > targetType = environment.askForType(this.compoundName); >+ } > if (targetType == null || targetType == this) { // could not resolve any better, error was already reported against it >+ // report the missing class file first >+ environment.problemReporter.isClassPathCorrect( >+ this.compoundName, >+ environment.unitBeingCompleted, >+ environment.missingClassFileLocation); > // create a proxy for the missing BinaryType >- targetType = environment.cacheMissingBinaryType(this.compoundName, null); >+ targetType = environment.createMissingType(null, this.compoundName); > } > setResolvedType(targetType, environment); > } >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java,v >retrieving revision 1.109 >diff -u -r1.109 BinaryTypeBinding.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java 30 Nov 2007 19:18:55 -0000 1.109 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java 4 Dec 2007 16:31:34 -0000 >@@ -170,7 +170,7 @@ > this.sourceName = binaryType.getSourceName(); > this.modifiers = binaryType.getModifiers(); > >- if ((binaryType.getTagBits() & TagBits.HasInconsistentHierarchy) != 0) >+ if ((binaryType.getTagBits() & TagBits.HierarchyHasProblems) != 0) > this.tagBits |= TagBits.HierarchyHasProblems; > > if (binaryType.isAnonymous()) { >@@ -897,7 +897,11 @@ > if ((field.modifiers & ExtraCompilerModifiers.AccUnresolved) == 0) > return field; > >- field.type = resolveType(field.type, this.environment, null, 0); >+ TypeBinding resolvedType = resolveType(field.type, this.environment, null, 0); >+ field.type = resolvedType; >+ if ((resolvedType.tagBits & TagBits.HasMissingType) != 0) { >+ field.tagBits |= TagBits.HasMissingType; >+ } > field.modifiers &= ~ExtraCompilerModifiers.AccUnresolved; > return field; > } >@@ -905,14 +909,30 @@ > if ((method.modifiers & ExtraCompilerModifiers.AccUnresolved) == 0) > return method; > >- if (!method.isConstructor()) >- method.returnType = resolveType(method.returnType, this.environment, null, 0); >- for (int i = method.parameters.length; --i >= 0;) >- method.parameters[i] = resolveType(method.parameters[i], this.environment, null, 0); >- for (int i = method.thrownExceptions.length; --i >= 0;) >- method.thrownExceptions[i] = resolveType(method.thrownExceptions[i], this.environment, true); >- for (int i = method.typeVariables.length; --i >= 0;) >+ if (!method.isConstructor()) { >+ TypeBinding resolvedType = resolveType(method.returnType, this.environment, null, 0); >+ method.returnType = resolvedType; >+ if ((resolvedType.tagBits & TagBits.HasMissingType) != 0) { >+ method.tagBits |= TagBits.HasMissingType; >+ } >+ } >+ for (int i = method.parameters.length; --i >= 0;) { >+ TypeBinding resolvedType = resolveType(method.parameters[i], this.environment, null, 0); >+ method.parameters[i] = resolvedType; >+ if ((resolvedType.tagBits & TagBits.HasMissingType) != 0) { >+ method.tagBits |= TagBits.HasMissingType; >+ } >+ } >+ for (int i = method.thrownExceptions.length; --i >= 0;) { >+ ReferenceBinding resolvedType = resolveType(method.thrownExceptions[i], this.environment, true); >+ method.thrownExceptions[i] = resolvedType; >+ if ((resolvedType.tagBits & TagBits.HasMissingType) != 0) { >+ method.tagBits |= TagBits.HasMissingType; >+ } >+ } >+ for (int i = method.typeVariables.length; --i >= 0;) { > method.typeVariables[i].resolve(this.environment); >+ } > method.modifiers &= ~ExtraCompilerModifiers.AccUnresolved; > return method; > } >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/TagBits.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TagBits.java,v >retrieving revision 1.31 >diff -u -r1.31 TagBits.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/TagBits.java 6 Mar 2007 02:38:51 -0000 1.31 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/TagBits.java 4 Dec 2007 16:31:38 -0000 >@@ -26,7 +26,8 @@ > long AnonymousTypeMask = LocalTypeMask | IsAnonymousType; > long IsBinaryBinding = ASTNode.Bit7; > >- long HasInconsistentHierarchy = ASTNode.Bit8; // for binary type binding only >+ // set for all bindings either represeting a missing type (type), or directly referencing a missing type (field/method/variable) >+ long HasMissingType = ASTNode.Bit8; > > // for the type cycle hierarchy check used by ClassScope > long BeginHierarchyCheck = ASTNode.Bit9; // type >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java,v >retrieving revision 1.151 >diff -u -r1.151 SourceTypeBinding.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java 28 Sep 2007 18:26:06 -0000 1.151 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java 4 Dec 2007 16:31:38 -0000 >@@ -543,6 +543,7 @@ > if (this.typeVariables != Binding.NO_TYPE_VARIABLES) return Binding.GENERIC_TYPE; > return Binding.TYPE; > } >+ > public char[] computeUniqueKey(boolean isLeaf) { > char[] uniqueKey = super.computeUniqueKey(isLeaf); > if (uniqueKey.length == 2) return uniqueKey; // problem type's unique key is "L;" >@@ -577,6 +578,7 @@ > } > return uniqueKey; > } >+ > void faultInTypesForFieldsAndMethods() { > // check @Deprecated annotation > getAnnotationTagBits(); // marks as deprecated by side effect >@@ -1272,8 +1274,7 @@ > try { > initializationScope.initializedField = field; > FieldDeclaration fieldDecl = fieldDecls[f]; >- TypeBinding fieldType = >- fieldDecl.getKind() == AbstractVariableDeclaration.ENUM_CONSTANT >+ TypeBinding fieldType = fieldDecl.getKind() == AbstractVariableDeclaration.ENUM_CONSTANT > ? initializationScope.environment().convertToRawType(this) // enum constant is implicitly of declaring enum type > : fieldDecl.type.resolveType(initializationScope, true /* check bounds*/); > field.type = fieldType; >@@ -1292,6 +1293,9 @@ > fieldDecl.binding = null; > return null; > } >+ if ((fieldType.tagBits & TagBits.HasMissingType) != 0) { >+ field.tagBits |= TagBits.HasMissingType; >+ } > TypeBinding leafType = fieldType.leafComponentType(); > if (leafType instanceof ReferenceBinding && (((ReferenceBinding)leafType).modifiers & ExtraCompilerModifiers.AccGenericSignature) != 0) { > field.modifiers |= ExtraCompilerModifiers.AccGenericSignature; >@@ -1341,11 +1345,15 @@ > continue; > } > if (resolvedExceptionType.findSuperTypeOriginatingFrom(TypeIds.T_JavaLangThrowable, true) == null) { >- methodDecl.scope.problemReporter().cannotThrowType(exceptionTypes[i], resolvedExceptionType); >- continue; >+ if (resolvedExceptionType.isValidBinding()) { >+ methodDecl.scope.problemReporter().cannotThrowType(exceptionTypes[i], resolvedExceptionType); >+ continue; >+ } > } >- if ((resolvedExceptionType.modifiers & ExtraCompilerModifiers.AccGenericSignature) != 0) >- method.modifiers |= ExtraCompilerModifiers.AccGenericSignature; >+ if ((resolvedExceptionType.tagBits & TagBits.HasMissingType) != 0) { >+ method.tagBits |= TagBits.HasMissingType; >+ } >+ method.modifiers |= (resolvedExceptionType.modifiers & ExtraCompilerModifiers.AccGenericSignature); > method.thrownExceptions[count++] = resolvedExceptionType; > } > if (count < size) >@@ -1367,6 +1375,9 @@ > methodDecl.scope.problemReporter().argumentTypeCannotBeVoid(this, methodDecl, arg); > foundArgProblem = true; > } else { >+ if ((parameterType.tagBits & TagBits.HasMissingType) != 0) { >+ method.tagBits |= TagBits.HasMissingType; >+ } > TypeBinding leafType = parameterType.leafComponentType(); > if (leafType instanceof ReferenceBinding && (((ReferenceBinding) leafType).modifiers & ExtraCompilerModifiers.AccGenericSignature) != 0) > method.modifiers |= ExtraCompilerModifiers.AccGenericSignature; >@@ -1397,6 +1408,9 @@ > methodDecl.scope.problemReporter().returnTypeCannotBeVoidArray((MethodDeclaration) methodDecl); > foundReturnTypeProblem = true; > } else { >+ if ((methodType.tagBits & TagBits.HasMissingType) != 0) { >+ method.tagBits |= TagBits.HasMissingType; >+ } > method.returnType = methodType; > TypeBinding leafType = methodType.leafComponentType(); > if (leafType instanceof ReferenceBinding && (((ReferenceBinding) leafType).modifiers & ExtraCompilerModifiers.AccGenericSignature) != 0) >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java,v >retrieving revision 1.89 >diff -u -r1.89 LookupEnvironment.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java 25 Oct 2007 10:44:09 -0000 1.89 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java 4 Dec 2007 16:31:35 -0000 >@@ -29,36 +29,28 @@ > > public class LookupEnvironment implements ProblemReasons, TypeConstants { > >- final static int BUILD_FIELDS_AND_METHODS = 4; >- final static int BUILD_TYPE_HIERARCHY = 1; >- final static int CHECK_AND_SET_IMPORTS = 2; >- final static int CONNECT_TYPE_HIERARCHY = 3; >- static final ProblemPackageBinding TheNotFoundPackage = new ProblemPackageBinding(CharOperation.NO_CHAR, NotFound); >- static final ProblemReferenceBinding TheNotFoundType = new ProblemReferenceBinding(CharOperation.NO_CHAR, null, NotFound); >- > /** > * Map from typeBinding -> accessRestriction rule > */ > private Map accessRestrictions; > ImportBinding[] defaultImports; >- > public PackageBinding defaultPackage; > HashtableOfPackage knownPackages; > private int lastCompletedUnitIndex = -1; > private int lastUnitIndex = -1; >- >+ > public INameEnvironment nameEnvironment; > public CompilerOptions globalOptions; >- public ProblemReporter problemReporter; > >+ public ProblemReporter problemReporter; > public ClassFilePool classFilePool; >- > // indicate in which step on the compilation we are. > // step 1 : build the reference binding > // step 2 : conect the hierarchy (connect bindings) > // step 3 : build fields and method bindings. > private int stepCompleted; > public ITypeRequestor typeRequestor; >+ > private ArrayBinding[][] uniqueArrayBindings; > private SimpleLookupTable uniqueParameterizedTypeBindings; > private SimpleLookupTable uniqueRawTypeBindings; >@@ -67,9 +59,16 @@ > > public CompilationUnitDeclaration unitBeingCompleted = null; // only set while completing units > public Object missingClassFileLocation = null; // only set when resolving certain references, to help locating problems >- > private CompilationUnitDeclaration[] units = new CompilationUnitDeclaration[4]; > private MethodVerifier verifier; >+ final static int BUILD_FIELDS_AND_METHODS = 4; >+ final static int BUILD_TYPE_HIERARCHY = 1; >+ >+ final static int CHECK_AND_SET_IMPORTS = 2; >+ final static int CONNECT_TYPE_HIERARCHY = 3; >+ >+ static final ProblemPackageBinding TheNotFoundPackage = new ProblemPackageBinding(CharOperation.NO_CHAR, NotFound); >+ static final ProblemReferenceBinding TheNotFoundType = new ProblemReferenceBinding(CharOperation.NO_CHAR_CHAR, null, NotFound); > > public LookupEnvironment(ITypeRequestor typeRequestor, CompilerOptions globalOptions, ProblemReporter problemReporter, INameEnvironment nameEnvironment) { > this.typeRequestor = typeRequestor; >@@ -96,19 +95,18 @@ > > public ReferenceBinding askForType(char[][] compoundName) { > NameEnvironmentAnswer answer = nameEnvironment.findType(compoundName); >- if (answer == null) >- return null; >+ if (answer == null) return null; > >- if (answer.isBinaryType()) >+ if (answer.isBinaryType()) { > // the type was found as a .class file > typeRequestor.accept(answer.getBinaryType(), computePackageFrom(compoundName), answer.getAccessRestriction()); >- else if (answer.isCompilationUnit()) >+ } else if (answer.isCompilationUnit()) { > // the type was found as a .java file, try to build it then search the cache > typeRequestor.accept(answer.getCompilationUnit(), answer.getAccessRestriction()); >- else if (answer.isSourceType()) >+ } else if (answer.isSourceType()) { > // the type was found as a source model > typeRequestor.accept(answer.getSourceTypes(), computePackageFrom(compoundName), answer.getAccessRestriction()); >- >+ } > return getCachedType(compoundName); > } > /* Ask the oracle for a type named name in the packageBinding. >@@ -125,47 +123,46 @@ > if (answer == null) > return null; > >- if (answer.isBinaryType()) >+ if (answer.isBinaryType()) { > // the type was found as a .class file > typeRequestor.accept(answer.getBinaryType(), packageBinding, answer.getAccessRestriction()); >- else if (answer.isCompilationUnit()) >+ } else if (answer.isCompilationUnit()) { > // the type was found as a .java file, try to build it then search the cache > typeRequestor.accept(answer.getCompilationUnit(), answer.getAccessRestriction()); >- else if (answer.isSourceType()) >+ } else if (answer.isSourceType()) { > // the type was found as a source model > typeRequestor.accept(answer.getSourceTypes(), packageBinding, answer.getAccessRestriction()); >- >+ } > return packageBinding.getType0(name); > } >+ > /* Create the initial type bindings for the compilation unit. > * > * See completeTypeBindings() for a description of the remaining steps > * > * NOTE: This method can be called multiple times as additional source files are needed > */ >- > public void buildTypeBindings(CompilationUnitDeclaration unit, AccessRestriction accessRestriction) { > CompilationUnitScope scope = new CompilationUnitScope(unit, this); > scope.buildTypeBindings(accessRestriction); >- > int unitsLength = units.length; > if (++lastUnitIndex >= unitsLength) > System.arraycopy(units, 0, units = new CompilationUnitDeclaration[2 * unitsLength], 0, unitsLength); > units[lastUnitIndex] = unit; > } >+ > /* Cache the binary type since we know it is needed during this compile. > * > * Answer the created BinaryTypeBinding or null if the type is already in the cache. > */ >- > public BinaryTypeBinding cacheBinaryType(IBinaryType binaryType, AccessRestriction accessRestriction) { > return cacheBinaryType(binaryType, true, accessRestriction); > } >+ > /* Cache the binary type since we know it is needed during this compile. > * > * Answer the created BinaryTypeBinding or null if the type is already in the cache. > */ >- > public BinaryTypeBinding cacheBinaryType(IBinaryType binaryType, boolean needFieldsAndMethods, AccessRestriction accessRestriction) { > char[][] compoundName = CharOperation.splitOn('/', binaryType.getName()); > ReferenceBinding existingType = getCachedType(compoundName); >@@ -175,38 +172,6 @@ > return createBinaryTypeFrom(binaryType, computePackageFrom(compoundName), needFieldsAndMethods, accessRestriction); > return null; // the type already exists & can be retrieved from the cache > } >-public BinaryTypeBinding cacheMissingBinaryType(char[][] compoundName, CompilationUnitDeclaration unit) { >- // report the missing class file first >- problemReporter.isClassPathCorrect( >- compoundName, >- unit == null ? this.unitBeingCompleted : unit, >- this.missingClassFileLocation); >- >- PackageBinding packageBinding = computePackageFrom(compoundName); >- // create a proxy for the missing BinaryType >- MissingBinaryTypeBinding type = new MissingBinaryTypeBinding(packageBinding, compoundName, this); >- if (type.id != TypeIds.T_JavaLangObject) { >- // make Object be its superclass - it could in turn be missing as well >- ReferenceBinding objectType = getType(TypeConstants.JAVA_LANG_OBJECT); >- if (objectType == null) >- objectType = cacheMissingBinaryType(TypeConstants.JAVA_LANG_OBJECT, unit); // create a proxy for the missing Object type >- type.setMissingSuperclass(objectType); >- } >- packageBinding.addType(type); >- return type; >-} >-/* >-* 1. Connect the type hierarchy for the type bindings created for parsedUnits. >-* 2. Create the field bindings >-* 3. Create the method bindings >-*/ >- >-/* We know each known compilationUnit is free of errors at this point... >-* >-* Each step will create additional bindings unless a problem is detected, in which >-* case either the faulty import/superinterface/field/method will be skipped or a >-* suitable replacement will be substituted (such as Object for a missing superclass) >-*/ > > public void completeTypeBindings() { > stepCompleted = BUILD_TYPE_HIERARCHY; >@@ -231,18 +196,19 @@ > this.lastCompletedUnitIndex = this.lastUnitIndex; > this.unitBeingCompleted = null; > } >+ > /* > * 1. Connect the type hierarchy for the type bindings created for parsedUnits. > * 2. Create the field bindings > * 3. Create the method bindings > */ > >-/* >+/* We know each known compilationUnit is free of errors at this point... >+* > * Each step will create additional bindings unless a problem is detected, in which > * case either the faulty import/superinterface/field/method will be skipped or a > * suitable replacement will be substituted (such as Object for a missing superclass) > */ >- > public void completeTypeBindings(CompilationUnitDeclaration parsedUnit) { > if (stepCompleted == BUILD_FIELDS_AND_METHODS) { > // This can only happen because the original set of units are completely built and >@@ -261,6 +227,7 @@ > this.unitBeingCompleted = null; > } > } >+ > /* > * Used by other compiler tools which do not start by calling completeTypeBindings(). > * >@@ -269,6 +236,11 @@ > * 3. Create the method bindings > */ > >+/* >+* Each step will create additional bindings unless a problem is detected, in which >+* case either the faulty import/superinterface/field/method will be skipped or a >+* suitable replacement will be substituted (such as Object for a missing superclass) >+*/ > public void completeTypeBindings(CompilationUnitDeclaration parsedUnit, boolean buildFieldsAndMethods) { > if (parsedUnit.scope == null) return; // parsing errors were too severe > >@@ -279,6 +251,7 @@ > parsedUnit.scope.buildFieldsAndMethods(); > this.unitBeingCompleted = null; > } >+ > public TypeBinding computeBoxingType(TypeBinding type) { > TypeBinding boxedType; > switch (type.id) { >@@ -373,7 +346,8 @@ > } > } > return type; >-} >+} >+ > private PackageBinding computePackageFrom(char[][] constantPoolName) { > if (constantPoolName.length == 1) > return defaultPackage; >@@ -392,30 +366,7 @@ > } > } > return packageBinding; >-} >- >-/** >- * Convert a given source type into a parameterized form if generic. >- * generic X<E> --> param X<E> >- */ >-public ReferenceBinding convertToParameterizedType(ReferenceBinding originalType) { >- if (originalType != null) { >- boolean isGeneric = originalType.isGenericType(); >- ReferenceBinding originalEnclosingType = originalType.enclosingType(); >- ReferenceBinding convertedEnclosingType = originalEnclosingType; >- boolean needToConvert = isGeneric; >- if (originalEnclosingType != null) { >- convertedEnclosingType = originalType.isStatic() >- ? (ReferenceBinding) convertToRawType(originalEnclosingType) >- : convertToParameterizedType(originalEnclosingType); >- needToConvert |= originalEnclosingType != convertedEnclosingType; >- } >- if (needToConvert) { >- return createParameterizedType(originalType, isGeneric ? originalType.typeVariables() : null, convertedEnclosingType); >- } >- } >- return originalType; >-} >+} > > public TypeBinding convertEliminatingTypeVariables(TypeBinding originalType, ReferenceBinding genericType, int rank, Set eliminatedVariables) { > if ((originalType.tagBits & TagBits.HasTypeVariable) != 0) { >@@ -534,6 +485,29 @@ > return originalType; > } > >+/** >+ * Convert a given source type into a parameterized form if generic. >+ * generic X<E> --> param X<E> >+ */ >+public ReferenceBinding convertToParameterizedType(ReferenceBinding originalType) { >+ if (originalType != null) { >+ boolean isGeneric = originalType.isGenericType(); >+ ReferenceBinding originalEnclosingType = originalType.enclosingType(); >+ ReferenceBinding convertedEnclosingType = originalEnclosingType; >+ boolean needToConvert = isGeneric; >+ if (originalEnclosingType != null) { >+ convertedEnclosingType = originalType.isStatic() >+ ? (ReferenceBinding) convertToRawType(originalEnclosingType) >+ : convertToParameterizedType(originalEnclosingType); >+ needToConvert |= originalEnclosingType != convertedEnclosingType; >+ } >+ if (needToConvert) { >+ return createParameterizedType(originalType, isGeneric ? originalType.typeVariables() : null, convertedEnclosingType); >+ } >+ } >+ return originalType; >+} >+ > public TypeBinding convertToRawType(TypeBinding type) { > int dimension; > TypeBinding originalType; >@@ -655,6 +629,7 @@ > } > return type; > } >+ > /* > * Used to guarantee annotation identity. > */ >@@ -664,7 +639,6 @@ > } > return new AnnotationBinding(annotationType, pairs); > } >- > /* > * Used to guarantee array type identity. > */ >@@ -706,6 +680,7 @@ > uniqueArrayBindings[dimIndex] = arrayBindings; > return arrayBindings[length] = new ArrayBinding(leafComponentType, dimensionCount, this); > } >+ > public BinaryTypeBinding createBinaryTypeFrom(IBinaryType binaryType, PackageBinding packageBinding, AccessRestriction accessRestriction) { > return createBinaryTypeFrom(binaryType, packageBinding, true, accessRestriction); > } >@@ -731,9 +706,35 @@ > binaryBinding.cachePartsFrom(binaryType, needFieldsAndMethods); > return binaryBinding; > } >-/* Used to create packages from the package statement. >+ >+/* >+ * Used to create types denoting missing types > */ >+public MissingTypeBinding createMissingType(PackageBinding packageBinding, char[][] compoundName) { >+ // create a proxy for the missing BinaryType >+ if (packageBinding == null) { >+ packageBinding = computePackageFrom(compoundName); >+ if (packageBinding == TheNotFoundPackage) packageBinding = this.defaultPackage; >+ } >+ MissingTypeBinding missingType = new MissingTypeBinding(packageBinding, compoundName, this); >+// this.uniqueMissingTypeBindings.put(compoundName, missingType); >+ if (missingType.id != TypeIds.T_JavaLangObject) { >+ // make Object be its superclass - it could in turn be missing as well >+ ReferenceBinding objectType = getType(TypeConstants.JAVA_LANG_OBJECT); >+ if (objectType == null) { >+ objectType = createMissingType(null, TypeConstants.JAVA_LANG_OBJECT); // create a proxy for the missing Object type >+ } >+ missingType.setMissingSuperclass(objectType); >+ } >+ packageBinding.addType(missingType); >+ return missingType; >+} > >+/* >+* 1. Connect the type hierarchy for the type bindings created for parsedUnits. >+* 2. Create the field bindings >+* 3. Create the method bindings >+*/ > public PackageBinding createPackage(char[][] compoundName) { > PackageBinding packageBinding = getPackage0(compoundName[0]); > if (packageBinding == null || packageBinding == TheNotFoundPackage) { >@@ -769,7 +770,6 @@ > } > > public ParameterizedGenericMethodBinding createParameterizedGenericMethod(MethodBinding genericMethod, RawTypeBinding rawType) { >- > // cached info is array of already created parameterized types for this type > ParameterizedGenericMethodBinding[] cachedInfo = (ParameterizedGenericMethodBinding[])this.uniqueParameterizedGenericMethodBindings.get(genericMethod); > boolean needToGrow = false; >@@ -802,7 +802,6 @@ > } > > public ParameterizedGenericMethodBinding createParameterizedGenericMethod(MethodBinding genericMethod, TypeBinding[] typeArguments) { >- > // cached info is array of already created parameterized types for this type > ParameterizedGenericMethodBinding[] cachedInfo = (ParameterizedGenericMethodBinding[])this.uniqueParameterizedGenericMethodBindings.get(genericMethod); > int argLength = typeArguments == null ? 0: typeArguments.length; >@@ -842,7 +841,6 @@ > } > > public ParameterizedTypeBinding createParameterizedType(ReferenceBinding genericType, TypeBinding[] typeArguments, ReferenceBinding enclosingType) { >- > // cached info is array of already created parameterized types for this type > ParameterizedTypeBinding[] cachedInfo = (ParameterizedTypeBinding[])this.uniqueParameterizedTypeBindings.get(genericType); > int argLength = typeArguments == null ? 0: typeArguments.length; >@@ -917,7 +915,6 @@ > } > > public WildcardBinding createWildcard(ReferenceBinding genericType, int rank, TypeBinding bound, TypeBinding[] otherBounds, int boundKind) { >- > // cached info is array of already created wildcard types for this type > if (genericType == null) // pseudo wildcard denoting composite bounds for lub computation > genericType = ReferenceBinding.LUB_GENERIC; >@@ -977,14 +974,12 @@ > * NOTE: Do not use for nested types... the answer is NOT the same for a.b.C or a.b.C.D.E > * assuming C is a type in both cases. In the a.b.C.D.E case, null is the answer. > */ >- > public ReferenceBinding getCachedType(char[][] compoundName) { > if (compoundName.length == 1) { > if (defaultPackage == null) > return null; > return defaultPackage.getType0(compoundName[0]); > } >- > PackageBinding packageBinding = getPackage0(compoundName[0]); > if (packageBinding == null || packageBinding == TheNotFoundPackage) > return null; >@@ -994,6 +989,7 @@ > return null; > return packageBinding.getType0(compoundName[compoundName.length - 1]); > } >+ > /* Answer the top level package named name if it exists in the cache. > * Answer theNotFoundPackage if it could not be resolved the first time > * it was looked up, otherwise answer null. >@@ -1001,10 +997,10 @@ > * NOTE: Senders must convert theNotFoundPackage into a real problem > * package if its to returned. > */ >- > PackageBinding getPackage0(char[] name) { > return knownPackages.get(name); > } >+ > /* Answer the type corresponding to the compoundName. > * Ask the name environment for the type if its not in the cache. > * Fail with a classpath error if the type cannot be found. >@@ -1014,15 +1010,18 @@ > if (type != null) return type; > > // create a proxy for the missing BinaryType >- return cacheMissingBinaryType( >+ // report the missing class file first >+ problemReporter.isClassPathCorrect( > compoundName, >- scope == null ? this.unitBeingCompleted : scope.referenceCompilationUnit()); >+ scope == null ? this.unitBeingCompleted : scope.referenceCompilationUnit(), >+ this.missingClassFileLocation); >+ return createMissingType(null, compoundName); > } >+ > /* Answer the top level package named name. > * Ask the oracle for the package if its not in the cache. > * Answer null if the package cannot be found. > */ >- > PackageBinding getTopLevelPackage(char[] name) { > PackageBinding packageBinding = getPackage0(name); > if (packageBinding != null) { >@@ -1039,11 +1038,11 @@ > knownPackages.put(name, TheNotFoundPackage); // saves asking the oracle next time > return null; > } >+ > /* Answer the type corresponding to the compoundName. > * Ask the name environment for the type if its not in the cache. > * Answer null if the type cannot be found. > */ >- > public ReferenceBinding getType(char[][] compoundName) { > ReferenceBinding referenceBinding; > >@@ -1086,6 +1085,7 @@ > return new ProblemReferenceBinding(compoundName, referenceBinding, InternalNameProvided); > return referenceBinding; > } >+ > private TypeBinding[] getTypeArgumentsFromSignature(SignatureWrapper wrapper, TypeVariableBinding[] staticVariables, ReferenceBinding enclosingType, ReferenceBinding genericType) { > java.util.ArrayList args = new java.util.ArrayList(2); > int rank = 0; >@@ -1097,13 +1097,13 @@ > args.toArray(typeArguments); > return typeArguments; > } >+ > /* Answer the type corresponding to the compound name. > * Does not ask the oracle for the type if its not found in the cache... instead an > * unresolved type is returned which must be resolved before used. > * > * NOTE: Does NOT answer base types nor array types! > */ >- > ReferenceBinding getTypeFromCompoundName(char[][] compoundName, boolean isParameterized) { > ReferenceBinding binding = getCachedType(compoundName); > if (binding == null) { >@@ -1111,21 +1111,26 @@ > binding = new UnresolvedReferenceBinding(compoundName, packageBinding); > packageBinding.addType(binding); > } else if (binding == TheNotFoundType) { >+ // report the missing class file first >+ problemReporter.isClassPathCorrect( >+ compoundName, >+ this.unitBeingCompleted, >+ this.missingClassFileLocation); > // create a proxy for the missing BinaryType >- binding = cacheMissingBinaryType(compoundName, this.unitBeingCompleted); >+ binding = createMissingType(null, compoundName); > } else if (!isParameterized) { > // check raw type, only for resolved types > binding = (ReferenceBinding) convertUnresolvedBinaryToRawType(binding); > } > return binding; > } >+ > /* Answer the type corresponding to the name from the binary file. > * Does not ask the oracle for the type if its not found in the cache... instead an > * unresolved type is returned which must be resolved before used. > * > * NOTE: Does NOT answer base types nor array types! > */ >- > ReferenceBinding getTypeFromConstantPoolName(char[] signature, int start, int end, boolean isParameterized) { > if (end == -1) > end = signature.length; >@@ -1133,13 +1138,13 @@ > char[][] compoundName = CharOperation.splitOn('/', signature, start, end); > return getTypeFromCompoundName(compoundName, isParameterized); > } >+ > /* Answer the type corresponding to the signature from the binary file. > * Does not ask the oracle for the type if its not found in the cache... instead an > * unresolved type is returned which must be resolved before used. > * > * NOTE: Does answer base types & array types. > */ >- > TypeBinding getTypeFromSignature(char[] signature, int start, int end, boolean isParameterized, TypeBinding enclosingType) { > int dimension = 0; > while (signature[start] == '[') { >@@ -1192,6 +1197,7 @@ > return binding; > return createArrayType(binding, dimension); > } >+ > TypeBinding getTypeFromTypeSignature(SignatureWrapper wrapper, TypeVariableBinding[] staticVariables, ReferenceBinding enclosingType) { > // TypeVariableSignature = 'T' Identifier ';' > // ArrayTypeSignature = '[' TypeSignature >@@ -1203,7 +1209,6 @@ > wrapper.start++; > dimension++; > } >- > if (wrapper.signature[wrapper.start] == 'T') { > int varStart = wrapper.start + 1; > int varEnd = wrapper.computeEnd(); >@@ -1258,12 +1263,13 @@ > wrapper.start++; // skip ';' > return dimension == 0 ? (TypeBinding) parameterizedType : createArrayType(parameterizedType, dimension); > } >+ > TypeBinding getTypeFromVariantTypeSignature( >- SignatureWrapper wrapper, >- TypeVariableBinding[] staticVariables, >- ReferenceBinding enclosingType, >- ReferenceBinding genericType, >- int rank) { >+ SignatureWrapper wrapper, >+ TypeVariableBinding[] staticVariables, >+ ReferenceBinding enclosingType, >+ ReferenceBinding genericType, >+ int rank) { > // VariantTypeSignature = '-' TypeSignature > // or '+' TypeSignature > // or TypeSignature >@@ -1295,8 +1301,8 @@ > return nameEnvironment.isPackage(null, name); > return nameEnvironment.isPackage(compoundName, name); > } >-// The method verifier is lazily initialized to guarantee the receiver, the compiler & the oracle are ready. > >+// The method verifier is lazily initialized to guarantee the receiver, the compiler & the oracle are ready. > public MethodVerifier methodVerifier() { > if (verifier == null) > verifier = this.globalOptions.sourceLevel < ClassFileConstants.JDK1_5 >@@ -1304,6 +1310,7 @@ > : new MethodVerifier15(this); // covariance only if sourceLevel is >= 1.5 > return verifier; > } >+ > public void reset() { > this.defaultPackage = new PackageBinding(this); // assume the default package always exists > this.defaultImports = null; >@@ -1321,7 +1328,6 @@ > this.uniqueRawTypeBindings = new SimpleLookupTable(3); > this.uniqueWildcardBindings = new SimpleLookupTable(3); > this.uniqueParameterizedGenericMethodBindings = new SimpleLookupTable(3); >- > for (int i = this.units.length; --i >= 0;) > this.units[i] = null; > this.lastUnitIndex = -1; >@@ -1332,6 +1338,7 @@ > // name environment has a longer life cycle, and must be reset in > // the code which created it. > } >+ > /** > * Associate a given type with some access restriction > * (did not store the restriction directly into binding, since sparse information) >@@ -1354,7 +1361,6 @@ > } > } > } >- > if (this.uniqueWildcardBindings.get(unresolvedType) != null) { // update the key > Object[] keys = this.uniqueWildcardBindings.keyTable; > for (int i = 0, l = keys.length; i < l; i++) { >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/ArrayBinding.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ArrayBinding.java,v >retrieving revision 1.56 >diff -u -r1.56 ArrayBinding.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/ArrayBinding.java 24 Sep 2007 22:49:54 -0000 1.56 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/ArrayBinding.java 4 Dec 2007 16:31:33 -0000 >@@ -33,9 +33,15 @@ > if (type instanceof UnresolvedReferenceBinding) > ((UnresolvedReferenceBinding) type).addWrapper(this, environment); > else >- this.tagBits |= type.tagBits & (TagBits.HasTypeVariable | TagBits.HasDirectWildcard); >+ this.tagBits |= type.tagBits & (TagBits.HasTypeVariable | TagBits.HasDirectWildcard | TagBits.HasMissingType); > } > >+public TypeBinding closestMatch() { >+ if (this.isValidBinding()) { >+ return this; >+ } >+ return this.environment.createArrayType(this.leafComponentType.closestMatch(), this.dimensions); >+} > /** > * Collect the substitutes into a map for certain type variables inside the receiver type > * e.g. Collection<T>.collectSubstitutes(Collection<List<X>>, Map), will populate Map with: T --> List<X> >@@ -241,7 +247,7 @@ > public void swapUnresolved(UnresolvedReferenceBinding unresolvedType, ReferenceBinding resolvedType, LookupEnvironment env) { > if (this.leafComponentType == unresolvedType) { > this.leafComponentType = env.convertUnresolvedBinaryToRawType(resolvedType); >- this.tagBits |= this.leafComponentType.tagBits & (TagBits.HasTypeVariable | TagBits.HasDirectWildcard); >+ this.tagBits |= this.leafComponentType.tagBits & (TagBits.HasTypeVariable | TagBits.HasDirectWildcard | TagBits.HasMissingType); > } > } > public String toString() { >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java,v >retrieving revision 1.92 >diff -u -r1.92 TypeBinding.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java 12 Oct 2007 09:37:00 -0000 1.92 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java 4 Dec 2007 16:31:38 -0000 >@@ -104,6 +104,14 @@ > } > > /** >+ * In case of problems, returns the closest match found. It may not be perfect match, but the >+ * result of a best effort to improve fault-tolerance. >+ */ >+public TypeBinding closestMatch() { >+ return this; // by default no better type >+} >+ >+/** > * Collect the substitutes into a map for certain type variables inside the receiver type > * e.g. Collection<T>.findSubstitute(T, Collection<List<X>>): T --> List<X> > * Constraints: >Index: compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedThisReference.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedThisReference.java,v >retrieving revision 1.37 >diff -u -r1.37 QualifiedThisReference.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedThisReference.java 13 Oct 2006 19:20:46 -0000 1.37 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedThisReference.java 4 Dec 2007 16:31:32 -0000 >@@ -76,7 +76,7 @@ > constant = Constant.NotAConstant; > // X.this is not a param/raw type as denoting enclosing instance > TypeBinding type = this.qualification.resolveType(scope, true /* check bounds*/); >- if (type == null) return null; >+ if (type == null || !type.isValidBinding()) return null; > // X.this is not a param/raw type as denoting enclosing instance > type = type.erasure(); > >@@ -109,7 +109,7 @@ > checkAccess(scope.methodScope()); > } // if depth>0, path emulation will diagnose bad scenarii > >- return this.resolvedType; >+ return this.resolvedType; > } > > public StringBuffer printExpression(int indent, StringBuffer output) { >Index: compiler/org/eclipse/jdt/internal/compiler/ast/TypeReference.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeReference.java,v >retrieving revision 1.37 >diff -u -r1.37 TypeReference.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/TypeReference.java 6 Mar 2007 02:38:48 -0000 1.37 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/TypeReference.java 4 Dec 2007 16:31:33 -0000 >@@ -28,14 +28,6 @@ > > public abstract class TypeReference extends Expression { > >-public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) { >- return flowInfo; >-} >- >-// allows us to trap completion & selection nodes >-public void aboutToResolve(Scope scope) { >- // default implementation: do nothing >-} > /* > * Answer a base type reference (can be an array of base type). > */ >@@ -84,6 +76,14 @@ > return new ArrayTypeReference(TypeBinding.LONG.simpleName, dim, 0); > } > } >+ >+// allows us to trap completion & selection nodes >+public void aboutToResolve(Scope scope) { >+ // default implementation: do nothing >+} >+public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) { >+ return flowInfo; >+} > public void checkBounds(Scope scope) { > // only parameterized type references have bounds > } >@@ -106,96 +106,104 @@ > * @return char[][] > */ > public abstract char [][] getTypeName() ; >-public boolean isTypeReference() { >- return true; >-} >-public TypeBinding resolveSuperType(ClassScope scope) { >- // assumes the implementation of resolveType(ClassScope) will call back to detect cycles >- if (resolveType(scope) == null) return null; >- >- if (this.resolvedType.isTypeVariable()) { >- this.resolvedType = new ProblemReferenceBinding(getTypeName(), (ReferenceBinding) this.resolvedType, ProblemReasons.IllegalSuperTypeVariable); >- reportInvalidType(scope); >- return null; >- } >- return this.resolvedType; >-} >- >-public final TypeBinding resolveType(BlockScope blockScope) { >- return resolveType(blockScope, true /* checkbounds if any */); >-} > >-public TypeBinding resolveType(BlockScope scope, boolean checkBounds) { >+protected TypeBinding internalResolveType(Scope scope) { > // handle the error here > this.constant = Constant.NotAConstant; >- if (this.resolvedType != null) // is a shared type reference which was already resolved >- return this.resolvedType.isValidBinding() ? this.resolvedType : null; // already reported error >- >+ if (this.resolvedType != null) { // is a shared type reference which was already resolved >+ if (this.resolvedType.isValidBinding()) { >+ return this.resolvedType; >+ } else { >+ switch (this.resolvedType.problemId()) { >+ case ProblemReasons.NotFound : >+ case ProblemReasons.NotVisible : >+ TypeBinding type = this.resolvedType.closestMatch(); >+ if (type == null) return null; >+ return scope.environment().convertToRawType(type); >+ default : >+ return null; >+ } >+ } >+ } >+ boolean hasError; > TypeBinding type = this.resolvedType = getTypeBinding(scope); >- if (type == null) >+ if (type == null) { > return null; // detected cycle while resolving hierarchy >- if (!type.isValidBinding()) { >+ } else if ((hasError = !type.isValidBinding()) == true) { > reportInvalidType(scope); >- return null; >+ switch (type.problemId()) { >+ case ProblemReasons.NotFound : >+ case ProblemReasons.NotVisible : >+ type = type.closestMatch(); >+ if (type == null) return null; >+ break; >+ default : >+ return null; >+ } > } > if (type.isArrayType() && ((ArrayBinding) type).leafComponentType == TypeBinding.VOID) { > scope.problemReporter().cannotAllocateVoidArray(this); > return null; > } >- >- if (isTypeUseDeprecated(type, scope)) >+ if (isTypeUseDeprecated(type, scope)) { > reportDeprecatedType(type, scope); >- >+ } > type = scope.environment().convertToRawType(type); > if (type.leafComponentType().isRawType() > && (this.bits & ASTNode.IgnoreRawTypeCheck) == 0 >- && scope.compilerOptions().getSeverity(CompilerOptions.RawTypeReference) != ProblemSeverities.Ignore) { >+ && scope.compilerOptions().getSeverity(CompilerOptions.RawTypeReference) != ProblemSeverities.Ignore) { > scope.problemReporter().rawTypeReference(this, type); >- } >+ } >+ if (hasError) { >+ // do not store the computed type, keep the problem type instead >+ return type; >+ } > return this.resolvedType = type; > } >-public TypeBinding resolveType(ClassScope scope) { >- // handle the error here >- this.constant = Constant.NotAConstant; >- if (this.resolvedType != null) // is a shared type reference which was already resolved >- return this.resolvedType.isValidBinding() ? this.resolvedType : null; // already reported error >+public boolean isTypeReference() { >+ return true; >+} > >- TypeBinding type = this.resolvedType = getTypeBinding(scope); >- if (type == null) >- return null; // detected cycle while resolving hierarchy >- if (!type.isValidBinding()) { >- reportInvalidType(scope); >+protected void reportDeprecatedType(TypeBinding type, Scope scope) { >+ scope.problemReporter().deprecatedType(type, this); >+} >+ >+protected void reportInvalidType(Scope scope) { >+ scope.problemReporter().invalidType(this, this.resolvedType); >+} >+ >+public TypeBinding resolveSuperType(ClassScope scope) { >+ // assumes the implementation of resolveType(ClassScope) will call back to detect cycles >+ TypeBinding superType = resolveType(scope); >+ if (superType == null) return null; >+ >+ if (superType.isTypeVariable()) { >+ if (this.resolvedType.isValidBinding()) { >+ this.resolvedType = new ProblemReferenceBinding(getTypeName(), (ReferenceBinding)this.resolvedType, ProblemReasons.IllegalSuperTypeVariable); >+ reportInvalidType(scope); >+ } > return null; > } >- if (type.isArrayType() && ((ArrayBinding) type).leafComponentType == TypeBinding.VOID) { >- scope.problemReporter().cannotAllocateVoidArray(this); >- return null; >- } >- if (isTypeUseDeprecated(type, scope)) >- reportDeprecatedType(type, scope); >- >- type = scope.environment().convertToRawType(type); >- if (type.leafComponentType().isRawType() >- && (this.bits & ASTNode.IgnoreRawTypeCheck) == 0 >- && scope.compilerOptions().getSeverity(CompilerOptions.RawTypeReference) != ProblemSeverities.Ignore) { >- scope.problemReporter().rawTypeReference(this, type); >- } >- return this.resolvedType = type; >+ return superType; > } > >-public TypeBinding resolveTypeArgument(BlockScope blockScope, ReferenceBinding genericType, int rank) { >- return resolveType(blockScope, true /* check bounds*/); >+public final TypeBinding resolveType(BlockScope blockScope) { >+ return resolveType(blockScope, true /* checkbounds if any */); > } > >-public TypeBinding resolveTypeArgument(ClassScope classScope, ReferenceBinding genericType, int rank) { >- return resolveType(classScope); >+public TypeBinding resolveType(BlockScope scope, boolean checkBounds) { >+ return internalResolveType(scope); >+} >+ >+public TypeBinding resolveType(ClassScope scope) { >+ return internalResolveType(scope); > } > >-protected void reportInvalidType(Scope scope) { >- scope.problemReporter().invalidType(this, this.resolvedType); >+public TypeBinding resolveTypeArgument(BlockScope blockScope, ReferenceBinding genericType, int rank) { >+ return resolveType(blockScope, true /* check bounds*/); > } >-protected void reportDeprecatedType(TypeBinding type, Scope scope) { >- scope.problemReporter().deprecatedType(type, this); >+public TypeBinding resolveTypeArgument(ClassScope classScope, ReferenceBinding genericType, int rank) { >+ return resolveType(classScope); > } > public abstract void traverse(ASTVisitor visitor, BlockScope scope); > public abstract void traverse(ASTVisitor visitor, ClassScope scope); >Index: compiler/org/eclipse/jdt/internal/compiler/ast/ArrayTypeReference.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayTypeReference.java,v >retrieving revision 1.29 >diff -u -r1.29 ArrayTypeReference.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/ArrayTypeReference.java 10 May 2006 18:03:43 -0000 1.29 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/ArrayTypeReference.java 4 Dec 2007 16:31:30 -0000 >@@ -53,7 +53,9 @@ > } > protected TypeBinding getTypeBinding(Scope scope) { > >- if (this.resolvedType != null) return this.resolvedType; >+ if (this.resolvedType != null) { >+ return this.resolvedType; >+ } > if (dimensions > 255) { > scope.problemReporter().tooManyDimensions(this); > } >Index: compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java,v >retrieving revision 1.99 >diff -u -r1.99 SingleNameReference.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java 9 Nov 2007 08:42:33 -0000 1.99 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java 4 Dec 2007 16:31:33 -0000 >@@ -806,7 +806,7 @@ > constant = Constant.NotAConstant; > if (binding instanceof ProblemFieldBinding) { > scope.problemReporter().invalidField(this, (FieldBinding) binding); >- } else if (binding instanceof ProblemReferenceBinding) { >+ } else if (this.binding instanceof ProblemReferenceBinding || this.binding instanceof MissingTypeBinding) { > scope.problemReporter().invalidType(this, (TypeBinding) binding); > } else { > scope.problemReporter().unresolvableReference(this, binding); >Index: compiler/org/eclipse/jdt/internal/compiler/ast/JavadocImplicitTypeReference.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocImplicitTypeReference.java,v >retrieving revision 1.11 >diff -u -r1.11 JavadocImplicitTypeReference.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/JavadocImplicitTypeReference.java 6 Mar 2007 02:38:48 -0000 1.11 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/JavadocImplicitTypeReference.java 4 Dec 2007 16:31:31 -0000 >@@ -61,22 +61,51 @@ > * Resolves type on a Block, Class or CompilationUnit scope. > * We need to modify resoling behavior to avoid raw type creation. > */ >- private TypeBinding internalResolveType(Scope scope) { >+ protected TypeBinding internalResolveType(Scope scope) { > // handle the error here > this.constant = Constant.NotAConstant; >- if (this.resolvedType != null) // is a shared type reference which was already resolved >- return this.resolvedType.isValidBinding() ? this.resolvedType : null; // already reported error >- >- this.resolvedType = scope.enclosingSourceType(); >- if (this.resolvedType == null) >+ if (this.resolvedType != null) { // is a shared type reference which was already resolved >+ if (this.resolvedType.isValidBinding()) { >+ return this.resolvedType; >+ } else { >+ switch (this.resolvedType.problemId()) { >+ case ProblemReasons.NotFound : >+ case ProblemReasons.NotVisible : >+ TypeBinding type = this.resolvedType.closestMatch(); >+ return type; >+ default : >+ return null; >+ } >+ } >+ } >+ boolean hasError; >+ TypeBinding type = this.resolvedType = getTypeBinding(scope); >+ if (type == null) { > return null; // detected cycle while resolving hierarchy >- if (!this.resolvedType.isValidBinding()) { >+ } else if ((hasError = !type.isValidBinding())== true) { > reportInvalidType(scope); >+ switch (type.problemId()) { >+ case ProblemReasons.NotFound : >+ case ProblemReasons.NotVisible : >+ type = type.closestMatch(); >+ if (type == null) return null; >+ break; >+ default : >+ return null; >+ } >+ } >+ if (type.isArrayType() && ((ArrayBinding) type).leafComponentType == TypeBinding.VOID) { >+ scope.problemReporter().cannotAllocateVoidArray(this); > return null; > } >- if (isTypeUseDeprecated(this.resolvedType, scope)) >- reportDeprecatedType(this.resolvedType, scope); >- return this.resolvedType; >+ if (isTypeUseDeprecated(type, scope)) { >+ reportDeprecatedType(type, scope); >+ } >+ if (hasError) { >+ // do not store the computed type, keep the problem type instead >+ return type; >+ } >+ return this.resolvedType = type; > } > > protected void reportInvalidType(Scope scope) { >@@ -86,14 +115,6 @@ > scope.problemReporter().javadocDeprecatedType(type, this, scope.getDeclarationModifiers()); > } > >- public TypeBinding resolveType(BlockScope blockScope, boolean checkBounds) { >- return internalResolveType(blockScope); >- } >- >- public TypeBinding resolveType(ClassScope classScope) { >- return internalResolveType(classScope); >- } >- > public void traverse(ASTVisitor visitor, BlockScope scope) { > visitor.visit(this, scope); > visitor.endVisit(this, scope); >Index: compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java,v >retrieving revision 1.89 >diff -u -r1.89 ASTNode.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java 14 Nov 2007 12:06:31 -0000 1.89 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java 4 Dec 2007 16:31:30 -0000 >@@ -428,14 +428,15 @@ > */ > public final boolean isTypeUseDeprecated(TypeBinding type, Scope scope) { > >- if (type.isArrayType()) >+ if (type.isArrayType()) { > type = ((ArrayBinding) type).leafComponentType; >+ } > if (type.isBaseType()) > return false; > > ReferenceBinding refType = (ReferenceBinding) type; > // ignore references insing Javadoc comments >- if ((this.bits & ASTNode.InsideJavadoc) ==0 && >+ if ((this.bits & ASTNode.InsideJavadoc) == 0 && > (refType.isPrivate() || refType.isLocalType()) && !scope.isDefinedInType(refType)) { > // ignore cases where type is used from within inside itself > ((ReferenceBinding)refType.erasure()).modifiers |= ExtraCompilerModifiers.AccLocallyUsed; >Index: compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java,v >retrieving revision 1.71 >diff -u -r1.71 AllocationExpression.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java 21 Nov 2007 14:15:24 -0000 1.71 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java 4 Dec 2007 16:31:30 -0000 >@@ -241,7 +241,7 @@ > checkParameterizedAllocation: { > if (this.type instanceof ParameterizedQualifiedTypeReference) { // disallow new X<String>.Y<Integer>() > ReferenceBinding currentType = (ReferenceBinding)this.resolvedType; >- if (currentType == null) return null; >+ if (currentType == null) return currentType; > do { > // isStatic() is answering true for toplevel types > if ((currentType.modifiers & ClassFileConstants.AccStatic) != 0) break checkParameterizedAllocation; >@@ -262,7 +262,7 @@ > // resolve type arguments (for generic constructor call) > if (this.typeArguments != null) { > int length = this.typeArguments.length; >- boolean argHasError = false; // typeChecks all arguments >+ boolean argHasError = scope.compilerOptions().sourceLevel < ClassFileConstants.JDK1_5; > this.genericTypeArguments = new TypeBinding[length]; > for (int i = 0; i < length; i++) { > TypeReference typeReference = this.typeArguments[i]; >@@ -274,6 +274,11 @@ > } > } > if (argHasError) { >+ if (this.arguments != null) { // still attempt to resolve arguments >+ for (int i = 0, max = this.arguments.length; i < max; i++) { >+ this.arguments[i].resolveType(scope); >+ } >+ } > return null; > } > } >@@ -323,8 +328,9 @@ > return this.resolvedType; > } > } >- if (this.resolvedType == null) >+ if (this.resolvedType == null || !this.resolvedType.isValidBinding()) { > return null; >+ } > > // null type denotes fake allocation for enum constant inits > if (this.type != null && !this.resolvedType.canBeInstantiated()) { >@@ -333,8 +339,12 @@ > } > ReferenceBinding allocationType = (ReferenceBinding) this.resolvedType; > if (!(binding = scope.getConstructor(allocationType, argumentTypes, this)).isValidBinding()) { >- if (binding.declaringClass == null) >+ if (binding.declaringClass == null) { > binding.declaringClass = allocationType; >+ } >+ if (this.type != null && !this.type.resolvedType.isValidBinding()) { >+ return null; >+ } > scope.problemReporter().invalidConstructor(this, binding); > return this.resolvedType; > } >Index: compiler/org/eclipse/jdt/internal/compiler/ast/JavadocSingleTypeReference.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocSingleTypeReference.java,v >retrieving revision 1.21 >diff -u -r1.21 JavadocSingleTypeReference.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/JavadocSingleTypeReference.java 10 Apr 2007 19:03:10 -0000 1.21 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/JavadocSingleTypeReference.java 4 Dec 2007 16:31:31 -0000 >@@ -15,16 +15,17 @@ > import org.eclipse.jdt.internal.compiler.lookup.Binding; > import org.eclipse.jdt.internal.compiler.lookup.BlockScope; > import org.eclipse.jdt.internal.compiler.lookup.ClassScope; >+import org.eclipse.jdt.internal.compiler.lookup.InvocationSite; > import org.eclipse.jdt.internal.compiler.lookup.PackageBinding; > import org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding; >+import org.eclipse.jdt.internal.compiler.lookup.ProblemBinding; > import org.eclipse.jdt.internal.compiler.lookup.ProblemReasons; >-import org.eclipse.jdt.internal.compiler.lookup.ProblemReferenceBinding; > import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding; > import org.eclipse.jdt.internal.compiler.lookup.Scope; > import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; > > >-public class JavadocSingleTypeReference extends SingleTypeReference { >+public class JavadocSingleTypeReference extends SingleTypeReference implements InvocationSite { > > public int tagSourceStart, tagSourceEnd; > public PackageBinding packageBinding; >@@ -36,52 +37,50 @@ > this.bits |= ASTNode.InsideJavadoc; > } > >- protected void reportInvalidType(Scope scope) { >- scope.problemReporter().javadocInvalidType(this, this.resolvedType, scope.getDeclarationModifiers()); >- } >- protected void reportDeprecatedType(TypeBinding type, Scope scope) { >- scope.problemReporter().javadocDeprecatedType(type, this, scope.getDeclarationModifiers()); >- } >- >- /* (non-Javadoc) >- * Redefine to capture javadoc specific signatures >- * @see org.eclipse.jdt.internal.compiler.ast.ASTNode#traverse(org.eclipse.jdt.internal.compiler.ASTVisitor, org.eclipse.jdt.internal.compiler.lookup.BlockScope) >- */ >- public void traverse(ASTVisitor visitor, BlockScope scope) { >- visitor.visit(this, scope); >- visitor.endVisit(this, scope); >+ public TypeBinding[] genericTypeArguments() { >+ return null; > } >- >- public void traverse(ASTVisitor visitor, ClassScope scope) { >- visitor.visit(this, scope); >- visitor.endVisit(this, scope); >- } >- > /* > * We need to modify resolving behavior to handle package references > */ >- TypeBinding internalResolveType(Scope scope) { >+ protected TypeBinding internalResolveType(Scope scope) { > // handle the error here > this.constant = Constant.NotAConstant; >- if (this.resolvedType != null)// is a shared type reference which was already resolved >- return this.resolvedType.isValidBinding() ? this.resolvedType : null; // already reported error >- >- this.resolvedType = getTypeBinding(scope); >- if (!this.resolvedType.isValidBinding()) { >- char[][] tokens = { this.token }; >- Binding binding = scope.getTypeOrPackage(tokens); >- if (binding instanceof PackageBinding) { >- this.packageBinding = (PackageBinding) binding; >+ if (this.resolvedType != null) { // is a shared type reference which was already resolved >+ if (this.resolvedType.isValidBinding()) { >+ return this.resolvedType; > } else { >- if (this.resolvedType.problemId() == ProblemReasons.NonStaticReferenceInStaticContext) { >- ReferenceBinding closestMatch = ((ProblemReferenceBinding)this.resolvedType).closestMatch(); >- if (closestMatch != null && closestMatch.isTypeVariable()) { >- this.resolvedType = closestMatch; // ignore problem as we want report specific javadoc one instead >- return this.resolvedType; >- } >+ switch (this.resolvedType.problemId()) { >+ case ProblemReasons.NotFound : >+ case ProblemReasons.NotVisible : >+ TypeBinding type = this.resolvedType.closestMatch(); >+ return type; >+ default : >+ return null; >+ } >+ } >+ } >+ >+ Binding binding = scope.getBinding(this.token, Binding.TYPE|Binding.PACKAGE, this, true /*resolve*/); >+ if (binding instanceof PackageBinding) { >+ this.packageBinding = (PackageBinding) binding; >+ return null; >+ } else if (binding.isValidBinding()) { >+ this.resolvedType = (TypeBinding) binding; >+ } else { >+ if (binding instanceof ProblemBinding) { >+ binding = scope.getType(this.token); // expect to find a problem reference binding back >+ if (!(binding instanceof ReferenceBinding)) return null; // cannot report issue >+ } >+ this.resolvedType = (TypeBinding) binding; >+ if (this.resolvedType.problemId() == ProblemReasons.NonStaticReferenceInStaticContext) { >+ TypeBinding closestMatch = this.resolvedType.closestMatch(); >+ if (closestMatch != null && closestMatch.isTypeVariable()) { >+ this.resolvedType = closestMatch; // ignore problem as we want report specific javadoc one instead >+ return this.resolvedType; > } >- reportInvalidType(scope); > } >+ reportInvalidType(scope); > return null; > } > if (isTypeUseDeprecated(this.resolvedType, scope)) >@@ -92,15 +91,45 @@ > return this.resolvedType; > } > >+ public boolean isSuperAccess() { >+ return false; >+ } >+ >+ public boolean isTypeAccess() { >+ return false; >+ } >+ >+ protected void reportDeprecatedType(TypeBinding type, Scope scope) { >+ scope.problemReporter().javadocDeprecatedType(type, this, scope.getDeclarationModifiers()); >+ } >+ >+ protected void reportInvalidType(Scope scope) { >+ scope.problemReporter().javadocInvalidType(this, this.resolvedType, scope.getDeclarationModifiers()); >+ } >+ >+ public void setActualReceiverType(ReferenceBinding receiverType) { >+ // do nothing >+ } >+ >+ public void setDepth(int depth) { >+ // do nothing >+ } >+ >+ public void setFieldIndex(int depth) { >+ // do nothing >+ } >+ > /* (non-Javadoc) >- * @see org.eclipse.jdt.internal.compiler.ast.Expression#resolveType(org.eclipse.jdt.internal.compiler.lookup.BlockScope) >- * We need to override to handle package references >+ * Redefine to capture javadoc specific signatures >+ * @see org.eclipse.jdt.internal.compiler.ast.ASTNode#traverse(org.eclipse.jdt.internal.compiler.ASTVisitor, org.eclipse.jdt.internal.compiler.lookup.BlockScope) > */ >- public TypeBinding resolveType(BlockScope blockScope, boolean checkBounds) { >- return internalResolveType(blockScope); >+ public void traverse(ASTVisitor visitor, BlockScope scope) { >+ visitor.visit(this, scope); >+ visitor.endVisit(this, scope); > } > >- public TypeBinding resolveType(ClassScope classScope) { >- return internalResolveType(classScope); >+ public void traverse(ASTVisitor visitor, ClassScope scope) { >+ visitor.visit(this, scope); >+ visitor.endVisit(this, scope); > } > } >Index: compiler/org/eclipse/jdt/internal/compiler/ast/JavadocMessageSend.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocMessageSend.java,v >retrieving revision 1.33 >diff -u -r1.33 JavadocMessageSend.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/JavadocMessageSend.java 27 Apr 2007 15:51:38 -0000 1.33 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/JavadocMessageSend.java 4 Dec 2007 16:31:31 -0000 >@@ -129,6 +129,10 @@ > } > } > if (!this.binding.isValidBinding()) { >+ if (!this.receiver.resolvedType.isValidBinding()) { >+ // problem already got signaled on receiver, do not report secondary problem >+ return null; >+ } > if (this.binding.declaringClass == null) { > if (this.actualReceiverType instanceof ReferenceBinding) { > this.binding.declaringClass = (ReferenceBinding) this.actualReceiverType; >Index: compiler/org/eclipse/jdt/internal/compiler/ast/JavadocFieldReference.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocFieldReference.java,v >retrieving revision 1.25 >diff -u -r1.25 JavadocFieldReference.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/JavadocFieldReference.java 16 Nov 2007 13:53:36 -0000 1.25 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/JavadocFieldReference.java 4 Dec 2007 16:31:31 -0000 >@@ -68,6 +68,10 @@ > } > // When there's no valid field binding, try to resolve possible method reference without parenthesis > if (!fieldBinding.isValidBinding() || !(fieldBinding instanceof FieldBinding)) { >+ if (!this.receiver.resolvedType.isValidBinding()) { >+ // problem already got signaled on receiver, do not report secondary problem >+ return null; >+ } > if (this.receiverType instanceof ReferenceBinding) { > ReferenceBinding refBinding = (ReferenceBinding) this.receiverType; > MethodBinding[] methodBindings = refBinding.getMethods(this.token); >Index: compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.java,v >retrieving revision 1.45 >diff -u -r1.45 ParameterizedQualifiedTypeReference.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.java 9 May 2007 17:18:18 -0000 1.45 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.java 4 Dec 2007 16:31:31 -0000 >@@ -12,6 +12,7 @@ > > import org.eclipse.jdt.core.compiler.CharOperation; > import org.eclipse.jdt.internal.compiler.ASTVisitor; >+import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; > import org.eclipse.jdt.internal.compiler.impl.Constant; > import org.eclipse.jdt.internal.compiler.lookup.*; > >@@ -112,9 +113,22 @@ > // handle the error here > this.constant = Constant.NotAConstant; > if ((this.bits & ASTNode.DidResolve) != 0) { // is a shared type reference which was already resolved >- if (this.resolvedType != null && !this.resolvedType.isValidBinding()) >- return null; // already reported error >- return this.resolvedType; >+ if (this.resolvedType != null) { // is a shared type reference which was already resolved >+ if (this.resolvedType != null) { // is a shared type reference which was already resolved >+ if (this.resolvedType.isValidBinding()) { >+ return this.resolvedType; >+ } else { >+ switch (this.resolvedType.problemId()) { >+ case ProblemReasons.NotFound : >+ case ProblemReasons.NotVisible : >+ TypeBinding type = this.resolvedType.closestMatch(); >+ return type; >+ default : >+ return null; >+ } >+ } >+ } >+ } > } > this.bits |= ASTNode.DidResolve; > boolean isClassScope = scope.kind == Scope.CLASS_SCOPE; >@@ -210,8 +224,21 @@ > > TypeVariableBinding[] typeVariables = currentType.typeVariables(); > if (typeVariables == Binding.NO_TYPE_VARIABLES) { // check generic >- scope.problemReporter().nonGenericTypeCannotBeParameterized(i, this, currentType, argTypes); >- return null; >+ if (scope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5) { // below 1.5, already reported as syntax error >+ scope.problemReporter().nonGenericTypeCannotBeParameterized(i, this, currentType, argTypes); >+ } >+ if (i < max-1) { // intermediate token >+ return null; >+ } >+ this.resolvedType = (qualifiedType != null && qualifiedType.isParameterizedType()) >+ ? scope.environment().createParameterizedType(currentType, null, qualifiedType) >+ : currentType; >+ if (this.dimensions > 0) { >+ if (dimensions > 255) >+ scope.problemReporter().tooManyDimensions(this); >+ this.resolvedType = scope.createArrayType(this.resolvedType, dimensions); >+ } >+ return this.resolvedType; > } else if (argLength != typeVariables.length) { // check arity > scope.problemReporter().incorrectArityForParameterizedType(this, currentType, argTypes); > return null; >@@ -251,7 +278,6 @@ > reportDeprecatedType(qualifiedType, scope); > this.resolvedType = qualifiedType; > } >-// this.resolvedType = qualifiedType; > // array type ? > if (this.dimensions > 0) { > if (dimensions > 255) >Index: compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java,v >retrieving revision 1.42 >diff -u -r1.42 QualifiedTypeReference.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java 9 May 2007 17:18:18 -0000 1.42 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java 4 Dec 2007 16:31:32 -0000 >@@ -10,6 +10,7 @@ > *******************************************************************************/ > package org.eclipse.jdt.internal.compiler.ast; > >+import org.eclipse.jdt.core.compiler.CharOperation; > import org.eclipse.jdt.internal.compiler.ASTVisitor; > import org.eclipse.jdt.internal.compiler.lookup.*; > import org.eclipse.jdt.internal.compiler.problem.AbortCompilation; >@@ -41,11 +42,11 @@ > this.resolvedType = scope.getType(this.tokens[tokenIndex], packageBinding); > } else { > this.resolvedType = scope.getMemberType(this.tokens[tokenIndex], (ReferenceBinding) this.resolvedType); >- if (this.resolvedType instanceof ProblemReferenceBinding) { >+ if (!this.resolvedType.isValidBinding()) { > ProblemReferenceBinding problemBinding = (ProblemReferenceBinding) this.resolvedType; > this.resolvedType = new ProblemReferenceBinding( >- org.eclipse.jdt.core.compiler.CharOperation.subarray(this.tokens, 0, tokenIndex + 1), >- problemBinding.closestMatch(), >+ CharOperation.subarray(this.tokens, 0, tokenIndex + 1), >+ problemBinding.closestReferenceMatch(), > this.resolvedType.problemId()); > } > } >@@ -63,9 +64,9 @@ > } > protected TypeBinding getTypeBinding(Scope scope) { > >- if (this.resolvedType != null) >+ if (this.resolvedType != null) { > return this.resolvedType; >- >+ } > Binding binding = scope.getPackage(this.tokens); > if (binding != null && !binding.isValidBinding()) > return (ReferenceBinding) binding; // not found >Index: compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java,v >retrieving revision 1.113 >diff -u -r1.113 FieldReference.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java 9 Nov 2007 08:42:33 -0000 1.113 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java 4 Dec 2007 16:31:31 -0000 >@@ -528,7 +528,7 @@ > this.receiver.bits |= DisableUnnecessaryCastCheck; // will check later on > receiverCast = true; > } >- this.receiverType = receiver.resolveType(scope); >+ this.receiverType = this.receiver.resolveType(scope); > if (this.receiverType == null) { > constant = Constant.NotAConstant; > return null; >@@ -543,6 +543,10 @@ > FieldBinding fieldBinding = this.codegenBinding = this.binding = scope.getField(this.receiverType, token, this); > if (!fieldBinding.isValidBinding()) { > constant = Constant.NotAConstant; >+ if (!this.receiver.resolvedType.isValidBinding()) { >+ // problem already got signaled on receiver, do not report secondary problem >+ return null; >+ } > scope.problemReporter().invalidField(this, this.receiverType); > return null; > } >Index: compiler/org/eclipse/jdt/internal/compiler/ast/SingleTypeReference.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleTypeReference.java,v >retrieving revision 1.28 >diff -u -r1.28 SingleTypeReference.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/SingleTypeReference.java 10 May 2007 16:05:23 -0000 1.28 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/SingleTypeReference.java 4 Dec 2007 16:31:33 -0000 >@@ -59,12 +59,15 @@ > } > > public TypeBinding resolveTypeEnclosing(BlockScope scope, ReferenceBinding enclosingType) { >- >- TypeBinding memberType = scope.getMemberType(token, enclosingType); >+ TypeBinding memberType = this.resolvedType = scope.getMemberType(token, enclosingType); >+ boolean hasError = false; > if (!memberType.isValidBinding()) { >- this.resolvedType = memberType; >+ hasError = true; > scope.problemReporter().invalidEnclosingType(this, memberType, enclosingType); >- return null; >+ memberType = ((ReferenceBinding)memberType).closestMatch(); >+ if (memberType == null) { >+ return null; >+ } > } > if (isTypeUseDeprecated(memberType, scope)) > scope.problemReporter().deprecatedType(memberType, this); >@@ -74,6 +77,10 @@ > && scope.compilerOptions().getSeverity(CompilerOptions.RawTypeReference) != ProblemSeverities.Ignore){ > scope.problemReporter().rawTypeReference(this, memberType); > } >+ if (hasError) { >+ // do not store the computed type, keep the problem type instead >+ return memberType; >+ } > return this.resolvedType = memberType; > } > >Index: compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.java,v >retrieving revision 1.40 >diff -u -r1.40 ParameterizedSingleTypeReference.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.java 9 May 2007 17:18:18 -0000 1.40 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.java 4 Dec 2007 16:31:31 -0000 >@@ -12,6 +12,7 @@ > > import org.eclipse.jdt.core.compiler.CharOperation; > import org.eclipse.jdt.internal.compiler.ASTVisitor; >+import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; > import org.eclipse.jdt.internal.compiler.impl.Constant; > import org.eclipse.jdt.internal.compiler.lookup.*; > >@@ -89,9 +90,20 @@ > // handle the error here > this.constant = Constant.NotAConstant; > if ((this.bits & ASTNode.DidResolve) != 0) { // is a shared type reference which was already resolved >- if (this.resolvedType != null && !this.resolvedType.isValidBinding()) >- return null; // already reported error >- return this.resolvedType; >+ if (this.resolvedType != null) { // is a shared type reference which was already resolved >+ if (this.resolvedType.isValidBinding()) { >+ return this.resolvedType; >+ } else { >+ switch (this.resolvedType.problemId()) { >+ case ProblemReasons.NotFound : >+ case ProblemReasons.NotVisible : >+ TypeBinding type = this.resolvedType.closestMatch(); >+ return type; >+ default : >+ return null; >+ } >+ } >+ } > } > this.bits |= ASTNode.DidResolve; > if (enclosingType == null) { >@@ -159,8 +171,17 @@ > > TypeVariableBinding[] typeVariables = currentType.typeVariables(); > if (typeVariables == Binding.NO_TYPE_VARIABLES) { // check generic >- scope.problemReporter().nonGenericTypeCannotBeParameterized(this, currentType, argTypes); >- return null; >+ if (scope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5) { // below 1.5, already reported as syntax error >+ scope.problemReporter().nonGenericTypeCannotBeParameterized(0, this, currentType, argTypes); >+ } >+ this.resolvedType = currentType; >+ // array type ? >+ if (this.dimensions > 0) { >+ if (dimensions > 255) >+ scope.problemReporter().tooManyDimensions(this); >+ this.resolvedType = scope.createArrayType(this.resolvedType, dimensions); >+ } >+ return this.resolvedType; > } else if (argLength != typeVariables.length) { // check arity > scope.problemReporter().incorrectArityForParameterizedType(this, currentType, argTypes); > return null; >@@ -175,9 +196,9 @@ > > ParameterizedTypeBinding parameterizedType = scope.environment().createParameterizedType((ReferenceBinding)currentType.erasure(), argTypes, enclosingType); > // check argument type compatibility >- if (checkBounds) // otherwise will do it in Scope.connectTypeVariables() or generic method resolution >+ if (checkBounds) { // otherwise will do it in Scope.connectTypeVariables() or generic method resolution > parameterizedType.boundCheck(scope, this.typeArguments); >- >+ } > this.resolvedType = parameterizedType; > if (isTypeUseDeprecated(this.resolvedType, scope)) > reportDeprecatedType(this.resolvedType, scope); >Index: compiler/org/eclipse/jdt/internal/compiler/ast/Argument.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Argument.java,v >retrieving revision 1.60 >diff -u -r1.60 Argument.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/Argument.java 24 Sep 2007 22:49:54 -0000 1.60 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/Argument.java 4 Dec 2007 16:31:30 -0000 >@@ -125,7 +125,7 @@ > } > break; > } >- if (exceptionType.findSuperTypeOriginatingFrom(TypeIds.T_JavaLangThrowable, true) == null) { >+ if (exceptionType.findSuperTypeOriginatingFrom(TypeIds.T_JavaLangThrowable, true) == null && exceptionType.isValidBinding()) { > scope.problemReporter().cannotThrowType(this.type, exceptionType); > hasError = true; > // fall thru to create the variable - avoids additional errors because the variable is missing >Index: compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java,v >retrieving revision 1.86 >diff -u -r1.86 QualifiedAllocationExpression.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java 21 Nov 2007 14:15:24 -0000 1.86 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java 4 Dec 2007 16:31:32 -0000 >@@ -256,7 +256,7 @@ > } else { > receiverType = this.type.resolveType(scope, true /* check bounds*/); > checkParameterizedAllocation: { >- if (receiverType == null) break checkParameterizedAllocation; >+ if (receiverType == null || !receiverType.isValidBinding()) break checkParameterizedAllocation; > if (this.type instanceof ParameterizedQualifiedTypeReference) { // disallow new X<String>.Y<Integer>() > ReferenceBinding currentType = (ReferenceBinding)receiverType; > do { >@@ -275,23 +275,31 @@ > } > } > } >- if (receiverType == null) { >+ if (receiverType == null || !receiverType.isValidBinding()) { > hasError = true; > } >+ > // resolve type arguments (for generic constructor call) > if (this.typeArguments != null) { > int length = this.typeArguments.length; >+ boolean argHasError = scope.compilerOptions().sourceLevel < ClassFileConstants.JDK1_5; > this.genericTypeArguments = new TypeBinding[length]; > for (int i = 0; i < length; i++) { >- TypeReference typeReference = this.typeArguments[i]; >- TypeBinding argType = typeReference.resolveType(scope, true /* check bounds*/); >- if (argType == null) { >- if (typeReference instanceof Wildcard) { >- scope.problemReporter().illegalUsageOfWildcard(typeReference); >- } >- return null; // error already reported >+ TypeReference typeReference = this.typeArguments[i]; >+ if ((this.genericTypeArguments[i] = typeReference.resolveType(scope, true /* check bounds*/)) == null) { >+ argHasError = true; >+ } >+ if (argHasError && typeReference instanceof Wildcard) { >+ scope.problemReporter().illegalUsageOfWildcard(typeReference); > } >- this.genericTypeArguments[i] = argType; >+ } >+ if (argHasError) { >+ if (this.arguments != null) { // still attempt to resolve arguments >+ for (int i = 0, max = this.arguments.length; i < max; i++) { >+ this.arguments[i].resolveType(scope); >+ } >+ } >+ return null; > } > } > >@@ -311,32 +319,37 @@ > } > } > } >+ > // limit of fault-tolerance > if (hasError) { > if (receiverType instanceof ReferenceBinding) { > ReferenceBinding referenceReceiver = (ReferenceBinding) receiverType; >- // record a best guess, for clients who need hint about possible contructor match >- int length = this.arguments == null ? 0 : this.arguments.length; >- TypeBinding[] pseudoArgs = new TypeBinding[length]; >- for (int i = length; --i >= 0;) { >- pseudoArgs[i] = argumentTypes[i] == null ? TypeBinding.NULL : argumentTypes[i]; // replace args with errors with null type >- } >- this.binding = scope.findMethod(referenceReceiver, TypeConstants.INIT, pseudoArgs, this); >- if (this.binding != null && !this.binding.isValidBinding()) { >- MethodBinding closestMatch = ((ProblemMethodBinding)this.binding).closestMatch; >- // record the closest match, for clients who may still need hint about possible method match >- if (closestMatch != null) { >- if (closestMatch.original().typeVariables != Binding.NO_TYPE_VARIABLES) { // generic method >- // shouldn't return generic method outside its context, rather convert it to raw method (175409) >- closestMatch = scope.environment().createParameterizedGenericMethod(closestMatch.original(), (RawTypeBinding)null); >- } >- this.binding = closestMatch; >- MethodBinding closestMatchOriginal = closestMatch.original(); >- if ((closestMatchOriginal.isPrivate() || closestMatchOriginal.declaringClass.isLocalType()) && !scope.isDefinedInMethod(closestMatchOriginal)) { >- // ignore cases where method is used from within inside itself (e.g. direct recursions) >- closestMatchOriginal.modifiers |= ExtraCompilerModifiers.AccLocallyUsed; >+ if (receiverType.isValidBinding()) { >+ // record a best guess, for clients who need hint about possible contructor match >+ int length = this.arguments == null ? 0 : this.arguments.length; >+ TypeBinding[] pseudoArgs = new TypeBinding[length]; >+ for (int i = length; --i >= 0;) { >+ pseudoArgs[i] = argumentTypes[i] == null ? TypeBinding.NULL : argumentTypes[i]; // replace args with errors with null type >+ } >+ this.binding = scope.findMethod(referenceReceiver, TypeConstants.INIT, pseudoArgs, this); >+ if (this.binding != null && !this.binding.isValidBinding()) { >+ MethodBinding closestMatch = ((ProblemMethodBinding)this.binding).closestMatch; >+ // record the closest match, for clients who may still need hint about possible method match >+ if (closestMatch != null) { >+ if (closestMatch.original().typeVariables != Binding.NO_TYPE_VARIABLES) { // generic method >+ // shouldn't return generic method outside its context, rather convert it to raw method (175409) >+ closestMatch = scope.environment().createParameterizedGenericMethod(closestMatch.original(), (RawTypeBinding)null); >+ } >+ this.binding = closestMatch; >+ MethodBinding closestMatchOriginal = closestMatch.original(); >+ if ((closestMatchOriginal.isPrivate() || closestMatchOriginal.declaringClass.isLocalType()) && !scope.isDefinedInMethod(closestMatchOriginal)) { >+ // ignore cases where method is used from within inside itself (e.g. direct recursions) >+ closestMatchOriginal.modifiers |= ExtraCompilerModifiers.AccLocallyUsed; >+ } > } > } >+ } else { >+ return null; > } > if (this.anonymousType != null) { > // insert anonymous type in scope (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=210070) >@@ -366,6 +379,10 @@ > if (this.binding.declaringClass == null) { > this.binding.declaringClass = allocationType; > } >+ if (this.type != null && !this.type.resolvedType.isValidBinding()) { >+ // problem already got signaled on type reference, do not report secondary problem >+ return null; >+ } > scope.problemReporter().invalidConstructor(this, this.binding); > return this.resolvedType = receiverType; > } >@@ -383,7 +400,7 @@ > } > ReferenceBinding superType = (ReferenceBinding) receiverType; > if (superType.isTypeVariable()) { >- superType = new ProblemReferenceBinding(superType.sourceName(), superType, ProblemReasons.IllegalSuperTypeVariable); >+ superType = new ProblemReferenceBinding(new char[][]{superType.sourceName()}, superType, ProblemReasons.IllegalSuperTypeVariable); > scope.problemReporter().invalidType(this, superType); > return null; > } else if (this.type != null && superType.isEnum()) { // tolerate enum constant body >@@ -407,6 +424,10 @@ > if (inheritedBinding.declaringClass == null) { > inheritedBinding.declaringClass = anonymousSuperclass; > } >+ if (this.type != null && !this.type.resolvedType.isValidBinding()) { >+ // problem already got signaled on type reference, do not report secondary problem >+ return null; >+ } > scope.problemReporter().invalidConstructor(this, inheritedBinding); > return this.resolvedType; > } >Index: compiler/org/eclipse/jdt/internal/compiler/ast/Annotation.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Annotation.java,v >retrieving revision 1.60 >diff -u -r1.60 Annotation.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/Annotation.java 21 Nov 2007 17:54:33 -0000 1.60 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/Annotation.java 4 Dec 2007 16:31:30 -0000 >@@ -235,7 +235,9 @@ > this.resolvedType = typeBinding; > // ensure type refers to an annotation type > if (!typeBinding.isAnnotationType()) { >- scope.problemReporter().typeMismatchError(typeBinding, scope.getJavaLangAnnotationAnnotation(), this.type); >+ if (typeBinding.isValidBinding()) { >+ scope.problemReporter().typeMismatchError(typeBinding, scope.getJavaLangAnnotationAnnotation(), this.type); >+ } > return null; > } > >Index: compiler/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java,v >retrieving revision 1.70 >diff -u -r1.70 SwitchStatement.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java 21 Nov 2006 15:42:02 -0000 1.70 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java 4 Dec 2007 16:31:33 -0000 >@@ -273,7 +273,10 @@ > if (expressionType != null) { > expression.computeConversion(upperScope, expressionType, expressionType); > checkType: { >- if (expressionType.isBaseType()) { >+ if (!expressionType.isValidBinding()) { >+ expressionType = null; // fault-tolerance: ignore type mismatch from constants from hereon >+ break checkType; >+ } else if (expressionType.isBaseType()) { > if (expression.isConstantValueOfTypeAssignableToType(expressionType, TypeBinding.INT)) > break checkType; > if (expressionType.isCompatibleWith(TypeBinding.INT)) >Index: compiler/org/eclipse/jdt/internal/compiler/ast/JavadocQualifiedTypeReference.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocQualifiedTypeReference.java,v >retrieving revision 1.18 >diff -u -r1.18 JavadocQualifiedTypeReference.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/JavadocQualifiedTypeReference.java 10 Apr 2007 19:03:10 -0000 1.18 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/JavadocQualifiedTypeReference.java 4 Dec 2007 16:31:31 -0000 >@@ -33,26 +33,6 @@ > this.bits |= ASTNode.InsideJavadoc; > } > >- protected void reportInvalidType(Scope scope) { >- scope.problemReporter().javadocInvalidType(this, this.resolvedType, scope.getDeclarationModifiers()); >- } >- protected void reportDeprecatedType(TypeBinding type, Scope scope) { >- scope.problemReporter().javadocDeprecatedType(type, this, scope.getDeclarationModifiers()); >- } >- >- /* (non-Javadoc) >- * Redefine to capture javadoc specific signatures >- * @see org.eclipse.jdt.internal.compiler.ast.ASTNode#traverse(org.eclipse.jdt.internal.compiler.ASTVisitor, org.eclipse.jdt.internal.compiler.lookup.BlockScope) >- */ >- public void traverse(ASTVisitor visitor, BlockScope scope) { >- visitor.visit(this, scope); >- visitor.endVisit(this, scope); >- } >- public void traverse(ASTVisitor visitor, ClassScope scope) { >- visitor.visit(this, scope); >- visitor.endVisit(this, scope); >- } >- > /* > * We need to modify resolving behavior to handle package references > */ >@@ -60,10 +40,10 @@ > // handle the error here > this.constant = Constant.NotAConstant; > if (this.resolvedType != null) // is a shared type reference which was already resolved >- return this.resolvedType.isValidBinding() ? this.resolvedType : null; // already reported error >+ return this.resolvedType.isValidBinding() ? this.resolvedType : this.resolvedType.closestMatch(); // already reported error > >- this.resolvedType = getTypeBinding(scope); >- if (!this.resolvedType.isValidBinding()) { >+ TypeBinding type = this.resolvedType = getTypeBinding(scope); >+ if (!type.isValidBinding()) { > Binding binding = scope.getTypeOrPackage(this.tokens); > if (binding instanceof PackageBinding) { > this.packageBinding = (PackageBinding) binding; >@@ -72,14 +52,20 @@ > } > return null; > } >- if (isTypeUseDeprecated(this.resolvedType, scope)) >- reportDeprecatedType(this.resolvedType, scope); >- if (this.resolvedType instanceof ParameterizedTypeBinding) { >- this.resolvedType = ((ParameterizedTypeBinding)this.resolvedType).genericType(); >+ if (isTypeUseDeprecated(type, scope)) >+ reportDeprecatedType(type, scope); >+ if (type instanceof ParameterizedTypeBinding) { >+ this.resolvedType = ((ParameterizedTypeBinding)type).genericType(); > } > return this.resolvedType; > } >+ protected void reportDeprecatedType(TypeBinding type, Scope scope) { >+ scope.problemReporter().javadocDeprecatedType(type, this, scope.getDeclarationModifiers()); >+ } > >+ protected void reportInvalidType(Scope scope) { >+ scope.problemReporter().javadocInvalidType(this, this.resolvedType, scope.getDeclarationModifiers()); >+ } > public TypeBinding resolveType(BlockScope blockScope, boolean checkBounds) { > return internalResolveType(blockScope, checkBounds); > } >@@ -87,4 +73,18 @@ > public TypeBinding resolveType(ClassScope classScope) { > return internalResolveType(classScope, false); > } >+ >+ /* (non-Javadoc) >+ * Redefine to capture javadoc specific signatures >+ * @see org.eclipse.jdt.internal.compiler.ast.ASTNode#traverse(org.eclipse.jdt.internal.compiler.ASTVisitor, org.eclipse.jdt.internal.compiler.lookup.BlockScope) >+ */ >+ public void traverse(ASTVisitor visitor, BlockScope scope) { >+ visitor.visit(this, scope); >+ visitor.endVisit(this, scope); >+ } >+ >+ public void traverse(ASTVisitor visitor, ClassScope scope) { >+ visitor.visit(this, scope); >+ visitor.endVisit(this, scope); >+ } > } >Index: compiler/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java,v >retrieving revision 1.62 >diff -u -r1.62 ExplicitConstructorCall.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java 2 Nov 2007 11:23:38 -0000 1.62 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java 4 Dec 2007 16:31:30 -0000 >@@ -12,9 +12,25 @@ > > import org.eclipse.jdt.internal.compiler.ASTVisitor; > import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; >-import org.eclipse.jdt.internal.compiler.codegen.*; >-import org.eclipse.jdt.internal.compiler.flow.*; >-import org.eclipse.jdt.internal.compiler.lookup.*; >+import org.eclipse.jdt.internal.compiler.codegen.CodeStream; >+import org.eclipse.jdt.internal.compiler.flow.FlowContext; >+import org.eclipse.jdt.internal.compiler.flow.FlowInfo; >+import org.eclipse.jdt.internal.compiler.lookup.Binding; >+import org.eclipse.jdt.internal.compiler.lookup.BlockScope; >+import org.eclipse.jdt.internal.compiler.lookup.ExtraCompilerModifiers; >+import org.eclipse.jdt.internal.compiler.lookup.InvocationSite; >+import org.eclipse.jdt.internal.compiler.lookup.LocalTypeBinding; >+import org.eclipse.jdt.internal.compiler.lookup.MethodBinding; >+import org.eclipse.jdt.internal.compiler.lookup.MethodScope; >+import org.eclipse.jdt.internal.compiler.lookup.ProblemMethodBinding; >+import org.eclipse.jdt.internal.compiler.lookup.RawTypeBinding; >+import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding; >+import org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding; >+import org.eclipse.jdt.internal.compiler.lookup.TagBits; >+import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; >+import org.eclipse.jdt.internal.compiler.lookup.TypeConstants; >+import org.eclipse.jdt.internal.compiler.lookup.TypeIds; >+import org.eclipse.jdt.internal.compiler.lookup.VariableBinding; > > public class ExplicitConstructorCall extends Statement implements InvocationSite { > >@@ -40,39 +56,35 @@ > this.accessMode = accessMode; > } > >- public FlowInfo analyseCode( >- BlockScope currentScope, >- FlowContext flowContext, >- FlowInfo flowInfo) { >- >+ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) { > // must verify that exceptions potentially thrown by this expression are caught in the method. > > try { > ((MethodScope) currentScope).isConstructorCall = true; > > // process enclosing instance >- if (qualification != null) { >+ if (this.qualification != null) { > flowInfo = >- qualification >+ this.qualification > .analyseCode(currentScope, flowContext, flowInfo) > .unconditionalInits(); > } > // process arguments >- if (arguments != null) { >- for (int i = 0, max = arguments.length; i < max; i++) { >+ if (this.arguments != null) { >+ for (int i = 0, max = this.arguments.length; i < max; i++) { > flowInfo = >- arguments[i] >+ this.arguments[i] > .analyseCode(currentScope, flowContext, flowInfo) > .unconditionalInits(); > } > } > > ReferenceBinding[] thrownExceptions; >- if ((thrownExceptions = binding.thrownExceptions) != Binding.NO_EXCEPTIONS) { >+ if ((thrownExceptions = this.binding.thrownExceptions) != Binding.NO_EXCEPTIONS) { > // check exceptions > flowContext.checkExceptionHandlers( > thrownExceptions, >- (accessMode == ImplicitSuper) >+ (this.accessMode == ExplicitConstructorCall.ImplicitSuper) > ? (ASTNode) currentScope.methodScope().referenceContext > : (ASTNode) this, > flowInfo, >@@ -93,8 +105,7 @@ > * @param codeStream org.eclipse.jdt.internal.compiler.codegen.CodeStream > */ > public void generateCode(BlockScope currentScope, CodeStream codeStream) { >- >- if ((bits & IsReachable) == 0) { >+ if ((this.bits & ASTNode.IsReachable) == 0) { > return; > } > try { >@@ -106,7 +117,7 @@ > ReferenceBinding targetType = this.codegenBinding.declaringClass; > > // special name&ordinal argument generation for enum constructors >- if (targetType.erasure().id == T_JavaLangEnum || targetType.isEnum()) { >+ if (targetType.erasure().id == TypeIds.T_JavaLangEnum || targetType.isEnum()) { > codeStream.aload_1(); // pass along name param as name arg > codeStream.iload_2(); // pass along ordinal param as ordinal arg > } >@@ -116,11 +127,11 @@ > codeStream.generateSyntheticEnclosingInstanceValues( > currentScope, > targetType, >- (this.bits & ASTNode.DiscardEnclosingInstance) != 0 ? null : qualification, >+ (this.bits & ASTNode.DiscardEnclosingInstance) != 0 ? null : this.qualification, > this); > } > // generate arguments >- generateArguments(binding, arguments, currentScope, codeStream); >+ generateArguments(this.binding, this.arguments, currentScope, codeStream); > > // handling innerclass instance allocation - outer local arguments > if (targetType.isNestedType()) { >@@ -129,15 +140,15 @@ > targetType, > this); > } >- if (syntheticAccessor != null) { >+ if (this.syntheticAccessor != null) { > // synthetic accessor got some extra arguments appended to its signature, which need values > for (int i = 0, >- max = syntheticAccessor.parameters.length - this.codegenBinding.parameters.length; >+ max = this.syntheticAccessor.parameters.length - this.codegenBinding.parameters.length; > i < max; > i++) { > codeStream.aconst_null(); > } >- codeStream.invokespecial(syntheticAccessor); >+ codeStream.invokespecial(this.syntheticAccessor); > } else { > codeStream.invokespecial(this.codegenBinding); > } >@@ -146,25 +157,23 @@ > ((MethodScope) currentScope).isConstructorCall = false; > } > } >+ > /** > * @see org.eclipse.jdt.internal.compiler.lookup.InvocationSite#genericTypeArguments() > */ > public TypeBinding[] genericTypeArguments() { > return this.genericTypeArguments; > } >+ > public boolean isImplicitSuper() { >- //return true if I'm of these compiler added statement super(); >- >- return (accessMode == ImplicitSuper); >+ return (this.accessMode == ExplicitConstructorCall.ImplicitSuper); > } > > public boolean isSuperAccess() { >- >- return accessMode != This; >+ return this.accessMode != ExplicitConstructorCall.This; > } > > public boolean isTypeAccess() { >- > return true; > } > >@@ -176,7 +185,7 @@ > * exact need. > */ > void manageEnclosingInstanceAccessIfNecessary(BlockScope currentScope, FlowInfo flowInfo) { >- ReferenceBinding superTypeErasure = (ReferenceBinding) binding.declaringClass.erasure(); >+ ReferenceBinding superTypeErasure = (ReferenceBinding) this.binding.declaringClass.erasure(); > > if ((flowInfo.tagBits & FlowInfo.UNREACHABLE) == 0) { > // perform some emulation work in case there is some and we are inside a local type only >@@ -184,59 +193,57 @@ > && currentScope.enclosingSourceType().isLocalType()) { > > if (superTypeErasure.isLocalType()) { >- ((LocalTypeBinding) superTypeErasure).addInnerEmulationDependent(currentScope, qualification != null); >+ ((LocalTypeBinding) superTypeErasure).addInnerEmulationDependent(currentScope, this.qualification != null); > } else { > // locally propagate, since we already now the desired shape for sure >- currentScope.propagateInnerEmulation(superTypeErasure, qualification != null); >+ currentScope.propagateInnerEmulation(superTypeErasure, this.qualification != null); > } > } > } > } > > public void manageSyntheticAccessIfNecessary(BlockScope currentScope, FlowInfo flowInfo) { >- > if ((flowInfo.tagBits & FlowInfo.UNREACHABLE) == 0) { >- // if constructor from parameterized type got found, use the original constructor at codegen time >- this.codegenBinding = this.binding.original(); >- >- // perform some emulation work in case there is some and we are inside a local type only >- if (binding.isPrivate() && accessMode != This) { >- ReferenceBinding declaringClass = this.codegenBinding.declaringClass; >- // from 1.4 on, local type constructor can lose their private flag to ease emulation >- if ((declaringClass.tagBits & TagBits.IsLocalType) != 0 && currentScope.compilerOptions().complianceLevel >= ClassFileConstants.JDK1_4) { >- // constructor will not be dumped as private, no emulation required thus >- this.codegenBinding.tagBits |= TagBits.ClearPrivateModifier; >- } else { >- syntheticAccessor = ((SourceTypeBinding) declaringClass).addSyntheticMethod(this.codegenBinding, isSuperAccess()); >- currentScope.problemReporter().needToEmulateMethodAccess(this.codegenBinding, this); >+ // if constructor from parameterized type got found, use the original constructor at codegen time >+ this.codegenBinding = this.binding.original(); >+ >+ // perform some emulation work in case there is some and we are inside a local type only >+ if (this.binding.isPrivate() && this.accessMode != ExplicitConstructorCall.This) { >+ ReferenceBinding declaringClass = this.codegenBinding.declaringClass; >+ // from 1.4 on, local type constructor can lose their private flag to ease emulation >+ if ((declaringClass.tagBits & TagBits.IsLocalType) != 0 && currentScope.compilerOptions().complianceLevel >= ClassFileConstants.JDK1_4) { >+ // constructor will not be dumped as private, no emulation required thus >+ this.codegenBinding.tagBits |= TagBits.ClearPrivateModifier; >+ } else { >+ this.syntheticAccessor = ((SourceTypeBinding) declaringClass).addSyntheticMethod(this.codegenBinding, isSuperAccess()); >+ currentScope.problemReporter().needToEmulateMethodAccess(this.codegenBinding, this); >+ } > } > } >- } > } > > public StringBuffer printStatement(int indent, StringBuffer output) { >- > printIndent(indent, output); >- if (qualification != null) qualification.printExpression(0, output).append('.'); >- if (typeArguments != null) { >+ if (this.qualification != null) this.qualification.printExpression(0, output).append('.'); >+ if (this.typeArguments != null) { > output.append('<'); >- int max = typeArguments.length - 1; >+ int max = this.typeArguments.length - 1; > for (int j = 0; j < max; j++) { >- typeArguments[j].print(0, output); >+ this.typeArguments[j].print(0, output); > output.append(", ");//$NON-NLS-1$ > } >- typeArguments[max].print(0, output); >+ this.typeArguments[max].print(0, output); > output.append('>'); > } >- if (accessMode == This) { >+ if (this.accessMode == ExplicitConstructorCall.This) { > output.append("this("); //$NON-NLS-1$ > } else { > output.append("super("); //$NON-NLS-1$ > } >- if (arguments != null) { >- for (int i = 0; i < arguments.length; i++) { >+ if (this.arguments != null) { >+ for (int i = 0; i < this.arguments.length; i++) { > if (i > 0) output.append(", "); //$NON-NLS-1$ >- arguments[i].printExpression(0, output); >+ this.arguments[i].printExpression(0, output); > } > } > return output.append(");"); //$NON-NLS-1$ >@@ -273,38 +280,42 @@ > } > methodScope.isConstructorCall = true; > ReferenceBinding receiverType = scope.enclosingReceiverType(); >- if (accessMode != This) >+ boolean rcvHasError = false; >+ if (this.accessMode != ExplicitConstructorCall.This) { > receiverType = receiverType.superclass(); >- >- if (receiverType == null) { >- return; >+ TypeReference superclassRef = scope.referenceType().superclass; >+ if (superclassRef != null && superclassRef.resolvedType != null && !superclassRef.resolvedType.isValidBinding()) { >+ rcvHasError = true; >+ } > } >- // prevent (explicit) super constructor invocation from within enum >- if (this.accessMode == Super && receiverType.erasure().id == T_JavaLangEnum) { >- scope.problemReporter().cannotInvokeSuperConstructorInEnum(this, methodScope.referenceMethod().binding); >- } >- // qualification should be from the type of the enclosingType >- if (qualification != null) { >- if (accessMode != Super) { >- scope.problemReporter().unnecessaryEnclosingInstanceSpecification( >- qualification, >- receiverType); >- } >- ReferenceBinding enclosingType = receiverType.enclosingType(); >- if (enclosingType == null) { >- scope.problemReporter().unnecessaryEnclosingInstanceSpecification( >- qualification, >- receiverType); >- this.bits |= ASTNode.DiscardEnclosingInstance; >- } else { >- TypeBinding qTb = qualification.resolveTypeExpecting(scope, enclosingType); >- qualification.computeConversion(scope, qTb, qTb); >+ if (receiverType != null) { >+ // prevent (explicit) super constructor invocation from within enum >+ if (this.accessMode == ExplicitConstructorCall.Super && receiverType.erasure().id == TypeIds.T_JavaLangEnum) { >+ scope.problemReporter().cannotInvokeSuperConstructorInEnum(this, methodScope.referenceMethod().binding); >+ } >+ // qualification should be from the type of the enclosingType >+ if (this.qualification != null) { >+ if (this.accessMode != ExplicitConstructorCall.Super) { >+ scope.problemReporter().unnecessaryEnclosingInstanceSpecification( >+ this.qualification, >+ receiverType); >+ } >+ if (!rcvHasError) { >+ ReferenceBinding enclosingType = receiverType.enclosingType(); >+ if (enclosingType == null) { >+ scope.problemReporter().unnecessaryEnclosingInstanceSpecification(this.qualification, receiverType); >+ this.bits |= ASTNode.DiscardEnclosingInstance; >+ } else { >+ TypeBinding qTb = this.qualification.resolveTypeExpecting(scope, enclosingType); >+ this.qualification.computeConversion(scope, qTb, qTb); >+ } >+ } > } > } > // resolve type arguments (for generic constructor call) > if (this.typeArguments != null) { >+ boolean argHasError = scope.compilerOptions().sourceLevel < ClassFileConstants.JDK1_5; > int length = this.typeArguments.length; >- boolean argHasError = false; // typeChecks all arguments > this.genericTypeArguments = new TypeBinding[length]; > for (int i = 0; i < length; i++) { > TypeReference typeReference = this.typeArguments[i]; >@@ -316,21 +327,25 @@ > } > } > if (argHasError) { >+ if (this.arguments != null) { // still attempt to resolve arguments >+ for (int i = 0, max = this.arguments.length; i < max; i++) { >+ this.arguments[i].resolveType(scope); >+ } >+ } > return; > } > } >- > // arguments buffering for the method lookup > TypeBinding[] argumentTypes = Binding.NO_PARAMETERS; > boolean argsContainCast = false; >- if (arguments != null) { >+ if (this.arguments != null) { > boolean argHasError = false; // typeChecks all arguments >- int length = arguments.length; >+ int length = this.arguments.length; > argumentTypes = new TypeBinding[length]; > for (int i = 0; i < length; i++) { > Expression argument = this.arguments[i]; > if (argument instanceof CastExpression) { >- argument.bits |= DisableUnnecessaryCastCheck; // will check later on >+ argument.bits |= ASTNode.DisableUnnecessaryCastCheck; // will check later on > argsContainCast = true; > } > if ((argumentTypes[i] = argument.resolveType(scope)) == null) { >@@ -338,6 +353,9 @@ > } > } > if (argHasError) { >+ if (receiverType == null) { >+ return; >+ } > // record a best guess, for clients who need hint about possible contructor match > TypeBinding[] pseudoArgs = new TypeBinding[length]; > for (int i = length; --i >= 0;) { >@@ -362,24 +380,32 @@ > } > return; > } >- } else if (receiverType.erasure().id == T_JavaLangEnum) { >+ } else if (receiverType.erasure().id == TypeIds.T_JavaLangEnum) { > // TODO (philippe) get rid of once well-known binding is available > argumentTypes = new TypeBinding[] { scope.getJavaLangString(), TypeBinding.INT }; > } >- if ((binding = scope.getConstructor(receiverType, argumentTypes, this)).isValidBinding()) { >- if (isMethodUseDeprecated(this.binding, scope, this.accessMode != ImplicitSuper)) >- scope.problemReporter().deprecatedMethod(binding, this); >- checkInvocationArguments(scope, null, receiverType, binding, this.arguments, argumentTypes, argsContainCast, this); >- if (binding.isPrivate() || receiverType.isLocalType()) { >- binding.original().modifiers |= ExtraCompilerModifiers.AccLocallyUsed; >+ if (receiverType == null) { >+ return; >+ } >+ if ((this.binding = scope.getConstructor(receiverType, argumentTypes, this)).isValidBinding()) { >+ if (isMethodUseDeprecated(this.binding, scope, this.accessMode != ExplicitConstructorCall.ImplicitSuper)) { >+ scope.problemReporter().deprecatedMethod(this.binding, this); >+ } >+ checkInvocationArguments(scope, null, receiverType, this.binding, this.arguments, argumentTypes, argsContainCast, this); >+ if (this.binding.isPrivate() || receiverType.isLocalType()) { >+ this.binding.original().modifiers |= ExtraCompilerModifiers.AccLocallyUsed; > } >- if (this.typeArguments != null && this.binding.original().typeVariables == Binding.NO_TYPE_VARIABLES) { >+ if (this.typeArguments != null >+ && this.binding.original().typeVariables == Binding.NO_TYPE_VARIABLES) { > scope.problemReporter().unnecessaryTypeArgumentsForMethodInvocation(this.binding, this.genericTypeArguments, this.typeArguments); > } > } else { >- if (binding.declaringClass == null) >- binding.declaringClass = receiverType; >- scope.problemReporter().invalidConstructor(this, binding); >+ if (this.binding.declaringClass == null) { >+ this.binding.declaringClass = receiverType; >+ } >+ if (rcvHasError) >+ return; >+ scope.problemReporter().invalidConstructor(this, this.binding); > } > } finally { > methodScope.isConstructorCall = false; >@@ -399,7 +425,6 @@ > } > > public void traverse(ASTVisitor visitor, BlockScope scope) { >- > if (visitor.visit(this, scope)) { > if (this.qualification != null) { > this.qualification.traverse(visitor, scope); >Index: compiler/org/eclipse/jdt/internal/compiler/ast/CastExpression.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CastExpression.java,v >retrieving revision 1.113 >diff -u -r1.113 CastExpression.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/CastExpression.java 9 Oct 2007 20:30:15 -0000 1.113 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/CastExpression.java 4 Dec 2007 16:31:30 -0000 >@@ -453,7 +453,9 @@ > } > } > } else { // illegal cast >- scope.problemReporter().typeCastError(this, castType, expressionType); >+ if ((castType.tagBits & TagBits.HasMissingType) == 0) { // no complaint if secondary error >+ scope.problemReporter().typeCastError(this, castType, expressionType); >+ } > this.bits |= DisableUnnecessaryCastCheck; // disable further secondary diagnosis > } > } >Index: compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java,v >retrieving revision 1.126 >diff -u -r1.126 MessageSend.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java 9 Nov 2007 08:42:33 -0000 1.126 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java 4 Dec 2007 16:31:31 -0000 >@@ -353,7 +353,7 @@ > // resolve type arguments (for generic constructor call) > if (this.typeArguments != null) { > int length = this.typeArguments.length; >- boolean argHasError = false; // typeChecks all arguments >+ boolean argHasError = scope.compilerOptions().sourceLevel < ClassFileConstants.JDK1_5; // typeChecks all arguments > this.genericTypeArguments = new TypeBinding[length]; > for (int i = 0; i < length; i++) { > TypeReference typeReference = this.typeArguments[i]; >@@ -365,6 +365,11 @@ > } > } > if (argHasError) { >+ if (this.arguments != null) { // still attempt to resolve arguments >+ for (int i = 0, max = this.arguments.length; i < max; i++) { >+ this.arguments[i].resolveType(scope); >+ } >+ } > return null; > } > } >Index: compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java,v >retrieving revision 1.120 >diff -u -r1.120 QualifiedNameReference.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java 9 Nov 2007 08:42:33 -0000 1.120 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java 4 Dec 2007 16:31:32 -0000 >@@ -25,6 +25,7 @@ > import org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding; > import org.eclipse.jdt.internal.compiler.lookup.MethodBinding; > import org.eclipse.jdt.internal.compiler.lookup.MethodScope; >+import org.eclipse.jdt.internal.compiler.lookup.MissingTypeBinding; > import org.eclipse.jdt.internal.compiler.lookup.ProblemFieldBinding; > import org.eclipse.jdt.internal.compiler.lookup.ProblemReasons; > import org.eclipse.jdt.internal.compiler.lookup.ProblemReferenceBinding; >@@ -980,7 +981,7 @@ > public TypeBinding reportError(BlockScope scope) { > if (this.binding instanceof ProblemFieldBinding) { > scope.problemReporter().invalidField(this, (FieldBinding) this.binding); >- } else if (this.binding instanceof ProblemReferenceBinding) { >+ } else if (this.binding instanceof ProblemReferenceBinding || this.binding instanceof MissingTypeBinding) { > scope.problemReporter().invalidType(this, (TypeBinding) this.binding); > } else { > scope.problemReporter().unresolvableReference(this, this.binding); >Index: search/org/eclipse/jdt/internal/core/search/matching/TypeReferenceLocator.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeReferenceLocator.java,v >retrieving revision 1.60 >diff -u -r1.60 TypeReferenceLocator.java >--- search/org/eclipse/jdt/internal/core/search/matching/TypeReferenceLocator.java 28 Nov 2007 08:04:09 -0000 1.60 >+++ search/org/eclipse/jdt/internal/core/search/matching/TypeReferenceLocator.java 4 Dec 2007 16:31:42 -0000 >@@ -223,7 +223,7 @@ > } > > // Try to find best selection for match >- ReferenceBinding typeBinding = null; >+ TypeBinding typeBinding = null; > boolean lastButOne = false; > if (binding instanceof ReferenceBinding) { > typeBinding = (ReferenceBinding) binding; >@@ -601,7 +601,7 @@ > typeBinding = ((ArrayBinding) typeBinding).leafComponentType; > if (typeBinding == null || typeBinding instanceof BaseTypeBinding) return; > if (typeBinding instanceof ProblemReferenceBinding) { >- ReferenceBinding original = ((ProblemReferenceBinding) typeBinding).closestMatch(); >+ TypeBinding original = typeBinding.closestMatch(); > if (original == null) return; // original may not be set (bug 71279) > typeBinding = original; > } >Index: search/org/eclipse/jdt/internal/core/search/matching/PatternLocator.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PatternLocator.java,v >retrieving revision 1.69 >diff -u -r1.69 PatternLocator.java >--- search/org/eclipse/jdt/internal/core/search/matching/PatternLocator.java 28 Nov 2007 08:04:07 -0000 1.69 >+++ search/org/eclipse/jdt/internal/core/search/matching/PatternLocator.java 4 Dec 2007 16:31:42 -0000 >@@ -713,7 +713,7 @@ > // return resolveLevelForType(qualifiedPattern(simpleNamePattern, qualificationPattern), type); > char[] qualifiedPattern = getQualifiedPattern(simpleNamePattern, qualificationPattern); > int level = resolveLevelForType(qualifiedPattern, binding); >- if (level == ACCURATE_MATCH || binding == null) return level; >+ if (level == ACCURATE_MATCH || binding == null || !binding.isValidBinding()) return level; > TypeBinding type = binding instanceof ArrayBinding ? ((ArrayBinding)binding).leafComponentType : binding; > char[] sourceName = null; > if (type.isMemberType() || type.isLocalType()) { >@@ -765,7 +765,7 @@ > */ > protected int resolveLevelForType(char[] qualifiedPattern, TypeBinding type) { > if (qualifiedPattern == null) return ACCURATE_MATCH; >- if (type == null) return INACCURATE_MATCH; >+ if (type == null || !type.isValidBinding()) return INACCURATE_MATCH; > > // Type variable cannot be specified through pattern => this kind of binding cannot match it (see bug 79803) > if (type.isTypeVariable()) return IMPOSSIBLE_MATCH; >Index: search/org/eclipse/jdt/internal/core/search/matching/SuperTypeReferenceLocator.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/SuperTypeReferenceLocator.java,v >retrieving revision 1.14 >diff -u -r1.14 SuperTypeReferenceLocator.java >--- search/org/eclipse/jdt/internal/core/search/matching/SuperTypeReferenceLocator.java 17 Jul 2007 06:24:18 -0000 1.14 >+++ search/org/eclipse/jdt/internal/core/search/matching/SuperTypeReferenceLocator.java 4 Dec 2007 16:31:42 -0000 >@@ -83,7 +83,7 @@ > if (typeBinding instanceof ProblemReferenceBinding) > typeBinding = ((ProblemReferenceBinding) typeBinding).closestMatch(); > >- if (typeBinding == null) return INACCURATE_MATCH; >+ if (typeBinding == null || !typeBinding.isValidBinding()) return INACCURATE_MATCH; > return resolveLevelForType(this.pattern.superSimpleName, this.pattern.superQualification, typeBinding); > } > public int resolveLevel(Binding binding) { >Index: dom/org/eclipse/jdt/core/dom/VariableBinding.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/VariableBinding.java,v >retrieving revision 1.56 >diff -u -r1.56 VariableBinding.java >--- dom/org/eclipse/jdt/core/dom/VariableBinding.java 24 Oct 2007 13:50:52 -0000 1.56 >+++ dom/org/eclipse/jdt/core/dom/VariableBinding.java 4 Dec 2007 16:31:41 -0000 >@@ -327,6 +327,8 @@ > * @see org.eclipse.jdt.core.dom.IBinding#isRecovered() > */ > public boolean isRecovered() { >+ if ((this.binding.tagBits & TagBits.HasMissingType) != 0) >+ return true; > return false; > } > >Index: dom/org/eclipse/jdt/core/dom/TypeBinding.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeBinding.java,v >retrieving revision 1.135 >diff -u -r1.135 TypeBinding.java >--- dom/org/eclipse/jdt/core/dom/TypeBinding.java 24 Sep 2007 22:49:54 -0000 1.135 >+++ dom/org/eclipse/jdt/core/dom/TypeBinding.java 4 Dec 2007 16:31:41 -0000 >@@ -44,6 +44,7 @@ > import org.eclipse.jdt.internal.compiler.lookup.RawTypeBinding; > import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding; > import org.eclipse.jdt.internal.compiler.lookup.Scope; >+import org.eclipse.jdt.internal.compiler.lookup.TagBits; > import org.eclipse.jdt.internal.compiler.lookup.TypeConstants; > import org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding; > import org.eclipse.jdt.internal.compiler.lookup.WildcardBinding; >@@ -1309,6 +1310,8 @@ > * @see IBinding#isRecovered() > */ > public boolean isRecovered() { >+ if ((this.binding.tagBits & TagBits.HasMissingType) != 0) >+ return true; > return false; > } > >Index: dom/org/eclipse/jdt/core/dom/DefaultBindingResolver.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DefaultBindingResolver.java,v >retrieving revision 1.157 >diff -u -r1.157 DefaultBindingResolver.java >--- dom/org/eclipse/jdt/core/dom/DefaultBindingResolver.java 16 Jul 2007 21:03:36 -0000 1.157 >+++ dom/org/eclipse/jdt/core/dom/DefaultBindingResolver.java 4 Dec 2007 16:31:41 -0000 >@@ -322,7 +322,7 @@ > case ProblemReasons.NonStaticReferenceInStaticContext : > if (referenceBinding instanceof ProblemReferenceBinding) { > ProblemReferenceBinding problemReferenceBinding = (ProblemReferenceBinding) referenceBinding; >- ReferenceBinding binding2 = problemReferenceBinding.closestMatch(); >+ org.eclipse.jdt.internal.compiler.lookup.TypeBinding binding2 = problemReferenceBinding.closestMatch(); > ITypeBinding binding = (ITypeBinding) this.bindingTables.compilerBindingsToASTBindings.get(binding2); > if (binding != null) { > return binding; >Index: dom/org/eclipse/jdt/core/dom/MethodBinding.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodBinding.java,v >retrieving revision 1.87 >diff -u -r1.87 MethodBinding.java >--- dom/org/eclipse/jdt/core/dom/MethodBinding.java 2 Nov 2007 18:11:11 -0000 1.87 >+++ dom/org/eclipse/jdt/core/dom/MethodBinding.java 4 Dec 2007 16:31:41 -0000 >@@ -25,6 +25,7 @@ > import org.eclipse.jdt.internal.compiler.lookup.ParameterizedGenericMethodBinding; > import org.eclipse.jdt.internal.compiler.lookup.RawTypeBinding; > import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding; >+import org.eclipse.jdt.internal.compiler.lookup.TagBits; > import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; > import org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding; > import org.eclipse.jdt.internal.compiler.problem.AbortCompilation; >@@ -323,6 +324,8 @@ > * @see IBinding#isRecovered() > */ > public boolean isRecovered() { >+ if ((this.binding.tagBits & TagBits.HasMissingType) != 0) >+ return true; > return false; > } > >Index: codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnSingleNameReference.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnSingleNameReference.java,v >retrieving revision 1.25 >diff -u -r1.25 SelectionOnSingleNameReference.java >--- codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnSingleNameReference.java 10 May 2006 18:03:41 -0000 1.25 >+++ codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnSingleNameReference.java 4 Dec 2007 16:31:30 -0000 >@@ -33,6 +33,7 @@ > import org.eclipse.jdt.internal.compiler.lookup.Binding; > import org.eclipse.jdt.internal.compiler.lookup.BlockScope; > import org.eclipse.jdt.internal.compiler.lookup.FieldBinding; >+import org.eclipse.jdt.internal.compiler.lookup.MissingTypeBinding; > import org.eclipse.jdt.internal.compiler.lookup.ProblemFieldBinding; > import org.eclipse.jdt.internal.compiler.lookup.ProblemReasons; > import org.eclipse.jdt.internal.compiler.lookup.ProblemReferenceBinding; >@@ -61,7 +62,7 @@ > throw new SelectionNodeFound(binding); > } > scope.problemReporter().invalidField(this, (FieldBinding) binding); >- } else if (binding instanceof ProblemReferenceBinding) { >+ } else if (binding instanceof ProblemReferenceBinding || binding instanceof MissingTypeBinding) { > // tolerate some error cases > if (binding.problemId() == ProblemReasons.NotVisible){ > throw new SelectionNodeFound(binding); >Index: codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedNameReference.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedNameReference.java,v >retrieving revision 1.24 >diff -u -r1.24 SelectionOnQualifiedNameReference.java >--- codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedNameReference.java 10 May 2006 18:03:41 -0000 1.24 >+++ codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedNameReference.java 4 Dec 2007 16:31:30 -0000 >@@ -35,6 +35,7 @@ > import org.eclipse.jdt.internal.compiler.ast.QualifiedNameReference; > import org.eclipse.jdt.internal.compiler.lookup.BlockScope; > import org.eclipse.jdt.internal.compiler.lookup.FieldBinding; >+import org.eclipse.jdt.internal.compiler.lookup.MissingTypeBinding; > import org.eclipse.jdt.internal.compiler.lookup.ProblemFieldBinding; > import org.eclipse.jdt.internal.compiler.lookup.ProblemReasons; > import org.eclipse.jdt.internal.compiler.lookup.ProblemReferenceBinding; >@@ -71,7 +72,7 @@ > throw new SelectionNodeFound(binding); > } > scope.problemReporter().invalidField(this, (FieldBinding) binding); >- } else if (binding instanceof ProblemReferenceBinding) { >+ } else if (binding instanceof ProblemReferenceBinding || binding instanceof MissingTypeBinding) { > // tolerate some error cases > if (binding.problemId() == ProblemReasons.NotVisible){ > throw new SelectionNodeFound(binding); >Index: codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedNameReference.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedNameReference.java,v >retrieving revision 1.23 >diff -u -r1.23 CompletionOnQualifiedNameReference.java >--- codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedNameReference.java 12 Oct 2006 09:21:42 -0000 1.23 >+++ codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedNameReference.java 4 Dec 2007 16:31:29 -0000 >@@ -60,7 +60,7 @@ > if (!binding.isValidBinding()) { > if (binding instanceof ProblemFieldBinding) { > scope.problemReporter().invalidField(this, (FieldBinding) binding); >- } else if (binding instanceof ProblemReferenceBinding) { >+ } else if (binding instanceof ProblemReferenceBinding || binding instanceof MissingTypeBinding) { > scope.problemReporter().invalidType(this, (TypeBinding) binding); > } else { > scope.problemReporter().unresolvableReference(this, binding); >Index: codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMemberAccess.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMemberAccess.java,v >retrieving revision 1.23 >diff -u -r1.23 CompletionOnMemberAccess.java >--- codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMemberAccess.java 20 Nov 2006 10:49:55 -0000 1.23 >+++ codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMemberAccess.java 4 Dec 2007 16:31:29 -0000 >@@ -55,7 +55,7 @@ > > this.receiverType = receiver.resolveType(scope); > >- if (this.receiverType == null && receiver instanceof MessageSend) { >+ if ((this.receiverType == null || !this.receiverType.isValidBinding()) && receiver instanceof MessageSend) { > MessageSend messageSend = (MessageSend) receiver; > if(messageSend.receiver instanceof ThisReference) { > Expression[] arguments = messageSend.arguments; >@@ -73,7 +73,7 @@ > } > } > >- if (this.receiverType == null || this.receiverType.isBaseType()) >+ if (this.receiverType == null || this.receiverType.isBaseType() || !this.receiverType.isValidBinding()) > throw new CompletionNodeFound(); > else > throw new CompletionNodeFound(this, this.receiverType, scope); >Index: model/org/eclipse/jdt/internal/core/hierarchy/HierarchyResolver.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/HierarchyResolver.java,v >retrieving revision 1.77 >diff -u -r1.77 HierarchyResolver.java >--- model/org/eclipse/jdt/internal/core/hierarchy/HierarchyResolver.java 3 Dec 2007 13:57:21 -0000 1.77 >+++ model/org/eclipse/jdt/internal/core/hierarchy/HierarchyResolver.java 4 Dec 2007 16:31:41 -0000 >@@ -330,10 +330,18 @@ > int index = 0; > for (int i = 0; i < length; i++) { > ReferenceBinding superInterface = (ReferenceBinding) superInterfaces[i].resolvedType; >- if (superInterface instanceof ProblemReferenceBinding) >- superInterface = superInterface.closestMatch(); >- if (superInterface != null) >- interfaceBindings[index++] = superInterface; >+ if (superInterface != null) { >+ if (!superInterface.isValidBinding()) { >+ TypeBinding closestMatch = superInterface.closestMatch(); >+ if (closestMatch instanceof ReferenceBinding) { >+ superInterface = (ReferenceBinding) closestMatch; >+ } else { >+ superInterface = null; >+ } >+ } >+ if (superInterface != null) >+ interfaceBindings[index++] = superInterface; >+ } > } > if (index < length) > System.arraycopy(interfaceBindings, 0, interfaceBindings = new ReferenceBinding[index], 0 , index); >Index: compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java,v >retrieving revision 1.81 >diff -u -r1.81 ClassFileReader.java >--- compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java 11 Jul 2007 13:40:56 -0000 1.81 >+++ compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java 4 Dec 2007 16:31:33 -0000 >@@ -298,7 +298,7 @@ > } > } > } else if (CharOperation.equals(attributeName, AttributeNamesConstants.InconsistentHierarchy)) { >- this.tagBits |= TagBits.HasInconsistentHierarchy; >+ this.tagBits |= TagBits.HierarchyHasProblems; > } > break; > case 'S' : >@@ -702,7 +702,7 @@ > long OnlyStructuralTagBits = TagBits.AnnotationTargetMASK // different @Target status ? > | TagBits.AnnotationDeprecated // different @Deprecated status ? > | TagBits.AnnotationRetentionMASK // different @Retention status ? >- | TagBits.HasInconsistentHierarchy; // different hierarchy status ? >+ | TagBits.HierarchyHasProblems; // different hierarchy status ? > > // meta-annotations > if ((this.getTagBits() & OnlyStructuralTagBits) != (newClassFile.getTagBits() & OnlyStructuralTagBits)) >Index: codeassist/org/eclipse/jdt/internal/codeassist/SelectionEngine.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/SelectionEngine.java,v >retrieving revision 1.142 >diff -u -r1.142 SelectionEngine.java >--- codeassist/org/eclipse/jdt/internal/codeassist/SelectionEngine.java 30 Nov 2007 15:31:22 -0000 1.142 >+++ codeassist/org/eclipse/jdt/internal/codeassist/SelectionEngine.java 4 Dec 2007 16:31:29 -0000 >@@ -848,7 +848,12 @@ > } else if (binding instanceof ReferenceBinding) { > ReferenceBinding typeBinding = (ReferenceBinding) binding; > if(typeBinding instanceof ProblemReferenceBinding) { >- typeBinding = typeBinding.closestMatch(); >+ TypeBinding closestMatch = typeBinding.closestMatch(); >+ if (closestMatch instanceof ReferenceBinding) { >+ typeBinding = (ReferenceBinding) closestMatch; >+ } else { >+ typeBinding = null; >+ } > } > if (typeBinding == null) return; > if (isLocal(typeBinding) && this.requestor instanceof SelectionRequestor) { >Index: codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java,v >retrieving revision 1.349 >diff -u -r1.349 CompletionEngine.java >--- codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 30 Nov 2007 15:31:22 -0000 1.349 >+++ codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 4 Dec 2007 16:31:29 -0000 >@@ -1156,7 +1156,7 @@ > } else if (qualifiedBinding instanceof VariableBinding) { > setSourceAndTokenRange((int) (completionPosition >>> 32), (int) completionPosition); > TypeBinding receiverType = ((VariableBinding) qualifiedBinding).type; >- if (receiverType != null) { >+ if (receiverType != null && (receiverType.tagBits & TagBits.HasMissingType) == 0) { > ObjectVector fieldsFound = new ObjectVector(); > ObjectVector methodsFound = new ObjectVector(); > >@@ -1194,22 +1194,33 @@ > boolean proposeField = !this.requestor.isIgnored(CompletionProposal.FIELD_REF); > boolean proposeMethod = !this.requestor.isIgnored(CompletionProposal.METHOD_REF); > if (proposeField || proposeMethod) { >- if (qualifiedBinding instanceof LocalVariableBinding) { >- // complete local variable members with missing variables type >- // class X { >- // void foo() { >- // Missing f; >- // f.| >- // } >- // } >- LocalVariableBinding localVariableBinding = (LocalVariableBinding) qualifiedBinding; >+ if(ref.tokens.length == 1) { >+ if (qualifiedBinding instanceof LocalVariableBinding) { >+ // complete local variable members with missing variables type >+ // class X { >+ // void foo() { >+ // Missing f; >+ // f.| >+ // } >+ // } >+ LocalVariableBinding localVariableBinding = (LocalVariableBinding) qualifiedBinding; >+ findFieldsAndMethodsFromMissingType( >+ this.completionToken, >+ localVariableBinding.declaration.type, >+ localVariableBinding.declaringScope, >+ ref, >+ scope); >+ } else { >+ // complete field members with missing fields type >+ // class X { >+ // Missing f; >+ // void foo() { >+ // f.| >+ // } >+ // } >+ findFieldsAndMethodsFromMissingFieldType(ref.tokens[0], scope, ref, insideTypeAnnotation); >+ } > >- findFieldsAndMethodsFromMissingType( >- this.completionToken, >- localVariableBinding.declaration.type, >- localVariableBinding.declaringScope, >- ref, >- scope); > } > } > } >@@ -4106,7 +4117,8 @@ > for (int i = 0; i < fieldsCount; i++) { > FieldDeclaration fieldDeclaration = fields[i]; > if (CharOperation.equals(fieldDeclaration.name, token)) { >- if (fieldDeclaration.binding == null) { >+ FieldBinding fieldBinding = fieldDeclaration.binding; >+ if (fieldBinding == null || fieldBinding.type == null || (fieldBinding.type.tagBits & TagBits.HasMissingType) != 0) { > foundSomeFields = true; > findFieldsAndMethodsFromMissingType( > this.completionToken, >@@ -4165,7 +4177,8 @@ > if (methodDeclaration instanceof MethodDeclaration && > CharOperation.equals(methodDeclaration.selector, token)) { > MethodDeclaration method = (MethodDeclaration) methodDeclaration; >- if (methodDeclaration.binding == null) { >+ MethodBinding methodBinding = method.binding; >+ if (methodBinding == null || methodBinding.returnType == null || (methodBinding.returnType.tagBits & TagBits.HasMissingType) != 0) { > Argument[] parameters = method.arguments; > int parametersLength = parameters == null ? 0 : parameters.length; > int argumentsLength = arguments == null ? 0 : arguments.length; >@@ -4181,9 +4194,18 @@ > break done; > } > } else { >- TypeBinding[] parametersBindings = new TypeBinding[parametersLength]; >- for (int j = 0; j < parametersLength; j++) { >- parametersBindings[j] = parameters[j].type.resolvedType; >+ TypeBinding[] parametersBindings; >+ if (methodBinding == null) { // since no binding, extra types from type references >+ parametersBindings = new TypeBinding[parametersLength]; >+ for (int j = 0; j < parametersLength; j++) { >+ TypeBinding parameterType = parameters[j].type.resolvedType; >+ if (!parameterType.isValidBinding() && parameterType.closestMatch() != null) { >+ parameterType = parameterType.closestMatch(); >+ } >+ parametersBindings[j] = parameterType; >+ } >+ } else { >+ parametersBindings = methodBinding.parameters; > } > if(areParametersCompatibleWith(parametersBindings, arguments, parameters[parametersLength - 1].isVarArgs())) { > findFieldsAndMethodsFromMissingType( >@@ -4999,7 +5021,7 @@ > } > }; > SingleTypeReference typeRef = new SingleTypeReference(token, pos); >- typeRef.resolvedType = new ProblemReferenceBinding(token, null, ProblemReasons.NotFound); >+ typeRef.resolvedType = new ProblemReferenceBinding(new char[][]{ token }, null, ProblemReasons.NotFound); > missingTypesConverter.guess(typeRef, scope, substitutionRequestor); > } > >@@ -9402,7 +9424,7 @@ > } > typeBindings[nodeIndex] = scope.getJavaLangObject(); > if(typeVariables == null || typeVariables.length == 0) { >- scope.problemReporter().nonGenericTypeCannotBeParameterized(ref, ref.resolvedType, typeBindings); >+ scope.problemReporter().nonGenericTypeCannotBeParameterized(0, ref, ref.resolvedType, typeBindings); > } else { > scope.problemReporter().incorrectArityForParameterizedType(ref, ref.resolvedType, typeBindings); > } >@@ -9423,7 +9445,7 @@ > } > typeBindings[j] = scope.getJavaLangObject(); > if(typeVariables == null || typeVariables.length == 0) { >- scope.problemReporter().nonGenericTypeCannotBeParameterized(ref, ref.resolvedType, typeBindings); >+ scope.problemReporter().nonGenericTypeCannotBeParameterized(0, ref, ref.resolvedType, typeBindings); > } else { > scope.problemReporter().incorrectArityForParameterizedType(ref, ref.resolvedType, typeBindings); > } >Index: eval/org/eclipse/jdt/internal/eval/CodeSnippetScope.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetScope.java,v >retrieving revision 1.49 >diff -u -r1.49 CodeSnippetScope.java >--- eval/org/eclipse/jdt/internal/eval/CodeSnippetScope.java 23 Jul 2007 18:41:48 -0000 1.49 >+++ eval/org/eclipse/jdt/internal/eval/CodeSnippetScope.java 4 Dec 2007 16:31:41 -0000 >@@ -447,7 +447,7 @@ > if (!binding.isValidBinding()) > return new ProblemReferenceBinding( > CharOperation.subarray(compoundName, 0, currentIndex), >- ((ReferenceBinding)binding).closestMatch(), >+ (ReferenceBinding)((ReferenceBinding)binding).closestMatch(), > binding.problemId()); > if (!this.canBeSeenByForCodeSnippet((ReferenceBinding) binding, receiverType)) > return new ProblemReferenceBinding(CharOperation.subarray(compoundName, 0, currentIndex), (ReferenceBinding) binding, ProblemReasons.NotVisible); >@@ -480,7 +480,7 @@ > if (!binding.isValidBinding()) > return new ProblemReferenceBinding( > CharOperation.subarray(compoundName, 0, currentIndex), >- ((ReferenceBinding)binding).closestMatch(), >+ (ReferenceBinding)((ReferenceBinding)binding).closestMatch(), > binding.problemId()); > } > >Index: eval/org/eclipse/jdt/internal/eval/CodeSnippetAllocationExpression.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetAllocationExpression.java,v >retrieving revision 1.35 >diff -u -r1.35 CodeSnippetAllocationExpression.java >--- eval/org/eclipse/jdt/internal/eval/CodeSnippetAllocationExpression.java 29 Mar 2006 02:57:52 -0000 1.35 >+++ eval/org/eclipse/jdt/internal/eval/CodeSnippetAllocationExpression.java 4 Dec 2007 16:31:41 -0000 >@@ -164,6 +164,9 @@ > if (this.binding.declaringClass == null) { > this.binding.declaringClass = allocatedType; > } >+ if (this.type != null && !this.type.resolvedType.isValidBinding()) { >+ return null; >+ } > scope.problemReporter().invalidConstructor(this, this.binding); > return this.resolvedType; > } >@@ -171,6 +174,9 @@ > if (this.binding.declaringClass == null) { > this.binding.declaringClass = allocatedType; > } >+ if (this.type != null && !this.type.resolvedType.isValidBinding()) { >+ return null; >+ } > scope.problemReporter().invalidConstructor(this, this.binding); > return this.resolvedType; > } >@@ -180,6 +186,9 @@ > if (this.binding.declaringClass == null) { > this.binding.declaringClass = allocatedType; > } >+ if (this.type != null && !this.type.resolvedType.isValidBinding()) { >+ return null; >+ } > scope.problemReporter().invalidConstructor(this, this.binding); > return this.resolvedType; > } else { >@@ -189,6 +198,9 @@ > if (this.binding.declaringClass == null) { > this.binding.declaringClass = allocatedType; > } >+ if (this.type != null && !this.type.resolvedType.isValidBinding()) { >+ return null; >+ } > scope.problemReporter().invalidConstructor(this, this.binding); > return this.resolvedType; > } >Index: compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java,v >retrieving revision 1.364 >diff -u -r1.364 ProblemReporter.java >--- compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java 30 Nov 2007 17:02:40 -0000 1.364 >+++ compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java 4 Dec 2007 16:31:40 -0000 >@@ -2959,6 +2959,15 @@ > FieldBinding field = fieldRef.binding; > switch (field.problemId()) { > case ProblemReasons.NotFound : >+ if ((searchedType.tagBits & TagBits.HasMissingType) != 0) { >+ this.handle( >+ IProblem.UndefinedType, >+ new String[] {new String(searchedType.leafComponentType().readableName())}, >+ new String[] {new String(searchedType.leafComponentType().shortReadableName())}, >+ fieldRef.receiver.sourceStart, >+ fieldRef.receiver.sourceEnd); >+ return; >+ } > id = IProblem.UndefinedField; > /* also need to check that the searchedType is the receiver type > if (searchedType.isHierarchyInconsistent()) >@@ -3019,6 +3028,15 @@ > int id = IProblem.UndefinedField; > switch (field.problemId()) { > case ProblemReasons.NotFound : >+ if ((field.declaringClass.tagBits & TagBits.HasMissingType) != 0) { >+ this.handle( >+ IProblem.UndefinedType, >+ new String[] {new String(field.declaringClass.readableName())}, >+ new String[] {new String(field.declaringClass.shortReadableName())}, >+ nameRef.sourceStart, >+ nameRef.sourceEnd); >+ return; >+ } > id = IProblem.UndefinedField; > break; > case ProblemReasons.NotVisible : >@@ -3046,8 +3064,8 @@ > case ProblemReasons.ReceiverTypeNotVisible : > this.handle( > IProblem.NotVisibleType, >- new String[] {new String(field.declaringClass.leafComponentType().readableName())}, >- new String[] {new String(field.declaringClass.leafComponentType().shortReadableName())}, >+ new String[] {new String(field.declaringClass.readableName())}, >+ new String[] {new String(field.declaringClass.shortReadableName())}, > nameRef.sourceStart, > nameRef.sourceEnd); > return; >@@ -3094,7 +3112,16 @@ > int id = IProblem.UndefinedField; > switch (field.problemId()) { > case ProblemReasons.NotFound : >- id = IProblem.UndefinedField; >+ if ((searchedType.tagBits & TagBits.HasMissingType) != 0) { >+ this.handle( >+ IProblem.UndefinedType, >+ new String[] {new String(searchedType.leafComponentType().readableName())}, >+ new String[] {new String(searchedType.leafComponentType().shortReadableName())}, >+ nameRef.sourceStart, >+ (int) nameRef.sourcePositions[index-1]); >+ return; >+ } >+ id = IProblem.UndefinedField; > /* also need to check that the searchedType is the receiver type > if (searchedType.isHierarchyInconsistent()) > severity = SecondaryError; >@@ -3127,7 +3154,7 @@ > new String[] {new String(searchedType.leafComponentType().readableName())}, > new String[] {new String(searchedType.leafComponentType().shortReadableName())}, > nameRef.sourceStart, >- nameRef.sourceEnd); >+ (int) nameRef.sourcePositions[index-1]); > return; > case ProblemReasons.NoError : // 0 > default : >@@ -3158,6 +3185,16 @@ > MethodBinding shownMethod = method; > switch (method.problemId()) { > case ProblemReasons.NotFound : >+ if ((method.declaringClass.tagBits & TagBits.HasMissingType) != 0) { >+ this.handle( >+ IProblem.UndefinedType, >+ new String[] {new String(method.declaringClass.readableName())}, >+ new String[] {new String(method.declaringClass.shortReadableName())}, >+ messageSend.receiver.sourceStart, >+ messageSend.receiver.sourceEnd); >+ return; >+ >+ } > id = IProblem.UndefinedMethod; > ProblemMethodBinding problemMethod = (ProblemMethodBinding) method; > if (problemMethod.closestMatch != null) { >@@ -3207,8 +3244,8 @@ > case ProblemReasons.ReceiverTypeNotVisible : > this.handle( > IProblem.NotVisibleType, // cannot occur in javadoc comments >- new String[] {new String(method.declaringClass.leafComponentType().readableName())}, >- new String[] {new String(method.declaringClass.leafComponentType().shortReadableName())}, >+ new String[] {new String(method.declaringClass.readableName())}, >+ new String[] {new String(method.declaringClass.shortReadableName())}, > messageSend.receiver.sourceStart, > messageSend.receiver.sourceEnd); > return; >@@ -3322,7 +3359,6 @@ > needImplementation(messageSend); // want to fail to see why we were here... > break; > } >- > this.handle( > id, > new String[] { >@@ -3720,18 +3756,19 @@ > return false; > } > } >+ > private boolean isRecoveredName(char[] simpleName) { > return simpleName == RecoveryScanner.FAKE_IDENTIFIER; > } >+ > private boolean isRecoveredName(char[][] qualifiedName) { > if(qualifiedName == null) return false; >- > for (int i = 0; i < qualifiedName.length; i++) { > if(qualifiedName[i] == RecoveryScanner.FAKE_IDENTIFIER) return true; > } >- > return false; > } >+ > public void javadocAmbiguousMethodReference(int sourceStart, int sourceEnd, Binding fieldBinding, int modifiers) { > int severity = computeSeverity(IProblem.JavadocAmbiguousMethodReference); > if (severity == ProblemSeverities.Ignore) return; >@@ -4500,15 +4537,19 @@ > sourceEnd); > } > } >+ > public void javadocUnexpectedTag(int sourceStart, int sourceEnd) { > this.handle(IProblem.JavadocUnexpectedTag, NoArgument, NoArgument, sourceStart, sourceEnd); > } >+ > public void javadocUnexpectedText(int sourceStart, int sourceEnd) { > this.handle(IProblem.JavadocUnexpectedText, NoArgument, NoArgument, sourceStart, sourceEnd); > } >+ > public void javadocUnterminatedInlineTag(int sourceStart, int sourceEnd) { > this.handle(IProblem.JavadocUnterminatedInlineTag, NoArgument, NoArgument, sourceStart, sourceEnd); > } >+ > private boolean javadocVisibility(int visibility, int modifiers) { > if (modifiers < 0) return true; > switch (modifiers & ExtraCompilerModifiers.AccVisibilityMASK) { >@@ -4523,6 +4564,7 @@ > } > return true; > } >+ > private String javadocVisibilityArgument(int visibility, int modifiers) { > String argument = null; > switch (modifiers & ExtraCompilerModifiers.AccVisibilityMASK) { >@@ -4547,6 +4589,7 @@ > } > return argument; > } >+ > public void localVariableHiding(LocalDeclaration local, Binding hiddenVariable, boolean isSpecialArgHidingField) { > if (hiddenVariable instanceof LocalVariableBinding) { > int id = (local instanceof Argument) >@@ -4581,6 +4624,7 @@ > local.sourceEnd); > } > } >+ > public void localVariableNonNullComparedToNull(LocalVariableBinding local, ASTNode location) { > int severity = computeSeverity(IProblem.NonNullLocalVariableComparisonYieldsFalse); > if (severity == ProblemSeverities.Ignore) return; >@@ -4593,6 +4637,7 @@ > nodeSourceStart(local, location), > nodeSourceEnd(local, location)); > } >+ > public void localVariableNullComparedToNonNull(LocalVariableBinding local, ASTNode location) { > int severity = computeSeverity(IProblem.NullLocalVariableComparisonYieldsFalse); > if (severity == ProblemSeverities.Ignore) return; >@@ -4605,6 +4650,7 @@ > nodeSourceStart(local, location), > nodeSourceEnd(local, location)); > } >+ > public void localVariableNullInstanceof(LocalVariableBinding local, ASTNode location) { > int severity = computeSeverity(IProblem.NullLocalVariableInstanceofYieldsFalse); > if (severity == ProblemSeverities.Ignore) return; >@@ -4617,6 +4663,7 @@ > nodeSourceStart(local, location), > nodeSourceEnd(local, location)); > } >+ > public void localVariableNullReference(LocalVariableBinding local, ASTNode location) { > int severity = computeSeverity(IProblem.NullLocalVariableReference); > if (severity == ProblemSeverities.Ignore) return; >@@ -4629,6 +4676,7 @@ > nodeSourceStart(local, location), > nodeSourceEnd(local, location)); > } >+ > public void localVariablePotentialNullReference(LocalVariableBinding local, ASTNode location) { > int severity = computeSeverity(IProblem.PotentialNullLocalVariableReference); > if (severity == ProblemSeverities.Ignore) return; >@@ -4641,6 +4689,7 @@ > nodeSourceStart(local, location), > nodeSourceEnd(local, location)); > } >+ > public void localVariableRedundantCheckOnNonNull(LocalVariableBinding local, ASTNode location) { > int severity = computeSeverity(IProblem.RedundantNullCheckOnNonNullLocalVariable); > if (severity == ProblemSeverities.Ignore) return; >@@ -4653,6 +4702,7 @@ > nodeSourceStart(local, location), > nodeSourceEnd(local, location)); > } >+ > public void localVariableRedundantCheckOnNull(LocalVariableBinding local, ASTNode location) { > int severity = computeSeverity(IProblem.RedundantNullCheckOnNullLocalVariable); > if (severity == ProblemSeverities.Ignore) return; >@@ -4665,6 +4715,7 @@ > nodeSourceStart(local, location), > nodeSourceEnd(local, location)); > } >+ > public void localVariableRedundantNullAssignment(LocalVariableBinding local, ASTNode location) { > int severity = computeSeverity(IProblem.RedundantLocalVariableNullAssignment); > if (severity == ProblemSeverities.Ignore) return; >@@ -4677,6 +4728,7 @@ > nodeSourceStart(local, location), > nodeSourceEnd(local, location)); > } >+ > public void methodMustOverride(AbstractMethodDeclaration method) { > MethodBinding binding = method.binding; > this.handle( >@@ -4686,6 +4738,7 @@ > method.sourceStart, > method.sourceEnd); > } >+ > public void methodNameClash(MethodBinding currentMethod, MethodBinding inheritedMethod) { > this.handle( > IProblem.MethodNameClash, >@@ -4706,6 +4759,7 @@ > currentMethod.sourceStart(), > currentMethod.sourceEnd()); > } >+ > public void methodNeedBody(AbstractMethodDeclaration methodDecl) { > this.handle( > IProblem.MethodRequiresBody, >@@ -4714,6 +4768,7 @@ > methodDecl.sourceStart, > methodDecl.sourceEnd); > } >+ > public void methodNeedingNoBody(MethodDeclaration methodDecl) { > this.handle( > ((methodDecl.modifiers & ClassFileConstants.AccNative) != 0) ? IProblem.BodyForNativeMethod : IProblem.BodyForAbstractMethod, >@@ -4731,6 +4786,7 @@ > methodDecl.sourceStart, > methodDecl.sourceEnd); > } >+ > public void missingDeprecatedAnnotationForField(FieldDeclaration field) { > int severity = computeSeverity(IProblem.FieldMissingDeprecatedAnnotation); > if (severity == ProblemSeverities.Ignore) return; >@@ -5056,9 +5112,7 @@ > location.sourceStart, > location.sourceEnd); > } >-public void nonGenericTypeCannotBeParameterized(ASTNode location, TypeBinding type, TypeBinding[] argumentTypes) { >- this.nonGenericTypeCannotBeParameterized(0, location, type, argumentTypes); >-} >+ > public void nonGenericTypeCannotBeParameterized(int index, ASTNode location, TypeBinding type, TypeBinding[] argumentTypes) { > if (location == null) { // binary case > this.handle( >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/MissingTypeBinding.java >=================================================================== >RCS file: compiler/org/eclipse/jdt/internal/compiler/lookup/MissingTypeBinding.java >diff -N compiler/org/eclipse/jdt/internal/compiler/lookup/MissingTypeBinding.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/MissingTypeBinding.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,61 @@ >+/******************************************************************************* >+ * Copyright (c) 2000, 2006 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.jdt.internal.compiler.lookup; >+ >+import org.eclipse.jdt.core.compiler.CharOperation; >+import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; >+ >+public class MissingTypeBinding extends BinaryTypeBinding { >+ >+/** >+ * Special constructor for constructing proxies of missing types (114349) >+ * @param packageBinding >+ * @param compoundName >+ * @param environment >+ */ >+public MissingTypeBinding(PackageBinding packageBinding, char[][] compoundName, LookupEnvironment environment) { >+ this.compoundName = compoundName; >+ computeId(); >+ this.tagBits |= TagBits.IsBinaryBinding | TagBits.HierarchyHasProblems | TagBits.HasMissingType; >+ this.environment = environment; >+ this.fPackage = packageBinding; >+ this.fileName = CharOperation.concatWith(compoundName, '/'); >+ this.sourceName = compoundName[compoundName.length - 1]; // [java][util][Map$Entry] >+ this.modifiers = ClassFileConstants.AccPublic; >+ this.superclass = null; // will be fixed up using #setMissingSuperclass(...) >+ this.superInterfaces = Binding.NO_SUPERINTERFACES; >+ this.typeVariables = Binding.NO_TYPE_VARIABLES; >+ this.memberTypes = Binding.NO_MEMBER_TYPES; >+ this.fields = Binding.NO_FIELDS; >+ this.methods = Binding.NO_METHODS; >+} >+ >+/** >+ * Missing binary type will answer <code>false</code> to #isValidBinding() >+ * @see org.eclipse.jdt.internal.compiler.lookup.Binding#problemId() >+ */ >+public int problemId() { >+ return ProblemReasons.NotFound; >+} >+ >+/** >+ * Only used to fixup the superclass hierarchy of proxy binary types >+ * @param missingSuperclass >+ * @see LookupEnvironment#createMissingType(PackageBinding, char[][]) >+ */ >+void setMissingSuperclass(ReferenceBinding missingSuperclass) { >+ this.superclass = missingSuperclass; >+} >+ >+public String toString() { >+ return "[MISSING:" + new String(CharOperation.concatWith(this.compoundName, '.')) + "]"; //$NON-NLS-1$ //$NON-NLS-2$ >+ } >+}
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 196200
:
83553
|
83825
|
83870
|
84003
|
84439
|
84626
|
85731
|
87237
|
88973
|
89990
|
90154
|
90169
|
90307
|
90374
|
90499
|
90846