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 90154 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 v11
196200z24.txt (text/plain), 631.89 KB, created by
Philipe Mulet
on 2008-02-20 03:43:25 EST
(
hide
)
Description:
More advanced patch v11
Filename:
MIME Type:
Creator:
Philipe Mulet
Created:
2008-02-20 03:43:25 EST
Size:
631.89 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/eval/EvaluationTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/EvaluationTest.java,v >retrieving revision 1.27 >diff -u -r1.27 EvaluationTest.java >--- src/org/eclipse/jdt/core/tests/eval/EvaluationTest.java 6 Mar 2007 04:42:13 -0000 1.27 >+++ src/org/eclipse/jdt/core/tests/eval/EvaluationTest.java 20 Feb 2008 07:00:40 -0000 >@@ -80,6 +80,7 @@ > } > } > } catch (ClassFormatException e) { >+ e.printStackTrace(); > } > } > } >Index: src/org/eclipse/jdt/core/tests/eval/SimpleTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/SimpleTest.java,v >retrieving revision 1.17 >diff -u -r1.17 SimpleTest.java >--- src/org/eclipse/jdt/core/tests/eval/SimpleTest.java 24 May 2007 13:21:07 -0000 1.17 >+++ src/org/eclipse/jdt/core/tests/eval/SimpleTest.java 20 Feb 2008 07:00:40 -0000 >@@ -82,6 +82,7 @@ > } > } > } catch (ClassFormatException e) { >+ e.printStackTrace(); > } > } > } >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.36 >diff -u -r1.36 ComplianceDiagnoseTest.java >--- src/org/eclipse/jdt/core/tests/compiler/parser/ComplianceDiagnoseTest.java 31 Jan 2008 09:41:18 -0000 1.36 >+++ src/org/eclipse/jdt/core/tests/compiler/parser/ComplianceDiagnoseTest.java 20 Feb 2008 06:57:25 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2008 IBM Corporation and others. >+ * Copyright (c) 2000, 2007 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 >@@ -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 1.5\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.178 >diff -u -r1.178 AnnotationTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java 25 Jan 2008 12:44:40 -0000 1.178 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java 20 Feb 2008 06:57:40 -0000 >@@ -5820,15 +5820,30 @@ > "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" + >+ "The method initialize(Zork, String, Thread) from the type Y refers to the missing type Zork\n" + > "----------\n" + > "----------\n" + >- "1. ERROR in Y.java (at line 6)\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" + >+ "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" + >@@ -5859,13 +5874,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" + >+ "Zork cannot be resolved to a type\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 >@@ -6593,7 +6618,7 @@ > "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" + >+ "The method bar(NonExisting) from the type X refers to the missing type NonExisting\n" + > "----------\n" + > "2. ERROR in X.java (at line 4)\n" + > " private NonExisting bar(NonExisting ne){}\n" + >@@ -6655,7 +6680,7 @@ > "1. ERROR in X.java (at line 2)\n" + > " @Ann(m=bar())\n" + > " ^^^\n" + >- "The method bar() is undefined for the type X\n" + >+ "The method bar() from the type X refers to the missing type NonExisting\n" + > "----------\n" + > "2. ERROR in X.java (at line 4)\n" + > " private NonExisting bar(){}\n" + >@@ -6681,14 +6706,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" + >+ "NonExisting cannot be resolved to a type\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" + >@@ -7391,10 +7421,15 @@ > "----------\n" + > "3. ERROR in X.java (at line 6)\n" + > " @Annot(value={x}, classe={Zork.class,zork})\n" + >+ " ^^^^^^^^^^\n" + >+ "Class<Zork> cannot be resolved to a type\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" + >@@ -7633,6 +7668,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" + >+ "ArrayList cannot be resolved to a type\n" + > "----------\n"); > } > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=207758 - variation >@@ -7655,7 +7695,7 @@ > "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" + >+ "The method bar() from the type X refers to the missing type ArrayList\n" + > "----------\n" + > "2. ERROR in X.java (at line 7)\n" + > " ArrayList bar() {\n" + >@@ -8112,12 +8152,14 @@ > String expectedOutput = > " RuntimeVisibleParameterAnnotations: \n" + > " Number of annotations for parameter 0: 1\n" + >- " #21 @java.lang.Deprecated(\n" + >+ " #22 @java.lang.Deprecated(\n" + > " )\n" + > " RuntimeInvisibleParameterAnnotations: \n" + >- " Number of annotations for parameter 0: 1\n" + >- " #17 @Annot(\n" + >- " #18 value=(int) 2 (constant type)\n" + >+ " Number of annotations for parameter 0: 2\n" + >+ " #17 @Zork(\n" + >+ " )\n" + >+ " #18 @Annot(\n" + >+ " #19 value=(int) 2 (constant type)\n" + > " )\n"; > checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM); > } >@@ -8152,10 +8194,14 @@ > String expectedOutput = > " RuntimeVisibleParameterAnnotations: \n" + > " Number of annotations for parameter 0: 2\n" + >- " #17 @java.lang.Deprecated(\n" + >+ " #19 @java.lang.Deprecated(\n" + > " )\n" + >- " #18 @Annot(\n" + >- " #19 value=(int) 2 (constant type)\n" + >+ " #20 @Annot(\n" + >+ " #21 value=(int) 2 (constant type)\n" + >+ " )\n" + >+ " RuntimeInvisibleParameterAnnotations: \n" + >+ " Number of annotations for parameter 0: 1\n" + >+ " #17 @Zork(\n" + > " )\n"; > checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM); > } >@@ -8190,11 +8236,16 @@ > String expectedOutput = > " RuntimeVisibleParameterAnnotations: \n" + > " Number of annotations for parameter 0: 1\n" + >- " #17 @java.lang.Deprecated(\n" + >+ " #19 @java.lang.Deprecated(\n" + > " )\n" + > " Number of annotations for parameter 1: 1\n" + >- " #18 @Annot(\n" + >- " #19 value=(int) 3 (constant type)\n" + >+ " #20 @Annot(\n" + >+ " #21 value=(int) 3 (constant type)\n" + >+ " )\n" + >+ " RuntimeInvisibleParameterAnnotations: \n" + >+ " Number of annotations for parameter 0: 0\n" + >+ " Number of annotations for parameter 1: 1\n" + >+ " #17 @Zork(\n" + > " )\n"; > checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM); > } >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.688 >diff -u -r1.688 GenericTypeTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java 1 Feb 2008 16:15:37 -0000 1.688 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java 20 Feb 2008 06:59:20 -0000 >@@ -1112,6 +1112,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"); >@@ -3982,10 +3987,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" + >@@ -16977,7 +16987,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" + >@@ -18740,22 +18755,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() { >@@ -26632,7 +26647,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" + >@@ -31152,7 +31172,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" + >@@ -39501,8 +39526,8 @@ > "----------\n" + > "3. ERROR in X.java (at line 4)\n" + > " Runnable r = x.get();\n" + >- " ^^^^^^^\n" + >- "Type mismatch: cannot convert from Object to Runnable\n" + >+ " ^^^\n" + >+ "The method get() from the type X refers to the missing type Zork\n" + > "----------\n"); > } > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=203587 >@@ -40050,6 +40075,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" + >@@ -40061,6 +40091,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( >@@ -40549,7 +40584,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" + >@@ -40614,7 +40649,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"); > } >@@ -40673,7 +40708,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"); > } >@@ -40795,7 +40830,7 @@ > " ^^^^^^^^^^^^^^^^^^\n" + > "Cannot cast from Set<String> to String\n" + > "----------\n"); >-} >+} > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=207959 > public void test1222() { > this.runNegativeTest( >@@ -41570,11 +41605,6 @@ > " public class X<T extends Secondary.Private> {\n" + > " ^^^^^^^^^^^^^^^^^\n" + > "The type Secondary.Private is not visible\n" + >- "----------\n" + >- "2. WARNING in X.java (at line 4)\n" + >- " static private class Private {}\n" + >- " ^^^^^^^\n" + >- "The type Secondary.Private is never used locally\n" + > "----------\n"); > } > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216100 - variation >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.31 >diff -u -r1.31 JavadocTest_1_3.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_3.java 31 Jan 2008 09:41:18 -0000 1.31 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_3.java 20 Feb 2008 06:59:51 -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 1.5\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(E) refers to the missing type E\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 1.5\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 1.5\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"); > } > >@@ -1629,14 +1619,23 @@ > "12. ERROR in Test.java (at line 19)\n" + > " Sub (E e) {super(null);}\n" + > " ^^^^^^^^^^^^\n" + >- "The constructor Object(null) is undefined\n" + >+ "The constructor Test(T) refers to the missing type T\n" + > "----------\n" + > "13. 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" + >+ "14. ERROR in Test.java (at line 21)\n" + >+ " if (e.doubleValue() > 0)\n" + >+ " ^\n" + >+ "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "15. ERROR in Test.java (at line 23)\n" + >+ " return super.add(e);\n" + >+ " ^^^\n" + >+ "The method add(T) from the type Test refers to the missing type T\n" + >+ "----------\n"); > } > public void testBug83127b() { > reportMissingJavadocTags = CompilerOptions.IGNORE; >@@ -1718,12 +1717,22 @@ > "10. ERROR in Test.java (at line 19)\n" + > " Sub (E e) {super(null);}\n" + > " ^^^^^^^^^^^^\n" + >- "The constructor Object(null) is undefined\n" + >+ "The constructor Test(T) refers to the missing type T\n" + > "----------\n" + > "11. ERROR in Test.java (at line 20)\n" + > " public boolean add(E e) {\n" + > " ^\n" + > "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "12. ERROR in Test.java (at line 21)\n" + >+ " if (e.doubleValue() > 0)\n" + >+ " ^\n" + >+ "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "13. ERROR in Test.java (at line 23)\n" + >+ " return super.add(e);\n" + >+ " ^^^\n" + >+ "The method add(T) from the type Test refers to the missing type T\n" + > "----------\n" > ); > } >@@ -1804,12 +1813,22 @@ > "10. ERROR in Test.java (at line 16)\n" + > " Sub (E e) {super(null);}\n" + > " ^^^^^^^^^^^^\n" + >- "The constructor Object(null) is undefined\n" + >+ "The constructor Test(T) refers to the missing type T\n" + > "----------\n" + > "11. ERROR in Test.java (at line 17)\n" + > " public boolean add(E e) {\n" + > " ^\n" + > "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "12. ERROR in Test.java (at line 18)\n" + >+ " if (e.doubleValue() > 0)\n" + >+ " ^\n" + >+ "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "13. ERROR in Test.java (at line 20)\n" + >+ " return super.add(e);\n" + >+ " ^^^\n" + >+ "The method add(T) from the type Test refers to the missing type T\n" + > "----------\n" > ); > } >@@ -1911,12 +1930,22 @@ > "10. ERROR in Test.java (at line 16)\n" + > " Sub (E e) {super(null);}\n" + > " ^^^^^^^^^^^^\n" + >- "The constructor Object(null) is undefined\n" + >+ "The constructor Test(T) refers to the missing type T\n" + > "----------\n" + > "11. ERROR in Test.java (at line 17)\n" + > " public boolean add(E e) {\n" + > " ^\n" + > "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "12. ERROR in Test.java (at line 18)\n" + >+ " if (e.doubleValue() > 0)\n" + >+ " ^\n" + >+ "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "13. ERROR in Test.java (at line 20)\n" + >+ " return super.add(e);\n" + >+ " ^^^\n" + >+ "The method add(T) from the type Test refers to the missing type T\n" + > "----------\n" > ); > } >@@ -1973,7 +2002,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" + >@@ -2018,12 +2047,22 @@ > "10. ERROR in Test.java (at line 16)\n" + > " Sub (E e) {super(null);}\n" + > " ^^^^^^^^^^^^\n" + >- "The constructor Object(null) is undefined\n" + >+ "The constructor Test(T) refers to the missing type T\n" + > "----------\n" + > "11. ERROR in Test.java (at line 17)\n" + > " public boolean add(E e) {\n" + > " ^\n" + > "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "12. ERROR in Test.java (at line 18)\n" + >+ " if (e.doubleValue() > 0)\n" + >+ " ^\n" + >+ "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "13. ERROR in Test.java (at line 20)\n" + >+ " return super.add(e);\n" + >+ " ^^^\n" + >+ "The method add(T) from the type Test refers to the missing type T\n" + > "----------\n" > ); > } >@@ -2060,76 +2099,86 @@ > "}\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 1.5\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 1.5\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 1.5\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 1.5\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" + >+ "10. ERROR in Test.java (at line 15)\n" + >+ " Sub (E e) {super(null);}\n" + > " ^^^^^^^^^^^^\n" + >- "The constructor Object(null) is undefined\n" + >+ "The constructor Test(T) refers to the missing type T\n" + > "----------\n" + >- "11. ERROR in Test.java (at line 16)\r\n" + >- " public boolean add(E e) {\r\n" + >+ "11. ERROR in Test.java (at line 16)\n" + >+ " public boolean add(E e) {\n" + > " ^\n" + > "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "12. ERROR in Test.java (at line 17)\n" + >+ " if (e.doubleValue() > 0)\n" + >+ " ^\n" + >+ "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "13. ERROR in Test.java (at line 19)\n" + >+ " return super.add(e);\n" + >+ " ^^^\n" + >+ "The method add(T) from the type Test refers to the missing type T\n" + > "----------\n" > ); > } >@@ -2187,7 +2236,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" + >@@ -2232,12 +2281,22 @@ > "10. ERROR in Test.java (at line 17)\n" + > " Sub (E e) {super(null);}\n" + > " ^^^^^^^^^^^^\n" + >- "The constructor Object(null) is undefined\n" + >+ "The constructor Test(T) refers to the missing type T\n" + > "----------\n" + > "11. ERROR in Test.java (at line 18)\n" + > " public boolean add(E e) {\n" + > " ^\n" + > "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "12. ERROR in Test.java (at line 19)\n" + >+ " if (e.doubleValue() > 0)\n" + >+ " ^\n" + >+ "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "13. ERROR in Test.java (at line 21)\n" + >+ " return super.add(e);\n" + >+ " ^^^\n" + >+ "The method add(T) from the type Test refers to the missing type T\n" + > "----------\n" > ); > } >@@ -2330,12 +2389,22 @@ > "9. ERROR in Test.java (at line 18)\n" + > " Sub (E e) {super(null);}\n" + > " ^^^^^^^^^^^^\n" + >- "The constructor Object(null) is undefined\n" + >+ "The constructor Test(T) refers to the missing type T\n" + > "----------\n" + > "10. ERROR in Test.java (at line 19)\n" + > " public boolean add(E e) {\n" + > " ^\n" + > "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "11. ERROR in Test.java (at line 20)\n" + >+ " if (e.doubleValue() > 0)\n" + >+ " ^\n" + >+ "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "12. ERROR in Test.java (at line 22)\n" + >+ " return super.add(e);\n" + >+ " ^^^\n" + >+ "The method add(T) from the type Test refers to the missing type T\n" + > "----------\n"); > } > >@@ -3707,32 +3776,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 1.5\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.143 >diff -u -r1.143 MethodVerifyTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java 17 Jan 2008 13:02:17 -0000 1.143 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java 20 Feb 2008 07:00:21 -0000 >@@ -7091,8 +7091,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.34 >diff -u -r1.34 JavadocTest_1_4.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_4.java 31 Jan 2008 09:41:18 -0000 1.34 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_4.java 20 Feb 2008 06:59:58 -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 1.5\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(E) refers to the missing type E\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 1.5\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 1.5\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"); > } > > /** >@@ -1631,14 +1619,23 @@ > "12. ERROR in Test.java (at line 19)\n" + > " Sub (E e) {super(null);}\n" + > " ^^^^^^^^^^^^\n" + >- "The constructor Object(null) is undefined\n" + >+ "The constructor Test(T) refers to the missing type T\n" + > "----------\n" + > "13. 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" + >+ "14. ERROR in Test.java (at line 21)\n" + >+ " if (e.doubleValue() > 0)\n" + >+ " ^\n" + >+ "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "15. ERROR in Test.java (at line 23)\n" + >+ " return super.add(e);\n" + >+ " ^^^\n" + >+ "The method add(T) from the type Test refers to the missing type T\n" + >+ "----------\n"); > } > public void testBug83127b() { > reportMissingJavadocTags = CompilerOptions.IGNORE; >@@ -1720,14 +1717,23 @@ > "10. ERROR in Test.java (at line 19)\n" + > " Sub (E e) {super(null);}\n" + > " ^^^^^^^^^^^^\n" + >- "The constructor Object(null) is undefined\n" + >+ "The constructor Test(T) refers to the missing type T\n" + > "----------\n" + > "11. 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" + >+ "12. ERROR in Test.java (at line 21)\n" + >+ " if (e.doubleValue() > 0)\n" + >+ " ^\n" + >+ "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "13. ERROR in Test.java (at line 23)\n" + >+ " return super.add(e);\n" + >+ " ^^^\n" + >+ "The method add(T) from the type Test refers to the missing type T\n" + >+ "----------\n"); > } > public void testBug83127c() { > reportMissingJavadocTags = CompilerOptions.IGNORE; >@@ -1806,14 +1812,23 @@ > "10. ERROR in Test.java (at line 16)\n" + > " Sub (E e) {super(null);}\n" + > " ^^^^^^^^^^^^\n" + >- "The constructor Object(null) is undefined\n" + >+ "The constructor Test(T) refers to the missing type T\n" + > "----------\n" + > "11. ERROR in Test.java (at line 17)\n" + > " public boolean add(E e) {\n" + > " ^\n" + > "E cannot be resolved to a type\n" + >- "----------\n" >- ); >+ "----------\n" + >+ "12. ERROR in Test.java (at line 18)\n" + >+ " if (e.doubleValue() > 0)\n" + >+ " ^\n" + >+ "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "13. ERROR in Test.java (at line 20)\n" + >+ " return super.add(e);\n" + >+ " ^^^\n" + >+ "The method add(T) from the type Test refers to the missing type T\n" + >+ "----------\n"); > } > public void testBug83127d() { > reportMissingJavadocTags = CompilerOptions.IGNORE; >@@ -1913,14 +1928,23 @@ > "10. ERROR in Test.java (at line 16)\n" + > " Sub (E e) {super(null);}\n" + > " ^^^^^^^^^^^^\n" + >- "The constructor Object(null) is undefined\n" + >+ "The constructor Test(T) refers to the missing type T\n" + > "----------\n" + > "11. ERROR in Test.java (at line 17)\n" + > " public boolean add(E e) {\n" + > " ^\n" + > "E cannot be resolved to a type\n" + >- "----------\n" >- ); >+ "----------\n" + >+ "12. ERROR in Test.java (at line 18)\n" + >+ " if (e.doubleValue() > 0)\n" + >+ " ^\n" + >+ "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "13. ERROR in Test.java (at line 20)\n" + >+ " return super.add(e);\n" + >+ " ^^^\n" + >+ "The method add(T) from the type Test refers to the missing type T\n" + >+ "----------\n"); > } > public void testBug83127e() { > reportMissingJavadocTags = CompilerOptions.IGNORE; >@@ -1975,7 +1999,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" + >@@ -2020,14 +2044,23 @@ > "10. ERROR in Test.java (at line 16)\n" + > " Sub (E e) {super(null);}\n" + > " ^^^^^^^^^^^^\n" + >- "The constructor Object(null) is undefined\n" + >+ "The constructor Test(T) refers to the missing type T\n" + > "----------\n" + > "11. ERROR in Test.java (at line 17)\n" + > " public boolean add(E e) {\n" + > " ^\n" + > "E cannot be resolved to a type\n" + >- "----------\n" >- ); >+ "----------\n" + >+ "12. ERROR in Test.java (at line 18)\n" + >+ " if (e.doubleValue() > 0)\n" + >+ " ^\n" + >+ "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "13. ERROR in Test.java (at line 20)\n" + >+ " return super.add(e);\n" + >+ " ^^^\n" + >+ "The method add(T) from the type Test refers to the missing type T\n" + >+ "----------\n"); > } > public void testBug83127f() { > reportMissingJavadocTags = CompilerOptions.IGNORE; >@@ -2062,78 +2095,87 @@ > "}\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 1.5\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 1.5\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 1.5\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 1.5\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" + >+ "10. ERROR in Test.java (at line 15)\n" + >+ " Sub (E e) {super(null);}\n" + > " ^^^^^^^^^^^^\n" + >- "The constructor Object(null) is undefined\n" + >+ "The constructor Test(T) refers to the missing type T\n" + > "----------\n" + >- "11. ERROR in Test.java (at line 16)\r\n" + >- " public boolean add(E e) {\r\n" + >+ "11. ERROR in Test.java (at line 16)\n" + >+ " public boolean add(E e) {\n" + > " ^\n" + > "E cannot be resolved to a type\n" + >- "----------\n" >- ); >+ "----------\n" + >+ "12. ERROR in Test.java (at line 17)\n" + >+ " if (e.doubleValue() > 0)\n" + >+ " ^\n" + >+ "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "13. ERROR in Test.java (at line 19)\n" + >+ " return super.add(e);\n" + >+ " ^^^\n" + >+ "The method add(T) from the type Test refers to the missing type T\n" + >+ "----------\n"); > } > public void testBug83127g() { > reportMissingJavadocTags = CompilerOptions.IGNORE; >@@ -2189,7 +2231,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" + >@@ -2234,14 +2276,23 @@ > "10. ERROR in Test.java (at line 17)\n" + > " Sub (E e) {super(null);}\n" + > " ^^^^^^^^^^^^\n" + >- "The constructor Object(null) is undefined\n" + >+ "The constructor Test(T) refers to the missing type T\n" + > "----------\n" + > "11. ERROR in Test.java (at line 18)\n" + > " public boolean add(E e) {\n" + > " ^\n" + > "E cannot be resolved to a type\n" + >- "----------\n" >- ); >+ "----------\n" + >+ "12. ERROR in Test.java (at line 19)\n" + >+ " if (e.doubleValue() > 0)\n" + >+ " ^\n" + >+ "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "13. ERROR in Test.java (at line 21)\n" + >+ " return super.add(e);\n" + >+ " ^^^\n" + >+ "The method add(T) from the type Test refers to the missing type T\n" + >+ "----------\n"); > } > public void testBug83127h() { > reportMissingJavadocTags = CompilerOptions.IGNORE; >@@ -2332,14 +2383,23 @@ > "9. ERROR in Test.java (at line 18)\n" + > " Sub (E e) {super(null);}\n" + > " ^^^^^^^^^^^^\n" + >- "The constructor Object(null) is undefined\n" + >+ "The constructor Test(T) refers to the missing type T\n" + > "----------\n" + > "10. ERROR in Test.java (at line 19)\n" + > " public boolean add(E e) {\n" + > " ^\n" + > "E cannot be resolved to a type\n" + >- "----------\n" >- ); >+ "----------\n" + >+ "11. ERROR in Test.java (at line 20)\n" + >+ " if (e.doubleValue() > 0)\n" + >+ " ^\n" + >+ "E cannot be resolved to a type\n" + >+ "----------\n" + >+ "12. ERROR in Test.java (at line 22)\n" + >+ " return super.add(e);\n" + >+ " ^^^\n" + >+ "The method add(T) from the type Test refers to the missing type T\n" + >+ "----------\n"); > } > > /** >@@ -3701,27 +3761,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 1.5\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/CompilerInvocationTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java,v >retrieving revision 1.12 >diff -u -r1.12 CompilerInvocationTests.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java 21 Nov 2007 17:54:29 -0000 1.12 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java 20 Feb 2008 06:57:46 -0000 >@@ -393,6 +393,8 @@ > expectedProblemAttributes.put("NonStaticAccessToStaticMethod", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); > expectedProblemAttributes.put("UnusedPrivateMethod", new ProblemAttributes(CategorizedProblem.CAT_UNNECESSARY_CODE)); > expectedProblemAttributes.put("IndirectAccessToStaticMethod", new ProblemAttributes(CategorizedProblem.CAT_CODE_STYLE)); >+ expectedProblemAttributes.put("MissingTypeInMethod", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); >+ expectedProblemAttributes.put("MissingTypeInConstructor", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); > expectedProblemAttributes.put("UndefinedConstructor", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); > expectedProblemAttributes.put("NotVisibleConstructor", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); > expectedProblemAttributes.put("AmbiguousConstructor", new ProblemAttributes(CategorizedProblem.CAT_MEMBER)); >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.97 >diff -u -r1.97 Compliance_1_3.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_3.java 31 Jan 2008 09:41:18 -0000 1.97 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_3.java 20 Feb 2008 06:57:51 -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.3 >diff -u -r1.3 ProblemTypeAndMethodTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/ProblemTypeAndMethodTest.java 20 Dec 2007 16:29:51 -0000 1.3 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/ProblemTypeAndMethodTest.java 20 Feb 2008 07:00:27 -0000 >@@ -14,7 +14,10 @@ > > import junit.framework.Test; > >+import org.eclipse.jdt.core.ToolFactory; > import org.eclipse.jdt.core.tests.util.Util; >+import org.eclipse.jdt.core.util.ClassFileBytesDisassembler; >+import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; > import org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader; > import org.eclipse.jdt.internal.compiler.env.IBinaryMethod; > >@@ -115,77 +118,117 @@ > } > assertEquals("Wrong number of foo method", 1, counter); > } >-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >-public void test016() { >+ >+public void test002() { > this.runNegativeTest(new String[] { > "X.java", >- "public class X {\n" + >- " java.langz.AClass1 field1;\n" + >- " java.langz.AClass2 field2;\n" + >+ "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 2)\n" + >- " java.langz.AClass1 field1;\n" + >- " ^^^^^^^^^^\n" + >- "java.langz cannot be resolved to a type\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" + >- " java.langz.AClass2 field2;\n" + >- " ^^^^^^^^^^\n" + >- "java.langz cannot be resolved to a type\n" + >- "----------\n"); >-} >-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >-public void test017() { >- this.runNegativeTest(new String[] { >- "X.java", >- "public class X {\n" + >- " java.langz field1;\n" + >- " java.langz.AClass2 field2;\n" + >- "}\n", >- }, >+ " Zork z = this;\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + > "----------\n" + >- "1. ERROR in X.java (at line 2)\n" + >- " java.langz field1;\n" + >- " ^^^^^^^^^^\n" + >- "java.langz cannot be resolved to a type\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" + >- "2. ERROR in X.java (at line 3)\n" + >- " java.langz.AClass2 field2;\n" + >- " ^^^^^^^^^^\n" + >- "java.langz cannot be resolved to a type\n" + >+ "4. ERROR in X.java (at line 5)\n" + >+ " Zork2 z2 = this;\n" + >+ " ^^^^^\n" + >+ "Zork2 cannot be resolved to a type\n" + > "----------\n"); > } >-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >-public void test018() { >+ >+public void test003() { > this.runNegativeTest(new String[] { > "X.java", > "public class X {\n" + >- " java.langz.AClass1 field1;\n" + >- " java.langz field2;\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" + >- " java.langz.AClass1 field1;\n" + >- " ^^^^^^^^^^\n" + >- "java.langz cannot be resolved to a type\n" + >+ " Zork field;\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + > "----------\n" + >- "2. ERROR in X.java (at line 3)\n" + >- " java.langz field2;\n" + >- " ^^^^^^^^^^\n" + >- "java.langz cannot be resolved to a type\n" + >+ "2. ERROR in X.java (at line 5)\n" + >+ " Object o = y.foo();\n" + >+ " ^^^\n" + >+ "The method foo() from the type Y refers to the missing type Zork\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 6)\n" + >+ " Object s = y.slot;\n" + >+ " ^^^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 7)\n" + >+ " y.bar(null);\n" + >+ " ^^^\n" + >+ "The method bar(Zork) from the type Y refers to the missing type Zork\n" + >+ "----------\n" + >+ "5. ERROR in X.java (at line 8)\n" + >+ " Object s2 = new Y().slot;\n" + >+ " ^^^^^^^^^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "6. ERROR in X.java (at line 9)\n" + >+ " Object f = field;\n" + >+ " ^^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "7. ERROR in X.java (at line 13)\n" + >+ " Zork foo() { return null; }\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "8. ERROR in X.java (at line 14)\n" + >+ " void bar(Zork z) {}\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "9. ERROR in X.java (at line 15)\n" + >+ " Zork slot;\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + > "----------\n"); > } >-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >-public void test019() { >+ >+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 >+public void test004() { > this.runConformTest( > new String[] { > "p/OtherFoo.java", //----------------------------------------------------------------------- > "package p;\n" + > "\n" + >- "import q1.q2.Zork;\n" + >+ "import q.Zork;\n" + > "\n" + > "public class OtherFoo extends Zork{\n" + > " public class OtherMember extends Zork {}\n" + >@@ -193,42 +236,195 @@ > " public Zork bar() { return null; }\n" + > " public void baz(Zork z) {}\n" + > "}\n", >- "q1/q2/Zork.java", //----------------------------------------------------------------------- >- "package q1.q2;\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 folder q1 (i.e. simulate removing it from classpath for subsequent compile) >- Util.delete(new File(OUTPUT_DIR, "q1")); >+ // 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(p.OtherFoo ofoo) {\n" + // triggers OtherFoo loading, and q1.q2 pkg creation (for unresolved binary type refs) >- " a.b.Missing1 m1;\n" + >- " q1.q2.Missing2 m2;\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" + >- "} \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 3)\n" + >- " a.b.Missing1 m1;\n" + >+ "1. ERROR in X.java (at line 1)\n" + >+ " import p.OtherFoo;\n" + > " ^\n" + >- "a cannot be resolved to a type\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 4)\n" + >- " q1.q2.Missing2 m2;\n" + >- " ^^^^^^^^^^^^^^\n" + >- "q1.q2.Missing2 cannot be resolved to a type\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" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 8)\n" + >+ " String s2 = ofoo.bar();\n" + >+ " ^^^\n" + >+ "The method bar() from the type OtherFoo refers to the missing type Zork\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) from the type OtherFoo refers to the missing type Zork\n" + >+ "----------\n" + >+ "7. ERROR in X.java (at line 14)\n" + >+ " String s1 = ox.foo;\n" + >+ " ^^^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "8. ERROR in X.java (at line 15)\n" + >+ " String s2 = ox.bar();\n" + >+ " ^^^\n" + >+ "The method bar() from the type OtherX refers to the missing type Zork\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) from the type OtherX refers to the missing type Zork\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); > } > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >-public void test020() { >+public void test005() { > this.runConformTest( > new String[] { > "p/OtherFoo.java", //----------------------------------------------------------------------- >@@ -249,68 +445,102 @@ > }, > ""); > >- // no need to delete Zork actually - any lazy reference would cause q1.q2 to be created as a package >+ // delete binary folder q1 (i.e. simulate removing it from classpath for subsequent compile) >+ Util.delete(new File(OUTPUT_DIR, "q1")); > > this.runNegativeTest( > new String[] { > "X.java", //----------------------------------------------------------------------- > "public class X {\n" + >- " void foo(p.OtherFoo ofoo) {\n" + // triggers OtherFoo loading, and q1.q2 pkg creation (for unresolved binary type refs) >- " a.b.Missing1 m1;\n" + >- " q1.q2.Missing2 m2;\n" + >+ " void foo() {\n" + >+ " p.OtherFoo ofoo = new p.OtherFoo();\n" + >+ " ofoo.bar();\n" + >+ " q1.q2.Zork z;\n" + > " }\n" + > "} \n", > }, > "----------\n" + >- "1. ERROR in X.java (at line 3)\n" + >- " a.b.Missing1 m1;\n" + >- " ^\n" + >- "a cannot be resolved to a type\n" + >+ "1. ERROR in X.java (at line 4)\n" + >+ " ofoo.bar();\n" + >+ " ^^^^^^^^^^\n" + >+ "The type q1.q2.Zork cannot be resolved. It is indirectly referenced from required .class files\n" + > "----------\n" + > "2. ERROR in X.java (at line 4)\n" + >- " q1.q2.Missing2 m2;\n" + >- " ^^^^^^^^^^^^^^\n" + >- "q1.q2.Missing2 cannot be resolved to a type\n" + >+ " ofoo.bar();\n" + >+ " ^^^\n" + >+ "The method bar() from the type OtherFoo refers to the missing type Zork\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 5)\n" + >+ " q1.q2.Zork z;\n" + >+ " ^^^^^^^^^^\n" + >+ "q1.q2.Zork cannot be resolved to a type\n" + > "----------\n", > null, > false); > } > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >-public void test021() { >+public void test006() { >+ this.runConformTest( >+ new String[] { >+ "p/OtherFoo.java", //----------------------------------------------------------------------- >+ "package p;\n" + >+ "\n" + >+ "import q1.q2.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", >+ "q1/q2/Zork.java", //----------------------------------------------------------------------- >+ "package q1.q2;\n" + >+ "public class Zork {\n" + >+ "}\n", >+ }, >+ ""); >+ >+ // delete binary folder q1 (i.e. simulate removing it from classpath for subsequent compile) >+ Util.delete(new File(OUTPUT_DIR, "q1")); >+ > this.runNegativeTest( > new String[] { > "X.java", //----------------------------------------------------------------------- >+ "import q1.q2.*;\n" + > "public class X {\n" + >- " void foo(p.OtherFoo ofoo) {\n" + >- " a.b.Missing1 m1;\n" + >- " q1.q2.Missing2 m2;\n" + >+ " void foo() {\n" + >+ " p.OtherFoo ofoo = new p.OtherFoo();\n" + >+ " ofoo.bar();\n" + >+ " Zork z;\n" + > " }\n" + > "} \n", >- "p/OtherFoo.java", //----------------------------------------------------------------------- >- "package p;\n" + >- "public class OtherFoo extends q1.q2.Zork{\n" + >- "}\n", > }, > "----------\n" + >- "1. ERROR in X.java (at line 3)\n" + >- " a.b.Missing1 m1;\n" + >- " ^\n" + >- "a cannot be resolved to a type\n" + >- "----------\n" + >- "2. ERROR in X.java (at line 4)\n" + >- " q1.q2.Missing2 m2;\n" + >- " ^^\n" + >- "q1 cannot be resolved to a type\n" + >- "----------\n" + >+ "1. ERROR in X.java (at line 1)\n" + >+ " import q1.q2.*;\n" + >+ " ^^\n" + >+ "The import q1 cannot be resolved\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 5)\n" + >+ " ofoo.bar();\n" + >+ " ^^^^^^^^^^\n" + >+ "The type q1.q2.Zork cannot be resolved. It is indirectly referenced from required .class files\n" + > "----------\n" + >- "1. ERROR in p\\OtherFoo.java (at line 2)\n" + >- " public class OtherFoo extends q1.q2.Zork{\n" + >- " ^^\n" + >- "q1 cannot be resolved to a type\n" + >- "----------\n"); >+ "3. ERROR in X.java (at line 5)\n" + >+ " ofoo.bar();\n" + >+ " ^^^\n" + >+ "The method bar() from the type OtherFoo refers to the missing type Zork\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 6)\n" + >+ " Zork z;\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n", >+ null, >+ false); > } > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >-public void test022() { >+public void test007() { > this.runConformTest( > new String[] { > "p/OtherFoo.java", //----------------------------------------------------------------------- >@@ -318,8 +548,11 @@ > "\n" + > "import q1.q2.Zork;\n" + > "\n" + >- "public class OtherFoo {\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", > "q1/q2/Zork.java", //----------------------------------------------------------------------- > "package q1.q2;\n" + >@@ -334,35 +567,41 @@ > this.runNegativeTest( > new String[] { > "X.java", //----------------------------------------------------------------------- >+ "import q1.q2.Zork;\n" + > "public class X {\n" + >- " void foo(q1.q2.Missing1 m1) {\n" + >- " a.b.Missing1 m1a;\n" + >- " p.OtherFoo ofoo;\n" + // triggers OtherFoo loading, and q1.q2 pkg creation (for unresolved binary type refs) >- " q1.q2.Missing1 m11;\n" + >+ " void foo() {\n" + >+ " p.OtherFoo ofoo = new p.OtherFoo();\n" + >+ " ofoo.bar();\n" + >+ " Zork z;\n" + > " }\n" + > "} \n", > }, > "----------\n" + >- "1. ERROR in X.java (at line 2)\n" + >- " void foo(q1.q2.Missing1 m1) {\n" + >- " ^^\n" + >- "q1 cannot be resolved to a type\n" + >- "----------\n" + >- "2. ERROR in X.java (at line 3)\n" + >- " a.b.Missing1 m1a;\n" + >- " ^\n" + >- "a cannot be resolved to a type\n" + >+ "1. ERROR in X.java (at line 1)\n" + >+ " import q1.q2.Zork;\n" + >+ " ^^\n" + >+ "The import q1 cannot be resolved\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 5)\n" + >+ " ofoo.bar();\n" + >+ " ^^^^^^^^^^\n" + >+ "The type q1.q2.Zork cannot be resolved. It is indirectly referenced from required .class files\n" + > "----------\n" + > "3. ERROR in X.java (at line 5)\n" + >- " q1.q2.Missing1 m11;\n" + >- " ^^\n" + >- "q1 cannot be resolved to a type\n" + >+ " ofoo.bar();\n" + >+ " ^^^\n" + >+ "The method bar() from the type OtherFoo refers to the missing type Zork\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 6)\n" + >+ " Zork z;\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + > "----------\n", > null, > false); > } > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >-public void test023() { >+public void test008() { > this.runConformTest( > new String[] { > "p/OtherFoo.java", //----------------------------------------------------------------------- >@@ -370,8 +609,11 @@ > "\n" + > "import q1.q2.Zork;\n" + > "\n" + >- "public class OtherFoo {\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", > "q1/q2/Zork.java", //----------------------------------------------------------------------- > "package q1.q2;\n" + >@@ -380,40 +622,29 @@ > }, > ""); > >- // leave package behind >+ // delete binary folder q1 (i.e. simulate removing it from classpath for subsequent compile) >+ Util.delete(new File(OUTPUT_DIR, "q1")); > > this.runNegativeTest( > new String[] { > "X.java", //----------------------------------------------------------------------- > "public class X {\n" + >- " void foo(q1.q2.Missing1 m1) {\n" + >- " a.b.Missing1 m1a;\n" + >- " p.OtherFoo ofoo;\n" + >- " q1.q2.Missing1 m11;\n" + >+ " void foo() {\n" + >+ " q1.q2.Zork z;\n" + > " }\n" + > "} \n", > }, > "----------\n" + >- "1. ERROR in X.java (at line 2)\n" + >- " void foo(q1.q2.Missing1 m1) {\n" + >- " ^^^^^^^^^^^^^^\n" + >- "q1.q2.Missing1 cannot be resolved to a type\n" + >- "----------\n" + >- "2. ERROR in X.java (at line 3)\n" + >- " a.b.Missing1 m1a;\n" + >- " ^\n" + >- "a cannot be resolved to a type\n" + >- "----------\n" + >- "3. ERROR in X.java (at line 5)\n" + >- " q1.q2.Missing1 m11;\n" + >- " ^^^^^^^^^^^^^^\n" + >- "q1.q2.Missing1 cannot be resolved to a type\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " q1.q2.Zork z;\n" + >+ " ^^\n" + >+ "q1 cannot be resolved to a type\n" + > "----------\n", > null, > false); > } > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >-public void test024() { >+public void test009() { > this.runConformTest( > new String[] { > "p/OtherFoo.java", //----------------------------------------------------------------------- >@@ -421,8 +652,11 @@ > "\n" + > "import q1.q2.Zork;\n" + > "\n" + >- "public class OtherFoo {\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", > "q1/q2/Zork.java", //----------------------------------------------------------------------- > "package q1.q2;\n" + >@@ -431,41 +665,35 @@ > }, > ""); > >- // delete binary folder q1/q2 (i.e. simulate removing it from classpath for subsequent compile) >- Util.delete(new File(OUTPUT_DIR, "q1/q2")); >+ // delete binary folder q1 (i.e. simulate removing it from classpath for subsequent compile) >+ Util.delete(new File(OUTPUT_DIR, "q1")); > > this.runNegativeTest( > new String[] { > "X.java", //----------------------------------------------------------------------- >+ "import q1.q2.*;\n" + > "public class X {\n" + >- " void foo(q1.q2.Missing1 m1) {\n" + >- " a.b.Missing1 m1a;\n" + >- " p.OtherFoo ofoo;\n" + // triggers OtherFoo loading, and q1.q2 pkg creation (for unresolved binary type refs) >- " q1.q2.Missing1 m11;\n" + >+ " void foo() {\n" + >+ " Zork z;\n" + > " }\n" + > "} \n", > }, > "----------\n" + >- "1. ERROR in X.java (at line 2)\n" + >- " void foo(q1.q2.Missing1 m1) {\n" + >- " ^^^^^\n" + >- "q1.q2 cannot be resolved to a type\n" + >- "----------\n" + >- "2. ERROR in X.java (at line 3)\n" + >- " a.b.Missing1 m1a;\n" + >- " ^\n" + >- "a cannot be resolved to a type\n" + >+ "1. ERROR in X.java (at line 1)\n" + >+ " import q1.q2.*;\n" + >+ " ^^\n" + >+ "The import q1 cannot be resolved\n" + > "----------\n" + >- "3. ERROR in X.java (at line 5)\n" + >- " q1.q2.Missing1 m11;\n" + >- " ^^^^^^^^^^^^^^\n" + >- "q1.q2.Missing1 cannot be resolved to a type\n" + // inconsistent msg from previous one (error 1) >+ "2. ERROR in X.java (at line 4)\n" + >+ " Zork z;\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + > "----------\n", > null, > false); > } > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >-public void test025() { >+public void test010() { > this.runConformTest( > new String[] { > "p/OtherFoo.java", //----------------------------------------------------------------------- >@@ -473,8 +701,11 @@ > "\n" + > "import q1.q2.Zork;\n" + > "\n" + >- "public class OtherFoo {\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", > "q1/q2/Zork.java", //----------------------------------------------------------------------- > "package q1.q2;\n" + >@@ -483,44 +714,2300 @@ > }, > ""); > >- // delete binary folder q1/q2 (i.e. simulate removing it from classpath for subsequent compile) >- Util.delete(new File(OUTPUT_DIR, "q1/q2")); >+ // delete binary folder q1 (i.e. simulate removing it from classpath for subsequent compile) >+ Util.delete(new File(OUTPUT_DIR, "q1")); > > this.runNegativeTest( > new String[] { > "X.java", //----------------------------------------------------------------------- >+ "import q1.q2.Zork;\n" + > "public class X {\n" + >- " void foo(q1.q2.Missing1 m1) {\n" + >- " a.b.Missing1 m1a;\n" + >- " p.OtherFoo ofoo;\n" + // triggers OtherFoo loading, and q1.q2 pkg creation (for unresolved binary type refs) >- " }\n" + >- "} \n", >- "Y.java", //----------------------------------------------------------------------- >- "public class Y {\n" + >- " void foo() {\n" + >- " q1.q2.Missing1 m11;\n" + >+ " void foo() {\n" + >+ " Zork z;\n" + > " }\n" + > "} \n", > }, > "----------\n" + >- "1. ERROR in X.java (at line 2)\n" + >- " void foo(q1.q2.Missing1 m1) {\n" + >- " ^^^^^\n" + >- "q1.q2 cannot be resolved to a type\n" + >+ "1. ERROR in X.java (at line 1)\n" + >+ " import q1.q2.Zork;\n" + >+ " ^^\n" + >+ "The import q1 cannot be resolved\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 4)\n" + >+ " Zork z;\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n", >+ null, >+ false); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test011() { >+ this.runNegativeTest(new String[] { >+ "X.java", >+ "public class X {\n" + >+ " java[] field1;\n" + >+ " java.lang[] field2;\n" + >+ " void field3;\n" + >+ " void[] field4;\n" + >+ " \n" + >+ "}\n", >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 2)\n" + >+ " java[] field1;\n" + >+ " ^^^^\n" + >+ "java cannot be resolved to a type\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 3)\n" + >+ " java.lang[] field2;\n" + >+ " ^^^^^^^^^\n" + >+ "java.lang cannot be resolved to a type\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 4)\n" + >+ " void field3;\n" + >+ " ^^^^^^\n" + >+ "void is an invalid type for the variable field3\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 5)\n" + >+ " void[] field4;\n" + >+ " ^^^^^^\n" + >+ "void[] is an invalid type\n" + >+ "----------\n"); >+} >+public void test012() { >+ String expectedResult; >+ if (this.complianceLevel <= ClassFileConstants.JDK1_4) { >+ expectedResult = >+ "----------\n" + >+ "1. ERROR in X.java (at line 2)\n" + >+ " Class c1 = java[].class;\n" + >+ " ^^^^\n" + >+ "java cannot be resolved to a type\n" + > "----------\n" + > "2. ERROR in X.java (at line 3)\n" + >- " a.b.Missing1 m1a;\n" + >+ " Class c2 = java.lang[].class;\n" + >+ " ^^^^^^^^^\n" + >+ "java.lang cannot be resolved to a type\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 5)\n" + >+ " Class c4 = void[].class;\n" + >+ " ^^^^^^\n" + >+ "void[] is an invalid type\n" + >+ "----------\n"; >+ } else { >+ expectedResult = >+ "----------\n" + >+ "1. WARNING in X.java (at line 2)\n" + >+ " Class c1 = java[].class;\n" + >+ " ^^^^^\n" + >+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 2)\n" + >+ " Class c1 = java[].class;\n" + >+ " ^^^^\n" + >+ "java cannot be resolved to a type\n" + >+ "----------\n" + >+ "3. WARNING in X.java (at line 3)\n" + >+ " Class c2 = java.lang[].class;\n" + >+ " ^^^^^\n" + >+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 3)\n" + >+ " Class c2 = java.lang[].class;\n" + >+ " ^^^^^^^^^\n" + >+ "java.lang cannot be resolved to a type\n" + >+ "----------\n" + >+ "5. WARNING in X.java (at line 4)\n" + >+ " Class c3 = void.class;\n" + >+ " ^^^^^\n" + >+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" + >+ "----------\n" + >+ "6. WARNING in X.java (at line 5)\n" + >+ " Class c4 = void[].class;\n" + >+ " ^^^^^\n" + >+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" + >+ "----------\n" + >+ "7. ERROR in X.java (at line 5)\n" + >+ " Class c4 = void[].class;\n" + >+ " ^^^^^^\n" + >+ "void[] is an invalid type\n" + >+ "----------\n"; >+ } >+ this.runNegativeTest(new String[] { >+ "X.java", >+ "public class X {\n" + >+ " Class c1 = java[].class;\n" + >+ " Class c2 = java.lang[].class;\n" + >+ " Class c3 = void.class;\n" + >+ " Class c4 = void[].class;\n" + >+ "}\n", >+ }, >+ expectedResult); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test013() { >+ String expectedResult; >+ if (this.complianceLevel <= ClassFileConstants.JDK1_4) { >+ expectedResult = >+ "----------\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " Class c2 = java.lang[].class;\n" + >+ " ^^^^^^^^^\n" + >+ "java.lang cannot be resolved to a type\n" + >+ "----------\n"; >+ } else { >+ expectedResult = >+ "----------\n" + >+ "1. WARNING in X.java (at line 3)\n" + >+ " Class c2 = java.lang[].class;\n" + >+ " ^^^^^\n" + >+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 3)\n" + >+ " Class c2 = java.lang[].class;\n" + >+ " ^^^^^^^^^\n" + >+ "java.lang cannot be resolved to a type\n" + >+ "----------\n"; >+ } >+ this.runNegativeTest(new String[] { >+ "X.java", >+ "public class X {\n" + >+ " // check if no prior reference to missing 'java'\n" + >+ " Class c2 = java.lang[].class;\n" + >+ "}\n", >+ }, >+ expectedResult); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test014() { >+ String expectedResult; >+ if (this.complianceLevel <= ClassFileConstants.JDK1_4) { >+ expectedResult = >+ "----------\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " Class c2 = java.lang[].class;\n" + >+ " ^^^^^^^^^\n" + >+ "java.lang cannot be resolved to a type\n" + >+ "----------\n"; >+ } else { >+ expectedResult = >+ "----------\n" + >+ "1. WARNING in X.java (at line 3)\n" + >+ " Class c2 = java.lang[].class;\n" + >+ " ^^^^^\n" + >+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 3)\n" + >+ " Class c2 = java.lang[].class;\n" + >+ " ^^^^^^^^^\n" + >+ "java.lang cannot be resolved to a type\n" + >+ "----------\n"; >+ } >+ this.runNegativeTest(new String[] { >+ "X.java", >+ "public class X {\n" + >+ " // check if no prior reference to missing 'java'\n" + >+ " Class c2 = java.lang[].class;\n" + >+ "}\n", >+ }, >+ expectedResult); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test015() { >+ String expectedResult; >+ if (this.complianceLevel <= ClassFileConstants.JDK1_4) { >+ expectedResult = >+ "----------\n" + >+ "1. ERROR in X.java (at line 2)\n" + >+ " Class a = zork1[].class;\n" + >+ " ^^^^^\n" + >+ "zork1 cannot be resolved to a type\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 3)\n" + >+ " Class x = zork1.zork2[].class; // compile time error\n" + >+ " ^^^^^\n" + >+ "zork1 cannot be resolved to a type\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 5)\n" + >+ " Class a2 = zork1.class;\n" + >+ " ^^^^^\n" + >+ "zork1 cannot be resolved to a type\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 6)\n" + >+ " Class x2 = zork1.zork2.class; // compile time error \n" + >+ " ^^^^^\n" + >+ "zork1 cannot be resolved to a type\n" + >+ "----------\n"; >+ } else { >+ expectedResult = >+ "----------\n" + >+ "1. WARNING in X.java (at line 2)\n" + >+ " Class a = zork1[].class;\n" + >+ " ^^^^^\n" + >+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 2)\n" + >+ " Class a = zork1[].class;\n" + >+ " ^^^^^\n" + >+ "zork1 cannot be resolved to a type\n" + >+ "----------\n" + >+ "3. WARNING in X.java (at line 3)\n" + >+ " Class x = zork1.zork2[].class; // compile time error\n" + >+ " ^^^^^\n" + >+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 3)\n" + >+ " Class x = zork1.zork2[].class; // compile time error\n" + >+ " ^^^^^\n" + >+ "zork1 cannot be resolved to a type\n" + >+ "----------\n" + >+ "5. WARNING in X.java (at line 5)\n" + >+ " Class a2 = zork1.class;\n" + >+ " ^^^^^\n" + >+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" + >+ "----------\n" + >+ "6. ERROR in X.java (at line 5)\n" + >+ " Class a2 = zork1.class;\n" + >+ " ^^^^^\n" + >+ "zork1 cannot be resolved to a type\n" + >+ "----------\n" + >+ "7. WARNING in X.java (at line 6)\n" + >+ " Class x2 = zork1.zork2.class; // compile time error \n" + >+ " ^^^^^\n" + >+ "Class is a raw type. References to generic type Class<T> should be parameterized\n" + >+ "----------\n" + >+ "8. ERROR in X.java (at line 6)\n" + >+ " Class x2 = zork1.zork2.class; // compile time error \n" + >+ " ^^^^^\n" + >+ "zork1 cannot be resolved to a type\n" + >+ "----------\n"; >+ } >+ this.runNegativeTest(new String[] { >+ "X.java", >+ "public class X {\n" + >+ " Class a = zork1[].class;\n" + >+ " Class x = zork1.zork2[].class; // compile time error\n" + >+ " \n" + >+ " Class a2 = zork1.class;\n" + >+ " Class x2 = zork1.zork2.class; // compile time error \n" + >+ "}\n", >+ }, >+ expectedResult); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test016() { >+ this.runNegativeTest(new String[] { >+ "X.java", >+ "public class X {\n" + >+ " java.langz.AClass1 field1;\n" + >+ " java.langz.AClass2 field2;\n" + >+ "}\n", >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 2)\n" + >+ " java.langz.AClass1 field1;\n" + >+ " ^^^^^^^^^^\n" + >+ "java.langz cannot be resolved to a type\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 3)\n" + >+ " java.langz.AClass2 field2;\n" + >+ " ^^^^^^^^^^\n" + >+ "java.langz cannot be resolved to a type\n" + >+ "----------\n"); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test017() { >+ this.runNegativeTest(new String[] { >+ "X.java", >+ "public class X {\n" + >+ " java.langz field1;\n" + >+ " java.langz.AClass2 field2;\n" + >+ "}\n", >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 2)\n" + >+ " java.langz field1;\n" + >+ " ^^^^^^^^^^\n" + >+ "java.langz cannot be resolved to a type\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 3)\n" + >+ " java.langz.AClass2 field2;\n" + >+ " ^^^^^^^^^^\n" + >+ "java.langz cannot be resolved to a type\n" + >+ "----------\n"); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test018() { >+ this.runNegativeTest(new String[] { >+ "X.java", >+ "public class X {\n" + >+ " java.langz.AClass1 field1;\n" + >+ " java.langz field2;\n" + >+ "}\n", >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 2)\n" + >+ " java.langz.AClass1 field1;\n" + >+ " ^^^^^^^^^^\n" + >+ "java.langz cannot be resolved to a type\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 3)\n" + >+ " java.langz field2;\n" + >+ " ^^^^^^^^^^\n" + >+ "java.langz cannot be resolved to a type\n" + >+ "----------\n"); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test019() { >+ this.runConformTest( >+ new String[] { >+ "p/OtherFoo.java", //----------------------------------------------------------------------- >+ "package p;\n" + >+ "\n" + >+ "import q1.q2.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", >+ "q1/q2/Zork.java", //----------------------------------------------------------------------- >+ "package q1.q2;\n" + >+ "public class Zork {\n" + >+ "}\n", >+ }, >+ ""); >+ >+ // delete binary folder q1 (i.e. simulate removing it from classpath for subsequent compile) >+ Util.delete(new File(OUTPUT_DIR, "q1")); >+ >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "public class X {\n" + >+ " void foo(p.OtherFoo ofoo) {\n" + // triggers OtherFoo loading, and q1.q2 pkg creation (for unresolved binary type refs) >+ " a.b.Missing1 m1;\n" + >+ " q1.q2.Missing2 m2;\n" + >+ " }\n" + >+ "} \n", >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " a.b.Missing1 m1;\n" + > " ^\n" + > "a cannot be resolved to a type\n" + > "----------\n" + >+ "2. ERROR in X.java (at line 4)\n" + >+ " q1.q2.Missing2 m2;\n" + >+ " ^^^^^^^^^^^^^^\n" + >+ "q1.q2.Missing2 cannot be resolved to a type\n" + >+ "----------\n", >+ null, >+ false); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test020() { >+ this.runConformTest( >+ new String[] { >+ "p/OtherFoo.java", //----------------------------------------------------------------------- >+ "package p;\n" + >+ "\n" + >+ "import q1.q2.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", >+ "q1/q2/Zork.java", //----------------------------------------------------------------------- >+ "package q1.q2;\n" + >+ "public class Zork {\n" + >+ "}\n", >+ }, >+ ""); >+ >+ // no need to delete Zork actually - any lazy reference would cause q1.q2 to be created as a package >+ >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "public class X {\n" + >+ " void foo(p.OtherFoo ofoo) {\n" + // triggers OtherFoo loading, and q1.q2 pkg creation (for unresolved binary type refs) >+ " a.b.Missing1 m1;\n" + >+ " q1.q2.Missing2 m2;\n" + >+ " }\n" + >+ "} \n", >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " a.b.Missing1 m1;\n" + >+ " ^\n" + >+ "a cannot be resolved to a type\n" + > "----------\n" + >- "1. ERROR in Y.java (at line 3)\n" + >- " q1.q2.Missing1 m11;\n" + >+ "2. ERROR in X.java (at line 4)\n" + >+ " q1.q2.Missing2 m2;\n" + > " ^^^^^^^^^^^^^^\n" + >- "q1.q2.Missing1 cannot be resolved to a type\n" + // inconsistent msg from previous one (error 1) >+ "q1.q2.Missing2 cannot be resolved to a type\n" + > "----------\n", > null, > false); > } >- >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test021() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "public class X {\n" + >+ " void foo(p.OtherFoo ofoo) {\n" + >+ " a.b.Missing1 m1;\n" + >+ " q1.q2.Missing2 m2;\n" + >+ " }\n" + >+ "} \n", >+ "p/OtherFoo.java", //----------------------------------------------------------------------- >+ "package p;\n" + >+ "public class OtherFoo extends q1.q2.Zork{\n" + >+ "}\n", >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " a.b.Missing1 m1;\n" + >+ " ^\n" + >+ "a cannot be resolved to a type\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 4)\n" + >+ " q1.q2.Missing2 m2;\n" + >+ " ^^\n" + >+ "q1 cannot be resolved to a type\n" + >+ "----------\n" + >+ "----------\n" + >+ "1. ERROR in p\\OtherFoo.java (at line 2)\n" + >+ " public class OtherFoo extends q1.q2.Zork{\n" + >+ " ^^\n" + >+ "q1 cannot be resolved to a type\n" + >+ "----------\n"); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test022() { >+ this.runConformTest( >+ new String[] { >+ "p/OtherFoo.java", //----------------------------------------------------------------------- >+ "package p;\n" + >+ "\n" + >+ "import q1.q2.Zork;\n" + >+ "\n" + >+ "public class OtherFoo {\n" + >+ " public Zork foo;\n" + >+ "}\n", >+ "q1/q2/Zork.java", //----------------------------------------------------------------------- >+ "package q1.q2;\n" + >+ "public class Zork {\n" + >+ "}\n", >+ }, >+ ""); >+ >+ // delete binary folder q1 (i.e. simulate removing it from classpath for subsequent compile) >+ Util.delete(new File(OUTPUT_DIR, "q1")); >+ >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "public class X {\n" + >+ " void foo(q1.q2.Missing1 m1) {\n" + >+ " a.b.Missing1 m1a;\n" + >+ " p.OtherFoo ofoo;\n" + // triggers OtherFoo loading, and q1.q2 pkg creation (for unresolved binary type refs) >+ " q1.q2.Missing1 m11;\n" + >+ " }\n" + >+ "} \n", >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 2)\n" + >+ " void foo(q1.q2.Missing1 m1) {\n" + >+ " ^^\n" + >+ "q1 cannot be resolved to a type\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 3)\n" + >+ " a.b.Missing1 m1a;\n" + >+ " ^\n" + >+ "a cannot be resolved to a type\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 5)\n" + >+ " q1.q2.Missing1 m11;\n" + >+ " ^^\n" + >+ "q1 cannot be resolved to a type\n" + >+ "----------\n", >+ null, >+ false); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test023() { >+ this.runConformTest( >+ new String[] { >+ "p/OtherFoo.java", //----------------------------------------------------------------------- >+ "package p;\n" + >+ "\n" + >+ "import q1.q2.Zork;\n" + >+ "\n" + >+ "public class OtherFoo {\n" + >+ " public Zork foo;\n" + >+ "}\n", >+ "q1/q2/Zork.java", //----------------------------------------------------------------------- >+ "package q1.q2;\n" + >+ "public class Zork {\n" + >+ "}\n", >+ }, >+ ""); >+ >+ // leave package behind >+ >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "public class X {\n" + >+ " void foo(q1.q2.Missing1 m1) {\n" + >+ " a.b.Missing1 m1a;\n" + >+ " p.OtherFoo ofoo;\n" + >+ " q1.q2.Missing1 m11;\n" + >+ " }\n" + >+ "} \n", >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 2)\n" + >+ " void foo(q1.q2.Missing1 m1) {\n" + >+ " ^^^^^^^^^^^^^^\n" + >+ "q1.q2.Missing1 cannot be resolved to a type\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 3)\n" + >+ " a.b.Missing1 m1a;\n" + >+ " ^\n" + >+ "a cannot be resolved to a type\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 5)\n" + >+ " q1.q2.Missing1 m11;\n" + >+ " ^^^^^^^^^^^^^^\n" + >+ "q1.q2.Missing1 cannot be resolved to a type\n" + >+ "----------\n", >+ null, >+ false); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test024() { >+ this.runConformTest( >+ new String[] { >+ "p/OtherFoo.java", //----------------------------------------------------------------------- >+ "package p;\n" + >+ "\n" + >+ "import q1.q2.Zork;\n" + >+ "\n" + >+ "public class OtherFoo {\n" + >+ " public Zork foo;\n" + >+ "}\n", >+ "q1/q2/Zork.java", //----------------------------------------------------------------------- >+ "package q1.q2;\n" + >+ "public class Zork {\n" + >+ "}\n", >+ }, >+ ""); >+ >+ // delete binary folder q1/q2 (i.e. simulate removing it from classpath for subsequent compile) >+ Util.delete(new File(OUTPUT_DIR, "q1/q2")); >+ >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "public class X {\n" + >+ " void foo(q1.q2.Missing1 m1) {\n" + >+ " a.b.Missing1 m1a;\n" + >+ " p.OtherFoo ofoo;\n" + // triggers OtherFoo loading, and q1.q2 pkg creation (for unresolved binary type refs) >+ " q1.q2.Missing1 m11;\n" + >+ " }\n" + >+ "} \n", >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 2)\n" + >+ " void foo(q1.q2.Missing1 m1) {\n" + >+ " ^^^^^\n" + >+ "q1.q2 cannot be resolved to a type\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 3)\n" + >+ " a.b.Missing1 m1a;\n" + >+ " ^\n" + >+ "a cannot be resolved to a type\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 5)\n" + >+ " q1.q2.Missing1 m11;\n" + >+ " ^^^^^^^^^^^^^^\n" + >+ "q1.q2.Missing1 cannot be resolved to a type\n" + // inconsistent msg from previous one (error 1) >+ "----------\n", >+ null, >+ false); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test025() { >+ this.runConformTest( >+ new String[] { >+ "p/OtherFoo.java", //----------------------------------------------------------------------- >+ "package p;\n" + >+ "\n" + >+ "import q1.q2.Zork;\n" + >+ "\n" + >+ "public class OtherFoo {\n" + >+ " public Zork foo;\n" + >+ "}\n", >+ "q1/q2/Zork.java", //----------------------------------------------------------------------- >+ "package q1.q2;\n" + >+ "public class Zork {\n" + >+ "}\n", >+ }, >+ ""); >+ >+ // delete binary folder q1/q2 (i.e. simulate removing it from classpath for subsequent compile) >+ Util.delete(new File(OUTPUT_DIR, "q1/q2")); >+ >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "public class X {\n" + >+ " void foo(q1.q2.Missing1 m1) {\n" + >+ " a.b.Missing1 m1a;\n" + >+ " p.OtherFoo ofoo;\n" + // triggers OtherFoo loading, and q1.q2 pkg creation (for unresolved binary type refs) >+ " }\n" + >+ "} \n", >+ "Y.java", //----------------------------------------------------------------------- >+ "public class Y {\n" + >+ " void foo() {\n" + >+ " q1.q2.Missing1 m11;\n" + >+ " }\n" + >+ "} \n", >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 2)\n" + >+ " void foo(q1.q2.Missing1 m1) {\n" + >+ " ^^^^^\n" + >+ "q1.q2 cannot be resolved to a type\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 3)\n" + >+ " a.b.Missing1 m1a;\n" + >+ " ^\n" + >+ "a cannot be resolved to a type\n" + >+ "----------\n" + >+ "----------\n" + >+ "1. ERROR in Y.java (at line 3)\n" + >+ " q1.q2.Missing1 m11;\n" + >+ " ^^^^^^^^^^^^^^\n" + >+ "q1.q2.Missing1 cannot be resolved to a type\n" + // inconsistent msg from previous one (error 1) >+ "----------\n", >+ null, >+ false); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test026() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "public class X {\n" + >+ " void foo(Missing1 m1) {\n" + >+ " Missing2 m2 = m1;\n" + >+ " }\n" + >+ "}\n", >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 2)\n" + >+ " void foo(Missing1 m1) {\n" + >+ " ^^^^^^^^\n" + >+ "Missing1 cannot be resolved to a type\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 3)\n" + >+ " Missing2 m2 = m1;\n" + >+ " ^^^^^^^^\n" + >+ "Missing2 cannot be resolved to a type\n" + >+ "----------\n"); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test027() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "public class X {\n" + >+ " void foo(X x) {\n" + >+ " new Other().m2 = x;\n" + >+ " Other other = new Other();\n" + >+ " other.m2 = x;\n" + >+ " other.m2.m3 = x;\n" + >+ " }\n" + >+ "}\n" + >+ "\n" + >+ "class Other {\n" + >+ " Missing2 m2;\n" + >+ "}\n", >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " new Other().m2 = x;\n" + >+ " ^^^^^^^^^^^^^^\n" + >+ "Missing2 cannot be resolved to a type\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 5)\n" + >+ " other.m2 = x;\n" + >+ " ^^^^^^^^\n" + >+ "Missing2 cannot be resolved to a type\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 6)\n" + >+ " other.m2.m3 = x;\n" + >+ " ^^^^^^^^\n" + >+ "Missing2 cannot be resolved to a type\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 11)\n" + >+ " Missing2 m2;\n" + >+ " ^^^^^^^^\n" + >+ "Missing2 cannot be resolved to a type\n" + >+ "----------\n"); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test028() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "public class X {\n" + >+ " void foo(X x) {\n" + >+ " System.out.println(new Other().m2.m3);\n" + >+ " System.out.println(new Other().m2.m3());\n" + >+ " Missing2.foo();\n" + >+ " }\n" + >+ "}\n" + >+ "\n" + >+ "class Other {\n" + >+ " Missing2 m2;\n" + >+ "}\n", >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " System.out.println(new Other().m2.m3);\n" + >+ " ^^^^^^^^^^^^^^\n" + >+ "Missing2 cannot be resolved to a type\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 4)\n" + >+ " System.out.println(new Other().m2.m3());\n" + >+ " ^^^^^^^^^^^^^^\n" + >+ "Missing2 cannot be resolved to a type\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 5)\n" + >+ " Missing2.foo();\n" + >+ " ^^^^^^^^\n" + >+ "Missing2 cannot be resolved\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 10)\n" + >+ " Missing2 m2;\n" + >+ " ^^^^^^^^\n" + >+ "Missing2 cannot be resolved to a type\n" + >+ "----------\n"); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test029() throws Exception { >+ this.runNegativeTest( >+ new String[] { >+ "Y.java", //----------------------------------------------------------------------- >+ "public class Y extends Z {\n" + >+ "}\n", >+ }, >+ "----------\n" + >+ "1. ERROR in Y.java (at line 1)\n" + >+ " public class Y extends Z {\n" + >+ " ^\n" + >+ "Z cannot be resolved to a type\n" + >+ "----------\n", >+ null, >+ true, // flush output >+ null, >+ true, // generate output >+ false, >+ false); >+ >+ // check Y superclass in problem classfile >+ String expectedOutput = >+ "public class Y extends Z {\n"; >+ >+ File f = new File(OUTPUT_DIR + File.separator + "Y.class"); >+ byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f); >+ ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler(); >+ String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED); >+ int index = result.indexOf(expectedOutput); >+ if (index == -1 || expectedOutput.length() == 0) { >+ System.out.println(Util.displayString(result, 3)); >+ } >+ if (index == -1) { >+ assertEquals("Wrong contents", expectedOutput, result); >+ } >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test030() { >+ this.runNegativeTest( >+ new String[] { >+ "Y.java", //----------------------------------------------------------------------- >+ "public class Y extends Z {\n" + >+ "}\n", >+ }, >+ "----------\n" + >+ "1. ERROR in Y.java (at line 1)\n" + >+ " public class Y extends Z {\n" + >+ " ^\n" + >+ "Z cannot be resolved to a type\n" + >+ "----------\n", >+ null, >+ true, // flush output >+ null, >+ true, // generate output >+ false, >+ false); >+ >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "public class X extends Y {\n" + >+ "}\n", >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 1)\n" + >+ " public class X extends Y {\n" + >+ " ^\n" + >+ "The hierarchy of the type X is inconsistent\n" + >+ "----------\n", >+ null, >+ false, // do not flush output >+ null, >+ true, // generate output >+ false, >+ false); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test031() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "public class X extends Y {\n" + >+ "}\n", >+ "Y.java", //----------------------------------------------------------------------- >+ "public class Y extends Z {\n" + >+ "}\n", >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 1)\n" + >+ " public class X extends Y {\n" + >+ " ^\n" + >+ "The hierarchy of the type X is inconsistent\n" + >+ "----------\n" + >+ "----------\n" + >+ "1. ERROR in Y.java (at line 1)\n" + >+ " public class Y extends Z {\n" + >+ " ^\n" + >+ "Z cannot be resolved to a type\n" + >+ "----------\n"); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test032() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "import existing.*;\n" + >+ "public class X {\n" + >+ " void foo(p.Zork z) {}\n" + >+ " void bar(Zork z) {} // should bind to existing.Zork\n" + >+ "}\n", >+ "p/Clyde.java", //----------------------------------------------------------------------- >+ "package p;\n" + // just so package p does exist >+ "public class Clyde {\n" + >+ "}\n", >+ "existing/Zork.java", //----------------------------------------------------------------------- >+ "package existing;\n" + >+ "public class Zork {\n" + >+ "}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " void foo(p.Zork z) {}\n" + >+ " ^^^^^^\n" + >+ "p.Zork cannot be resolved to a type\n" + >+ "----------\n"); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test033() { >+ if (this.complianceLevel <= ClassFileConstants.JDK1_4) { >+ return; >+ } >+ this.runNegativeTest( >+ new String[] { >+ "Y.java", //----------------------------------------------------------------------- >+ "@Z public class Y {\n" + >+ "}\n", >+ }, >+ "----------\n" + >+ "1. ERROR in Y.java (at line 1)\n" + >+ " @Z public class Y {\n" + >+ " ^\n" + >+ "Z cannot be resolved to a type\n" + >+ "----------\n", >+ null, >+ true, // flush output >+ null, >+ true, // generate output >+ false, >+ false); >+ >+ this.runConformTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "public class X extends Y {\n" + >+ "}\n", >+ }, >+ "", >+ null, >+ false, // do not flush output >+ null); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test034() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "public class X {\n" + >+ " void foo(X1 x1) {\n" + >+ " Object o = x1.bar();\n" + >+ " }\n" + >+ "}\n", >+ "X1.java", //----------------------------------------------------------------------- >+ "public class X1 {\n" + >+ " Zork bar() { return null; } \n" + >+ "}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " Object o = x1.bar();\n" + >+ " ^^^\n" + >+ "The method bar() from the type X1 refers to the missing type Zork\n" + >+ "----------\n" + >+ "----------\n" + >+ "1. ERROR in X1.java (at line 2)\n" + >+ " Zork bar() { return null; } \n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n"); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test035() { >+ this.runNegativeTest( >+ new String[] { >+ "X1.java", //----------------------------------------------------------------------- >+ "public class X1 {\n" + >+ " Zork bar() { return null; } \n" + >+ "}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in X1.java (at line 2)\n" + >+ " Zork bar() { return null; } \n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n", >+ null, >+ true, // flush output >+ null, >+ true, // generate output >+ false, >+ false); >+ >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "public class X {\n" + >+ " void foo(X1 x1) {\n" + >+ " Object o = x1.bar();\n" + >+ " }\n" + >+ "}\n", >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " Object o = x1.bar();\n" + >+ " ^^^\n" + >+ "The method bar() from the type X1 refers to the missing type Zork\n" + >+ "----------\n", >+ null, >+ false, // do not flush output >+ null, >+ true, // generate output >+ false, >+ false); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test036() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "public class X {\n" + >+ " void foo(X1 x1) {\n" + >+ " Object o = x1.bar(x1);\n" + >+ " }\n" + >+ "}\n", >+ "X1.java", //----------------------------------------------------------------------- >+ "public class X1 {\n" + >+ " Object bar(Zork z) { return null; } \n" + >+ "}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " Object o = x1.bar(x1);\n" + >+ " ^^^\n" + >+ "The method bar(Zork) from the type X1 refers to the missing type Zork\n" + >+ "----------\n" + >+ "----------\n" + >+ "1. ERROR in X1.java (at line 2)\n" + >+ " Object bar(Zork z) { return null; } \n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n"); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test037() { >+ this.runNegativeTest( >+ new String[] { >+ "X1.java", //----------------------------------------------------------------------- >+ "public class X1 {\n" + >+ " Object bar(Zork z) { return null; } \n" + >+ "}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in X1.java (at line 2)\n" + >+ " Object bar(Zork z) { return null; } \n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n", >+ null, >+ true, // flush output >+ null, >+ true, // generate output >+ false, >+ false); >+ >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "public class X {\n" + >+ " void foo(X1 x1) {\n" + >+ " Object o = x1.bar(x1);\n" + >+ " }\n" + >+ "}\n", >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " Object o = x1.bar(x1);\n" + >+ " ^^^\n" + >+ "The method bar(Zork) from the type X1 refers to the missing type Zork\n" + >+ "----------\n", >+ null, >+ false, // do not flush output >+ null, >+ true, // generate output >+ false, >+ false); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test038() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "public class X {\n" + >+ " void foo(X1 x1) {\n" + >+ " Object o = x1.bar(x1);\n" + >+ " }\n" + >+ "}\n", >+ "X1.java", //----------------------------------------------------------------------- >+ "public class X1 {\n" + >+ " Object bar(Object o) throws Zork { return null; } \n" + >+ "}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " Object o = x1.bar(x1);\n" + >+ " ^^^\n" + >+ "The method bar(Object) from the type X1 refers to the missing type Zork\n" + >+ "----------\n" + >+ "----------\n" + >+ "1. ERROR in X1.java (at line 2)\n" + >+ " Object bar(Object o) throws Zork { return null; } \n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n"); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test039() { >+ this.runNegativeTest( >+ new String[] { >+ "X1.java", //----------------------------------------------------------------------- >+ "public class X1 {\n" + >+ " Object bar(Object o) throws Zork { return null; } \n" + >+ "}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in X1.java (at line 2)\n" + >+ " Object bar(Object o) throws Zork { return null; } \n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n", >+ null, >+ true, // flush output >+ null, >+ true, // generate output >+ false, >+ false); >+ >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "public class X {\n" + >+ " void foo(X1 x1) {\n" + >+ " Object o = x1.bar(x1);\n" + >+ " }\n" + >+ "}\n", >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " Object o = x1.bar(x1);\n" + >+ " ^^^\n" + >+ "The method bar(Object) from the type X1 refers to the missing type Zork\n" + >+ "----------\n", >+ null, >+ false, // do not flush output >+ null, >+ true, // generate output >+ false, >+ false); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test040() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "public class X {\n" + >+ " void foo(X1 x1) {\n" + >+ " Object o = new X1(x1);\n" + >+ " }\n" + >+ "}\n", >+ "X1.java", //----------------------------------------------------------------------- >+ "public class X1 {\n" + >+ " public X1(Zork z) {}\n" + >+ "}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " Object o = new X1(x1);\n" + >+ " ^^^^^^^^^^\n" + >+ "The constructor X1(Zork) refers to the missing type Zork\n" + >+ "----------\n" + >+ "----------\n" + >+ "1. ERROR in X1.java (at line 2)\n" + >+ " public X1(Zork z) {}\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n"); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test041() { >+ this.runNegativeTest( >+ new String[] { >+ "X1.java", //----------------------------------------------------------------------- >+ "public class X1 {\n" + >+ " public X1(Zork z) {}\n" + >+ "}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in X1.java (at line 2)\n" + >+ " public X1(Zork z) {}\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n", >+ null, >+ true, // flush output >+ null, >+ true, // generate output >+ false, >+ false); >+ >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "public class X {\n" + >+ " void foo(X1 x1) {\n" + >+ " Object o = new X1(x1);\n" + >+ " }\n" + >+ "}\n", >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " Object o = new X1(x1);\n" + >+ " ^^^^^^^^^^\n" + >+ "The constructor X1(Zork) refers to the missing type Zork\n" + >+ "----------\n", >+ null, >+ false, // do not flush output >+ null, >+ true, // generate output >+ false, >+ false); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test042() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "public class X {\n" + >+ " void foo(X1 x1) {\n" + >+ " Object o = new X1();\n" + >+ " }\n" + >+ "}\n", >+ "X1.java", //----------------------------------------------------------------------- >+ "public class X1 {\n" + >+ " public X1() throws Zork {}\n" + >+ "}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " Object o = new X1();\n" + >+ " ^^^^^^^^\n" + >+ "The constructor X1() refers to the missing type Zork\n" + >+ "----------\n" + >+ "----------\n" + >+ "1. ERROR in X1.java (at line 2)\n" + >+ " public X1() throws Zork {}\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n"); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test043() { >+ this.runNegativeTest( >+ new String[] { >+ "X1.java", //----------------------------------------------------------------------- >+ "public class X1 {\n" + >+ " public X1() throws Zork {}\n" + >+ "}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in X1.java (at line 2)\n" + >+ " public X1() throws Zork {}\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n", >+ null, >+ true, // flush output >+ null, >+ true, // generate output >+ false, >+ false); >+ >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "public class X {\n" + >+ " void foo(X1 x1) {\n" + >+ " Object o = new X1();\n" + >+ " }\n" + >+ "}\n", >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " Object o = new X1();\n" + >+ " ^^^^^^^^\n" + >+ "The constructor X1() refers to the missing type Zork\n" + >+ "----------\n", >+ null, >+ false, // do not flush output >+ null, >+ true, // generate output >+ false, >+ false); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test044() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "public class X {\n" + >+ " void foo(X1 x1) {\n" + >+ " Object o = new X1(x1){};\n" + >+ " }\n" + >+ "}\n", >+ "X1.java", //----------------------------------------------------------------------- >+ "public class X1 {\n" + >+ " public X1(Zork z) {}\n" + >+ "}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " Object o = new X1(x1){};\n" + >+ " ^^^^^^^^^^^^\n" + >+ "The constructor X1(Zork) refers to the missing type Zork\n" + >+ "----------\n" + >+ "----------\n" + >+ "1. ERROR in X1.java (at line 2)\n" + >+ " public X1(Zork z) {}\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n"); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test045() { >+ this.runNegativeTest( >+ new String[] { >+ "X1.java", //----------------------------------------------------------------------- >+ "public class X1 {\n" + >+ " public X1(Zork z) {}\n" + >+ "}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in X1.java (at line 2)\n" + >+ " public X1(Zork z) {}\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n", >+ null, >+ true, // flush output >+ null, >+ true, // generate output >+ false, >+ false); >+ >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "public class X {\n" + >+ " void foo(X1 x1) {\n" + >+ " Object o = new X1(x1){};\n" + >+ " }\n" + >+ "}\n", >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " Object o = new X1(x1){};\n" + >+ " ^^^^^^^^^^^^\n" + >+ "The constructor X1(Zork) refers to the missing type Zork\n" + >+ "----------\n", >+ null, >+ false, // do not flush output >+ null, >+ true, // generate output >+ false, >+ false); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test046() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "public class X {\n" + >+ " void foo(X1 x1) {\n" + >+ " Object o = new X1(){};\n" + >+ " }\n" + >+ "}\n", >+ "X1.java", //----------------------------------------------------------------------- >+ "public class X1 {\n" + >+ " public X1() throws Zork {}\n" + >+ "}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " Object o = new X1(){};\n" + >+ " ^^^^\n" + >+ "The constructor X1() refers to the missing type Zork\n" + >+ "----------\n" + >+ "----------\n" + >+ "1. ERROR in X1.java (at line 2)\n" + >+ " public X1() throws Zork {}\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n"); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test047() { >+ this.runNegativeTest( >+ new String[] { >+ "X1.java", //----------------------------------------------------------------------- >+ "public class X1 {\n" + >+ " public X1() throws Zork {}\n" + >+ "}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in X1.java (at line 2)\n" + >+ " public X1() throws Zork {}\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n", >+ null, >+ true, // flush output >+ null, >+ true, // generate output >+ false, >+ false); >+ >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "public class X {\n" + >+ " void foo(X1 x1) {\n" + >+ " Object o = new X1(){};\n" + >+ " }\n" + >+ "}\n", >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " Object o = new X1(){};\n" + >+ " ^^^^\n" + >+ "The constructor X1() refers to the missing type Zork\n" + >+ "----------\n", >+ null, >+ false, // do not flush output >+ null, >+ true, // generate output >+ false, >+ false); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test048() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "public class X extends X1 {\n" + >+ " X(X1 x1) {\n" + >+ " super(x1);\n" + >+ " }\n" + >+ "}\n", >+ "X1.java", //----------------------------------------------------------------------- >+ "public class X1 {\n" + >+ " public X1(Zork z) {}\n" + >+ "}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " super(x1);\n" + >+ " ^^^^^^^^^^\n" + >+ "The constructor X1(Zork) refers to the missing type Zork\n" + >+ "----------\n" + >+ "----------\n" + >+ "1. ERROR in X1.java (at line 2)\n" + >+ " public X1(Zork z) {}\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n"); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test049() { >+ this.runNegativeTest( >+ new String[] { >+ "X1.java", //----------------------------------------------------------------------- >+ "public class X1 {\n" + >+ " public X1(Zork z) {}\n" + >+ "}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in X1.java (at line 2)\n" + >+ " public X1(Zork z) {}\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n", >+ null, >+ true, // flush output >+ null, >+ true, // generate output >+ false, >+ false); >+ >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "public class X extends X1 {\n" + >+ " X(X1 x1) {\n" + >+ " super(x1);\n" + >+ " }\n" + >+ "}\n", >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " super(x1);\n" + >+ " ^^^^^^^^^^\n" + >+ "The constructor X1(Zork) refers to the missing type Zork\n" + >+ "----------\n", >+ null, >+ false, // do not flush output >+ null, >+ true, // generate output >+ false, >+ false); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test050() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "public class X extends X1 {\n" + >+ " X(X1 x1) {\n" + >+ " super();\n" + >+ " }\n" + >+ "}\n", >+ "X1.java", //----------------------------------------------------------------------- >+ "public class X1 {\n" + >+ " public X1() throws Zork {}\n" + >+ "}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " super();\n" + >+ " ^^^^^^^^\n" + >+ "The constructor X1() refers to the missing type Zork\n" + >+ "----------\n" + >+ "----------\n" + >+ "1. ERROR in X1.java (at line 2)\n" + >+ " public X1() throws Zork {}\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n"); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test051() { >+ this.runNegativeTest( >+ new String[] { >+ "X1.java", //----------------------------------------------------------------------- >+ "public class X1 {\n" + >+ " public X1() throws Zork {}\n" + >+ "}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in X1.java (at line 2)\n" + >+ " public X1() throws Zork {}\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n", >+ null, >+ true, // flush output >+ null, >+ true, // generate output >+ false, >+ false); >+ >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "public class X extends X1 {\n" + >+ " X(X1 x1) {\n" + >+ " super();\n" + >+ " }\n" + >+ "}\n", >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " super();\n" + >+ " ^^^^^^^^\n" + >+ "The constructor X1() refers to the missing type Zork\n" + >+ "----------\n", >+ null, >+ false, // do not flush output >+ null, >+ true, // generate output >+ false, >+ false); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test052() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "public class X {\n" + >+ " void foo(X1 x1) {\n" + >+ " Object o;\n" + >+ " o = x1.next.zork;\n" + >+ " o = this.zork;\n" + >+ " o = zork;\n" + >+ " o = x1.next.zork.foo();\n" + >+ " o = this.zork.foo();\n" + >+ " o = zork.foo();\n" + >+ " }\n" + >+ " Zork zork;\n" + >+ "}\n" + >+ "class X1 {\n" + >+ " X1 next;\n" + >+ " Zork zork;\n" + >+ "}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 4)\n" + >+ " o = x1.next.zork;\n" + >+ " ^^^^^^^^^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 5)\n" + >+ " o = this.zork;\n" + >+ " ^^^^^^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 6)\n" + >+ " o = zork;\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 7)\n" + >+ " o = x1.next.zork.foo();\n" + >+ " ^^^^^^^^^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "5. ERROR in X.java (at line 8)\n" + >+ " o = this.zork.foo();\n" + >+ " ^^^^^^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "6. ERROR in X.java (at line 9)\n" + >+ " o = zork.foo();\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "7. ERROR in X.java (at line 11)\n" + >+ " Zork zork;\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "8. ERROR in X.java (at line 15)\n" + >+ " Zork zork;\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n"); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test053() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "public class X {\n" + >+ " void bar(X1 x1) {\n" + >+ " String s;\n" + >+ " s = x1.next.zork;\n" + >+ " s = this.zork;\n" + >+ " s = zork;\n" + >+ " s = x1.next.zork.foo();\n" + >+ " s = this.zork.foo();\n" + >+ " s = zork.foo();\n" + >+ " } \n" + >+ " Zork zork;\n" + >+ "}\n" + >+ "class X1 {\n" + >+ " X1 next;\n" + >+ " Zork zork;\n" + >+ "}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 4)\n" + >+ " s = x1.next.zork;\n" + >+ " ^^^^^^^^^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 5)\n" + >+ " s = this.zork;\n" + >+ " ^^^^^^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 6)\n" + >+ " s = zork;\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 7)\n" + >+ " s = x1.next.zork.foo();\n" + >+ " ^^^^^^^^^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "5. ERROR in X.java (at line 8)\n" + >+ " s = this.zork.foo();\n" + >+ " ^^^^^^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "6. ERROR in X.java (at line 9)\n" + >+ " s = zork.foo();\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "7. ERROR in X.java (at line 11)\n" + >+ " Zork zork;\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "8. ERROR in X.java (at line 15)\n" + >+ " Zork zork;\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n"); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test054() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "public class X {\n" + >+ " void baz(X1 x1) {\n" + >+ " Zork z;\n" + >+ " z = x1.next.zork;\n" + >+ " z = this.zork;\n" + >+ " z = zork;\n" + >+ " z = x1.next.zork.foo();\n" + >+ " z = this.zork.foo();\n" + >+ " z = zork.foo();\n" + >+ " } \n" + >+ " Zork zork;\n" + >+ "}\n" + >+ "class X1 {\n" + >+ " X1 next;\n" + >+ " Zork zork;\n" + >+ "}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " Zork z;\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 4)\n" + >+ " z = x1.next.zork;\n" + >+ " ^^^^^^^^^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 5)\n" + >+ " z = this.zork;\n" + >+ " ^^^^^^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 6)\n" + >+ " z = zork;\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "5. ERROR in X.java (at line 7)\n" + >+ " z = x1.next.zork.foo();\n" + >+ " ^^^^^^^^^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "6. ERROR in X.java (at line 8)\n" + >+ " z = this.zork.foo();\n" + >+ " ^^^^^^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "7. ERROR in X.java (at line 9)\n" + >+ " z = zork.foo();\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "8. ERROR in X.java (at line 11)\n" + >+ " Zork zork;\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "9. ERROR in X.java (at line 15)\n" + >+ " Zork zork;\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n"); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test055() { >+ this.runNegativeTest( >+ new String[] { >+ "X1.java", //----------------------------------------------------------------------- >+ "public class X1 {\n" + >+ " public X1 next;\n" + >+ " public Zork zork;\n" + >+ "}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in X1.java (at line 3)\n" + >+ " public Zork zork;\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n", >+ null, >+ true, // flush output >+ null, >+ true, // generate output >+ false, >+ false); >+ >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "public class X {\n" + >+ " void foo(X1 x1) {\n" + >+ " Object o;\n" + >+ " o = x1.next.zork;\n" + >+ " o = this.zork;\n" + >+ " o = zork;\n" + >+ " o = x1.next.zork.foo();\n" + >+ " o = this.zork.foo();\n" + >+ " o = zork.foo();\n" + >+ " }\n" + >+ " Zork zork;\n" + >+ "}\n", >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 4)\n" + >+ " o = x1.next.zork;\n" + >+ " ^^^^^^^^^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 5)\n" + >+ " o = this.zork;\n" + >+ " ^^^^^^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 6)\n" + >+ " o = zork;\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 7)\n" + >+ " o = x1.next.zork.foo();\n" + >+ " ^^^^^^^^^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "5. ERROR in X.java (at line 8)\n" + >+ " o = this.zork.foo();\n" + >+ " ^^^^^^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "6. ERROR in X.java (at line 9)\n" + >+ " o = zork.foo();\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "7. ERROR in X.java (at line 11)\n" + >+ " Zork zork;\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n", >+ null, >+ false, // do not flush output >+ null, >+ true, // generate output >+ false, >+ false); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test056() { >+ this.runNegativeTest( >+ new String[] { >+ "X1.java", //----------------------------------------------------------------------- >+ "public class X1 {\n" + >+ " public X1 next;\n" + >+ " public Zork zork;\n" + >+ "}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in X1.java (at line 3)\n" + >+ " public Zork zork;\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n", >+ null, >+ true, // flush output >+ null, >+ true, // generate output >+ false, >+ false); >+ >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "public class X {\n" + >+ " void bar(X1 x1) {\n" + >+ " String s;\n" + >+ " s = x1.next.zork;\n" + >+ " s = this.zork;\n" + >+ " s = zork;\n" + >+ " s = x1.next.zork.foo();\n" + >+ " s = this.zork.foo();\n" + >+ " s = zork.foo();\n" + >+ " } \n" + >+ " Zork zork;\n" + >+ "}\n", >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 4)\n" + >+ " s = x1.next.zork;\n" + >+ " ^^^^^^^^^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 5)\n" + >+ " s = this.zork;\n" + >+ " ^^^^^^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 6)\n" + >+ " s = zork;\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 7)\n" + >+ " s = x1.next.zork.foo();\n" + >+ " ^^^^^^^^^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "5. ERROR in X.java (at line 8)\n" + >+ " s = this.zork.foo();\n" + >+ " ^^^^^^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "6. ERROR in X.java (at line 9)\n" + >+ " s = zork.foo();\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "7. ERROR in X.java (at line 11)\n" + >+ " Zork zork;\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n", >+ null, >+ false, // do not flush output >+ null, >+ true, // generate output >+ false, >+ false); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test057() { >+ this.runNegativeTest( >+ new String[] { >+ "X1.java", //----------------------------------------------------------------------- >+ "public class X1 {\n" + >+ " public X1 next;\n" + >+ " public Zork zork;\n" + >+ "}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in X1.java (at line 3)\n" + >+ " public Zork zork;\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n", >+ null, >+ true, // flush output >+ null, >+ true, // generate output >+ false, >+ false); >+ >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "public class X {\n" + >+ " void baz(X1 x1) {\n" + >+ " Zork z;\n" + >+ " z = x1.next.zork;\n" + >+ " z = this.zork;\n" + >+ " z = zork;\n" + >+ " z = x1.next.zork.foo();\n" + >+ " z = this.zork.foo();\n" + >+ " z = zork.foo();\n" + >+ " } \n" + >+ " Zork zork;\n" + >+ "}\n", >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " Zork z;\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 4)\n" + >+ " z = x1.next.zork;\n" + >+ " ^^^^^^^^^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 5)\n" + >+ " z = this.zork;\n" + >+ " ^^^^^^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 6)\n" + >+ " z = zork;\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "5. ERROR in X.java (at line 7)\n" + >+ " z = x1.next.zork.foo();\n" + >+ " ^^^^^^^^^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "6. ERROR in X.java (at line 8)\n" + >+ " z = this.zork.foo();\n" + >+ " ^^^^^^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "7. ERROR in X.java (at line 9)\n" + >+ " z = zork.foo();\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "8. ERROR in X.java (at line 11)\n" + >+ " Zork zork;\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n", >+ null, >+ false, // do not flush output >+ null, >+ true, // generate output >+ false, >+ false); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test058() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "public class X {\n" + >+ " void foo(X1 x1) {\n" + >+ " x1.bar().baz();\n" + >+ " }\n" + >+ "}\n" + >+ "\n" + >+ "class X1 {\n" + >+ " Zork bar(){}\n" + >+ "}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " x1.bar().baz();\n" + >+ " ^^^\n" + >+ "The method bar() from the type X1 refers to the missing type Zork\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 8)\n" + >+ " Zork bar(){}\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n"); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test059() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "public class X {\n" + >+ " void foo(X1 x1) {\n" + >+ " new X1(x1).baz();\n" + >+ " new X1(null).baz();\n" + >+ " new Zork().baz();\n" + >+ " new X1(x1){}.baz();\n" + >+ " new X1(null){}.baz();\n" + >+ " new Zork(){}.baz();\n" + >+ " }\n" + >+ "}\n" + >+ "\n" + >+ "class X1 {\n" + >+ " X1(Zork z) {}\n" + >+ "}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " new X1(x1).baz();\n" + >+ " ^^^^^^^^^^\n" + >+ "The constructor X1(Zork) refers to the missing type Zork\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 3)\n" + >+ " new X1(x1).baz();\n" + >+ " ^^^\n" + >+ "The method baz() is undefined for the type X1\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 4)\n" + >+ " new X1(null).baz();\n" + >+ " ^^^^^^^^^^^^\n" + >+ "The constructor X1(Zork) refers to the missing type Zork\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 4)\n" + >+ " new X1(null).baz();\n" + >+ " ^^^\n" + >+ "The method baz() is undefined for the type X1\n" + >+ "----------\n" + >+ "5. ERROR in X.java (at line 5)\n" + >+ " new Zork().baz();\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "6. ERROR in X.java (at line 6)\n" + >+ " new X1(x1){}.baz();\n" + >+ " ^^^^^^^^^^^^\n" + >+ "The constructor X1(Zork) refers to the missing type Zork\n" + >+ "----------\n" + >+ "7. ERROR in X.java (at line 6)\n" + >+ " new X1(x1){}.baz();\n" + >+ " ^^^\n" + >+ "The method baz() is undefined for the type new X1(){}\n" + >+ "----------\n" + >+ "8. ERROR in X.java (at line 7)\n" + >+ " new X1(null){}.baz();\n" + >+ " ^^^^^^^^\n" + >+ "The constructor X1(Zork) refers to the missing type Zork\n" + >+ "----------\n" + >+ "9. ERROR in X.java (at line 7)\n" + >+ " new X1(null){}.baz();\n" + >+ " ^^^\n" + >+ "The method baz() is undefined for the type new X1(){}\n" + >+ "----------\n" + >+ "10. ERROR in X.java (at line 8)\n" + >+ " new Zork(){}.baz();\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "11. ERROR in X.java (at line 13)\n" + >+ " X1(Zork z) {}\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n"); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test060() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "public class X {\n" + >+ " void foo(Zork z) {\n" + >+ " z.bar();\n" + >+ " }\n" + >+ "}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 2)\n" + >+ " void foo(Zork z) {\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 3)\n" + >+ " z.bar();\n" + >+ " ^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n"); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test061() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "public class X {\n" + >+ " void foo(X1 x1) {\n" + >+ " int i = x1.next.z;\n" + >+ " int j = x1.next.zArray;\n" + >+ " }\n" + >+ "}\n" + >+ "\n" + >+ "class X1 {\n" + >+ " X1 next;\n" + >+ " Zork z;\n" + >+ " Zork[] zArray;\n" + >+ "}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 3)\n" + >+ " int i = x1.next.z;\n" + >+ " ^^^^^^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 4)\n" + >+ " int j = x1.next.zArray;\n" + >+ " ^^^^^^^^^^^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 10)\n" + >+ " Zork z;\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 11)\n" + >+ " Zork[] zArray;\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n"); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test062() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", //----------------------------------------------------------------------- >+ "public class X {\n" + >+ " X1 x1;\n" + >+ " void foo() {\n" + >+ " int i = x1.next.z;\n" + >+ " int j = x1.next.zArray;\n" + >+ " }\n" + >+ "}\n" + >+ "\n" + >+ "class X1 {\n" + >+ " X1 next;\n" + >+ " Zork z;\n" + >+ " Zork[] zArray;\n" + >+ "}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 4)\n" + >+ " int i = x1.next.z;\n" + >+ " ^^^^^^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 5)\n" + >+ " int j = x1.next.zArray;\n" + >+ " ^^^^^^^^^^^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 11)\n" + >+ " Zork z;\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "4. ERROR in X.java (at line 12)\n" + >+ " Zork[] zArray;\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n"); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+public void test063() { >+ this.runNegativeTest( >+ new String[] { >+ "p/X.java", //----------------------------------------------------------------------- >+ "package p;\n" + >+ "public class X {\n" + >+ " void foo() {\n" + >+ " int i = p.X1.z;\n" + >+ " int j = p.X1.zArray;\n" + >+ " }\n" + >+ "}\n" + >+ "\n" + >+ "class X1 {\n" + >+ " static Zork z;\n" + >+ " static Zork[] zArray;\n" + >+ "}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in p\\X.java (at line 4)\n" + >+ " int i = p.X1.z;\n" + >+ " ^^^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "2. ERROR in p\\X.java (at line 5)\n" + >+ " int j = p.X1.zArray;\n" + >+ " ^^^^^^^^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "3. ERROR in p\\X.java (at line 10)\n" + >+ " static Zork z;\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "4. ERROR in p\\X.java (at line 11)\n" + >+ " static Zork[] zArray;\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n"); >+} > } >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 20 Feb 2008 06:59:43 -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.45 >diff -u -r1.45 TryStatementTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/TryStatementTest.java 17 Jan 2008 13:02:17 -0000 1.45 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/TryStatementTest.java 20 Feb 2008 07:00:39 -0000 >@@ -5633,15 +5633,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.31 >diff -u -r1.31 InnerEmulationTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest.java 31 Jan 2008 11:13:36 -0000 1.31 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest.java 20 Feb 2008 06:59:30 -0000 >@@ -1167,20 +1167,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. >@@ -1228,25 +1222,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,7 +1324,7 @@ > "3. ERROR in p2\\c2.java (at line 6)\n" + > " myC1a = new c1a(); \n" + > " ^^^^^\n" + >- "myC1a cannot be resolved\n" + >+ "c1a cannot be resolved to a type\n" + > "----------\n" + > "4. ERROR in p2\\c2.java (at line 6)\n" + > " myC1a = new c1a(); \n" + >@@ -1346,12 +1334,11 @@ > "5. 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. >+ * Compatibility - Compiler does not comply with 1.1 standard. > */ > public void test031() { > this.runNegativeTest( >@@ -1399,21 +1386,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 >@@ -5980,50 +5960,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"); > } > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216683 >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 20 Feb 2008 07:00:04 -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() { >@@ -1940,7 +1944,7 @@ > "2. ERROR in X.java (at line 10)\n" + > " this.bb();\n" + > " ^^\n" + >- "The method bb() is undefined for the type X\n" + >+ "The method bb() from the type X refers to the missing type Zork\n" + > "----------\n"); > } > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=132813 - variation >@@ -1978,7 +1982,7 @@ > "3. ERROR in X.java (at line 10)\n" + > " this.bb();\n" + > " ^^\n" + >- "The method bb() is undefined for the type X\n" + >+ "The method bb() from the type X refers to the missing type Zork\n" + > "----------\n"); > } > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=134839 >@@ -2868,6 +2872,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 20 Feb 2008 07:03:38 -0000 >@@ -10,6 +10,7 @@ > *******************************************************************************/ > package org.eclipse.jdt.internal.compiler.lookup; > >+import org.eclipse.jdt.internal.compiler.ast.ASTNode; > import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; > import org.eclipse.jdt.internal.compiler.impl.Constant; > >@@ -27,6 +28,9 @@ > this.type = type; > this.modifiers = modifiers; > this.constant = constant; >+ if (type != null) { >+ this.tagBits |= (type.tagBits & TagBits.HasMissingType); >+ } > } > > public Constant constant() { >@@ -51,9 +55,14 @@ > this.constant = constant; > } > public String toString() { >- String s = (type != null) ? type.debugName() : "UNDEFINED TYPE"; //$NON-NLS-1$ >- s += " "; //$NON-NLS-1$ >- s += (name != null) ? new String(name) : "UNNAMED FIELD"; //$NON-NLS-1$ >- return s; >+ StringBuffer output = new StringBuffer(10); >+ ASTNode.printModifiers(this.modifiers, output); >+ if ((this.modifiers & ExtraCompilerModifiers.AccUnresolved) != 0) { >+ output.append("[unresolved] "); //$NON-NLS-1$ >+ } >+ output.append(type != null ? type.debugName() : "<no type>"); //$NON-NLS-1$ >+ output.append(" "); //$NON-NLS-1$ >+ output.append((name != null) ? new String(name) : "<no name>"); //$NON-NLS-1$ >+ return output.toString(); > } > } >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.156 >diff -u -r1.156 ClassScope.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java 7 Jan 2008 14:16:17 -0000 1.156 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java 20 Feb 2008 07:03:05 -0000 >@@ -10,7 +10,8 @@ > *******************************************************************************/ > package org.eclipse.jdt.internal.compiler.lookup; > >-import java.util.*; >+import java.util.HashMap; >+import java.util.Map; > > import org.eclipse.jdt.core.compiler.CharOperation; > import org.eclipse.jdt.internal.compiler.ast.ASTNode; >@@ -33,7 +34,7 @@ > public TypeReference superTypeReference; > > public ClassScope(Scope parent, TypeDeclaration context) { >- super(CLASS_SCOPE, parent); >+ super(Scope.CLASS_SCOPE, parent); > this.referenceContext = context; > } > >@@ -45,7 +46,7 @@ > } else { > anonymousType.superclass = supertype; > anonymousType.superInterfaces = Binding.NO_SUPERINTERFACES; >- TypeReference typeReference = referenceContext.allocation.type; >+ TypeReference typeReference = this.referenceContext.allocation.type; > if (typeReference != null) { // no check for enum constant body > if (supertype.erasure().id == TypeIds.T_JavaLangEnum) { > problemReporter().cannotExtendEnum(anonymousType, typeReference, supertype); >@@ -69,13 +70,13 @@ > } > > private void buildFields() { >- SourceTypeBinding sourceType = referenceContext.binding; >- if (referenceContext.fields == null) { >+ SourceTypeBinding sourceType = this.referenceContext.binding; >+ if (this.referenceContext.fields == null) { > sourceType.setFields(Binding.NO_FIELDS); > return; > } > // count the number of fields vs. initializers >- FieldDeclaration[] fields = referenceContext.fields; >+ FieldDeclaration[] fields = this.referenceContext.fields; > int size = fields.length; > int count = 0; > for (int i = 0; i < size; i++) { >@@ -150,7 +151,7 @@ > buildFields(); > buildMethods(); > >- SourceTypeBinding sourceType = referenceContext.binding; >+ SourceTypeBinding sourceType = this.referenceContext.binding; > if (sourceType.isMemberType() && !sourceType.isLocalType()) > ((MemberTypeBinding) sourceType).checkSyntheticArgsAndFields(); > >@@ -161,24 +162,24 @@ > > private LocalTypeBinding buildLocalType(SourceTypeBinding enclosingType, ReferenceBinding anonymousOriginalSuperType, PackageBinding packageBinding) { > >- referenceContext.scope = this; >- referenceContext.staticInitializerScope = new MethodScope(this, referenceContext, true); >- referenceContext.initializerScope = new MethodScope(this, referenceContext, false); >+ this.referenceContext.scope = this; >+ this.referenceContext.staticInitializerScope = new MethodScope(this, this.referenceContext, true); >+ this.referenceContext.initializerScope = new MethodScope(this, this.referenceContext, false); > > // build the binding or the local type > LocalTypeBinding localType = new LocalTypeBinding(this, enclosingType, this.innermostSwitchCase(), anonymousOriginalSuperType); >- referenceContext.binding = localType; >+ this.referenceContext.binding = localType; > checkAndSetModifiers(); > buildTypeVariables(); > > // Look at member types > ReferenceBinding[] memberTypeBindings = Binding.NO_MEMBER_TYPES; >- if (referenceContext.memberTypes != null) { >- int size = referenceContext.memberTypes.length; >+ if (this.referenceContext.memberTypes != null) { >+ int size = this.referenceContext.memberTypes.length; > memberTypeBindings = new ReferenceBinding[size]; > int count = 0; > nextMember : for (int i = 0; i < size; i++) { >- TypeDeclaration memberContext = referenceContext.memberTypes[i]; >+ TypeDeclaration memberContext = this.referenceContext.memberTypes[i]; > switch(TypeDeclaration.kind(memberContext.modifiers)) { > case TypeDeclaration.INTERFACE_DECL : > case TypeDeclaration.ANNOTATION_TYPE_DECL : >@@ -196,12 +197,12 @@ > } while (type != null); > // check the member type does not conflict with another sibling member type > for (int j = 0; j < i; j++) { >- if (CharOperation.equals(referenceContext.memberTypes[j].name, memberContext.name)) { >+ if (CharOperation.equals(this.referenceContext.memberTypes[j].name, memberContext.name)) { > problemReporter().duplicateNestedType(memberContext); > continue nextMember; > } > } >- ClassScope memberScope = new ClassScope(this, referenceContext.memberTypes[i]); >+ ClassScope memberScope = new ClassScope(this, this.referenceContext.memberTypes[i]); > LocalTypeBinding memberBinding = memberScope.buildLocalType(localType, null /* anonymous super type*/, packageBinding); > memberBinding.setAsMemberType(); > memberTypeBindings[count++] = memberBinding; >@@ -220,18 +221,18 @@ > buildFieldsAndMethods(); > localType.faultInTypesForFieldsAndMethods(); > >- referenceContext.binding.verifyMethods(environment().methodVerifier()); >+ this.referenceContext.binding.verifyMethods(environment().methodVerifier()); > } > > private void buildMemberTypes(AccessRestriction accessRestriction) { >- SourceTypeBinding sourceType = referenceContext.binding; >+ SourceTypeBinding sourceType = this.referenceContext.binding; > ReferenceBinding[] memberTypeBindings = Binding.NO_MEMBER_TYPES; >- if (referenceContext.memberTypes != null) { >- int length = referenceContext.memberTypes.length; >+ if (this.referenceContext.memberTypes != null) { >+ int length = this.referenceContext.memberTypes.length; > memberTypeBindings = new ReferenceBinding[length]; > int count = 0; > nextMember : for (int i = 0; i < length; i++) { >- TypeDeclaration memberContext = referenceContext.memberTypes[i]; >+ TypeDeclaration memberContext = this.referenceContext.memberTypes[i]; > switch(TypeDeclaration.kind(memberContext.modifiers)) { > case TypeDeclaration.INTERFACE_DECL : > case TypeDeclaration.ANNOTATION_TYPE_DECL : >@@ -254,7 +255,7 @@ > } while (type != null); > // check that the member type does not conflict with another sibling member type > for (int j = 0; j < i; j++) { >- if (CharOperation.equals(referenceContext.memberTypes[j].name, memberContext.name)) { >+ if (CharOperation.equals(this.referenceContext.memberTypes[j].name, memberContext.name)) { > problemReporter().duplicateNestedType(memberContext); > continue nextMember; > } >@@ -270,14 +271,14 @@ > } > > private void buildMethods() { >- boolean isEnum = TypeDeclaration.kind(referenceContext.modifiers) == TypeDeclaration.ENUM_DECL; >- if (referenceContext.methods == null && !isEnum) { >- referenceContext.binding.setMethods(Binding.NO_METHODS); >+ boolean isEnum = TypeDeclaration.kind(this.referenceContext.modifiers) == TypeDeclaration.ENUM_DECL; >+ if (this.referenceContext.methods == null && !isEnum) { >+ this.referenceContext.binding.setMethods(Binding.NO_METHODS); > return; > } > > // iterate the method declarations to create the bindings >- AbstractMethodDeclaration[] methods = referenceContext.methods; >+ AbstractMethodDeclaration[] methods = this.referenceContext.methods; > int size = methods == null ? 0 : methods.length; > // look for <clinit> method > int clinitIndex = -1; >@@ -291,7 +292,7 @@ > int count = isEnum ? 2 : 0; // reserve 2 slots for special enum methods: #values() and #valueOf(String) > MethodBinding[] methodBindings = new MethodBinding[(clinitIndex == -1 ? size : size - 1) + count]; > // create special methods for enums >- SourceTypeBinding sourceType = referenceContext.binding; >+ SourceTypeBinding sourceType = this.referenceContext.binding; > if (isEnum) { > methodBindings[0] = sourceType.addSyntheticEnumMethod(TypeConstants.VALUES); // add <EnumType>[] values() > methodBindings[1] = sourceType.addSyntheticEnumMethod(TypeConstants.VALUEOF); // add <EnumType> valueOf() >@@ -313,17 +314,17 @@ > > SourceTypeBinding buildType(SourceTypeBinding enclosingType, PackageBinding packageBinding, AccessRestriction accessRestriction) { > // provide the typeDeclaration with needed scopes >- referenceContext.scope = this; >- referenceContext.staticInitializerScope = new MethodScope(this, referenceContext, true); >- referenceContext.initializerScope = new MethodScope(this, referenceContext, false); >+ this.referenceContext.scope = this; >+ this.referenceContext.staticInitializerScope = new MethodScope(this, this.referenceContext, true); >+ this.referenceContext.initializerScope = new MethodScope(this, this.referenceContext, false); > > if (enclosingType == null) { >- char[][] className = CharOperation.arrayConcat(packageBinding.compoundName, referenceContext.name); >- referenceContext.binding = new SourceTypeBinding(className, packageBinding, this); >+ char[][] className = CharOperation.arrayConcat(packageBinding.compoundName, this.referenceContext.name); >+ this.referenceContext.binding = new SourceTypeBinding(className, packageBinding, this); > } else { > char[][] className = CharOperation.deepCopy(enclosingType.compoundName); > className[className.length - 1] = >- CharOperation.concat(className[className.length - 1], referenceContext.name, '$'); >+ CharOperation.concat(className[className.length - 1], this.referenceContext.name, '$'); > ReferenceBinding existingType = packageBinding.getType0(className[className.length - 1]); > if (existingType != null) { > if (existingType instanceof UnresolvedReferenceBinding) { >@@ -331,13 +332,13 @@ > // so just replace the unresolved type with a new member type > } else { > // report the error against the parent - its still safe to answer the member type >- this.parent.problemReporter().duplicateNestedType(referenceContext); >+ this.parent.problemReporter().duplicateNestedType(this.referenceContext); > } > } >- referenceContext.binding = new MemberTypeBinding(className, this, enclosingType); >+ this.referenceContext.binding = new MemberTypeBinding(className, this, enclosingType); > } > >- SourceTypeBinding sourceType = referenceContext.binding; >+ SourceTypeBinding sourceType = this.referenceContext.binding; > environment().setAccessRestriction(sourceType, accessRestriction); > sourceType.fPackage.addType(sourceType); > checkAndSetModifiers(); >@@ -348,8 +349,8 @@ > > private void buildTypeVariables() { > >- SourceTypeBinding sourceType = referenceContext.binding; >- TypeParameter[] typeParameters = referenceContext.typeParameters; >+ SourceTypeBinding sourceType = this.referenceContext.binding; >+ TypeParameter[] typeParameters = this.referenceContext.typeParameters; > > // do not construct type variables if source < 1.5 > if (typeParameters == null || compilerOptions().sourceLevel < ClassFileConstants.JDK1_5) { >@@ -358,8 +359,8 @@ > } > sourceType.typeVariables = Binding.NO_TYPE_VARIABLES; // safety > >- if (sourceType.id == T_JavaLangObject) { // handle the case of redefining java.lang.Object up front >- problemReporter().objectCannotBeGeneric(referenceContext); >+ if (sourceType.id == TypeIds.T_JavaLangObject) { // handle the case of redefining java.lang.Object up front >+ problemReporter().objectCannotBeGeneric(this.referenceContext); > return; > } > sourceType.typeVariables = createTypeVariables(typeParameters, sourceType); >@@ -367,7 +368,7 @@ > } > > private void checkAndSetModifiers() { >- SourceTypeBinding sourceType = referenceContext.binding; >+ SourceTypeBinding sourceType = this.referenceContext.binding; > int modifiers = sourceType.modifiers; > if ((modifiers & ExtraCompilerModifiers.AccAlternateModifierProblem) != 0) > problemReporter().duplicateModifierForType(sourceType); >@@ -388,14 +389,14 @@ > modifiers |= ExtraCompilerModifiers.AccDeprecatedImplicitly; > } else if (sourceType.isLocalType()) { > if (sourceType.isEnum()) { >- problemReporter().illegalLocalTypeDeclaration(referenceContext); >+ problemReporter().illegalLocalTypeDeclaration(this.referenceContext); > sourceType.modifiers = 0; > return; > } > if (sourceType.isAnonymousType()) { > modifiers |= ClassFileConstants.AccFinal; > // set AccEnum flag for anonymous body of enum constants >- if (referenceContext.allocation.type == null) >+ if (this.referenceContext.allocation.type == null) > modifiers |= ClassFileConstants.AccEnum; > } > Scope scope = this; >@@ -493,7 +494,7 @@ > if (!sourceType.isAnonymousType()) { > checkAbstractEnum: { > // does define abstract methods ? >- if ((referenceContext.bits & ASTNode.HasAbstractMethods) != 0) { >+ if ((this.referenceContext.bits & ASTNode.HasAbstractMethods) != 0) { > modifiers |= ClassFileConstants.AccAbstract; > break checkAbstractEnum; > } >@@ -678,19 +679,19 @@ > > public void checkParameterizedSuperTypeCollisions() { > // check for parameterized interface collisions (when different parameterizations occur) >- SourceTypeBinding sourceType = referenceContext.binding; >+ SourceTypeBinding sourceType = this.referenceContext.binding; > ReferenceBinding[] interfaces = sourceType.superInterfaces; > Map invocations = new HashMap(2); > ReferenceBinding itsSuperclass = sourceType.isInterface() ? null : sourceType.superclass; > nextInterface: for (int i = 0, length = interfaces.length; i < length; i++) { > ReferenceBinding one = interfaces[i]; > if (one == null) continue nextInterface; >- if (itsSuperclass != null && hasErasedCandidatesCollisions(itsSuperclass, one, invocations, sourceType, referenceContext)) >+ if (itsSuperclass != null && hasErasedCandidatesCollisions(itsSuperclass, one, invocations, sourceType, this.referenceContext)) > continue nextInterface; > nextOtherInterface: for (int j = 0; j < i; j++) { > ReferenceBinding two = interfaces[j]; > if (two == null) continue nextOtherInterface; >- if (hasErasedCandidatesCollisions(one, two, invocations, sourceType, referenceContext)) >+ if (hasErasedCandidatesCollisions(one, two, invocations, sourceType, this.referenceContext)) > continue nextInterface; > } > } >@@ -721,7 +722,7 @@ > } > } > >- ReferenceBinding[] memberTypes = referenceContext.binding.memberTypes; >+ ReferenceBinding[] memberTypes = this.referenceContext.binding.memberTypes; > if (memberTypes != null && memberTypes != Binding.NO_MEMBER_TYPES) > for (int i = 0, size = memberTypes.length; i < size; i++) > ((SourceTypeBinding) memberTypes[i]).scope.checkParameterizedSuperTypeCollisions(); >@@ -798,28 +799,28 @@ > > // Perform deferred bound checks for parameterized type references (only done after hierarchy is connected) > public void checkParameterizedTypeBounds() { >- TypeReference superclass = referenceContext.superclass; >+ TypeReference superclass = this.referenceContext.superclass; > if (superclass != null) > superclass.checkBounds(this); > >- TypeReference[] superinterfaces = referenceContext.superInterfaces; >+ TypeReference[] superinterfaces = this.referenceContext.superInterfaces; > if (superinterfaces != null) > for (int i = 0, length = superinterfaces.length; i < length; i++) > superinterfaces[i].checkBounds(this); > >- TypeParameter[] typeParameters = referenceContext.typeParameters; >+ TypeParameter[] typeParameters = this.referenceContext.typeParameters; > if (typeParameters != null) > for (int i = 0, paramLength = typeParameters.length; i < paramLength; i++) > typeParameters[i].checkBounds(this); > >- ReferenceBinding[] memberTypes = referenceContext.binding.memberTypes; >+ ReferenceBinding[] memberTypes = this.referenceContext.binding.memberTypes; > if (memberTypes != null && memberTypes != Binding.NO_MEMBER_TYPES) > for (int i = 0, size = memberTypes.length; i < size; i++) > ((SourceTypeBinding) memberTypes[i]).scope.checkParameterizedTypeBounds(); > } > > private void connectMemberTypes() { >- SourceTypeBinding sourceType = referenceContext.binding; >+ SourceTypeBinding sourceType = this.referenceContext.binding; > ReferenceBinding[] memberTypes = sourceType.memberTypes; > if (memberTypes != null && memberTypes != Binding.NO_MEMBER_TYPES) { > for (int i = 0, size = memberTypes.length; i < size; i++) >@@ -838,33 +839,38 @@ > Answer false if an error was reported against the sourceType. > */ > private boolean connectSuperclass() { >- SourceTypeBinding sourceType = referenceContext.binding; >- if (sourceType.id == T_JavaLangObject) { // handle the case of redefining java.lang.Object up front >+ SourceTypeBinding sourceType = this.referenceContext.binding; >+ if (sourceType.id == TypeIds.T_JavaLangObject) { // handle the case of redefining java.lang.Object up front > sourceType.superclass = null; > sourceType.superInterfaces = Binding.NO_SUPERINTERFACES; > if (!sourceType.isClass()) > problemReporter().objectMustBeClass(sourceType); >- if (referenceContext.superclass != null || (referenceContext.superInterfaces != null && referenceContext.superInterfaces.length > 0)) >+ if (this.referenceContext.superclass != null || (this.referenceContext.superInterfaces != null && this.referenceContext.superInterfaces.length > 0)) > problemReporter().objectCannotHaveSuperTypes(sourceType); > return true; // do not propagate Object's hierarchy problems down to every subtype > } >- if (referenceContext.superclass == null) { >+ if (this.referenceContext.superclass == null) { > if (sourceType.isEnum() && compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5) // do not connect if source < 1.5 as enum already got flagged as syntax error > return connectEnumSuperclass(); > sourceType.superclass = getJavaLangObject(); > return !detectHierarchyCycle(sourceType, sourceType.superclass, null); > } >- TypeReference superclassRef = referenceContext.superclass; >+ TypeReference superclassRef = this.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); > } else if ((superclass.tagBits & TagBits.HasDirectWildcard) != 0) { > problemReporter().superTypeCannotUseWildcard(sourceType, superclassRef, superclass); >- } else if (superclass.erasure().id == T_JavaLangEnum) { >+ } else if (superclass.erasure().id == TypeIds.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; >@@ -882,20 +888,26 @@ > * enum X (implicitly) extends Enum<X> > */ > private boolean connectEnumSuperclass() { >- SourceTypeBinding sourceType = referenceContext.binding; >+ SourceTypeBinding sourceType = this.referenceContext.binding; > ReferenceBinding rootEnumType = getJavaLangEnum(); > boolean foundCycle = detectHierarchyCycle(sourceType, rootEnumType, null); > // 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 }); > return false; // cannot reach here as AbortCompilation is thrown > } > // check argument type compatibility >- ParameterizedTypeBinding superType = environment().createParameterizedType(rootEnumType, new TypeBinding[]{ environment().convertToRawType(sourceType, false /*do not force conversion of enclosing types*/) } , null); >+ ParameterizedTypeBinding superType = environment().createParameterizedType( >+ rootEnumType, >+ new TypeBinding[]{ >+ environment().convertToRawType(sourceType, false /*do not force conversion of enclosing types*/), >+ } , >+ 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) { >@@ -915,9 +927,9 @@ > Answer false if an error was reported against the sourceType. > */ > private boolean connectSuperInterfaces() { >- SourceTypeBinding sourceType = referenceContext.binding; >+ SourceTypeBinding sourceType = this.referenceContext.binding; > sourceType.superInterfaces = Binding.NO_SUPERINTERFACES; >- if (referenceContext.superInterfaces == null) { >+ if (this.referenceContext.superInterfaces == null) { > if (sourceType.isAnnotationType() && compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5) { // do not connect if source < 1.5 as annotation already got flagged as syntax error) { > ReferenceBinding annotationType = getJavaLangAnnotationAnnotation(); > boolean foundCycle = detectHierarchyCycle(sourceType, annotationType, null); >@@ -926,31 +938,33 @@ > } > return true; > } >- if (sourceType.id == T_JavaLangObject) // already handled the case of redefining java.lang.Object >+ if (sourceType.id == TypeIds.T_JavaLangObject) // already handled the case of redefining java.lang.Object > return true; > > boolean noProblems = true; >- int length = referenceContext.superInterfaces.length; >+ int length = this.referenceContext.superInterfaces.length; > ReferenceBinding[] interfaceBindings = new ReferenceBinding[length]; > int count = 0; > nextInterface : for (int i = 0; i < length; i++) { >- TypeReference superInterfaceRef = referenceContext.superInterfaces[i]; >+ TypeReference superInterfaceRef = this.referenceContext.superInterfaces[i]; > ReferenceBinding superInterface = findSupertype(superInterfaceRef); > if (superInterface == null) { // detected cycle > sourceType.tagBits |= TagBits.HierarchyHasProblems; > 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 +978,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; > } >@@ -977,13 +996,13 @@ > } > > void connectTypeHierarchy() { >- SourceTypeBinding sourceType = referenceContext.binding; >+ SourceTypeBinding sourceType = this.referenceContext.binding; > if ((sourceType.tagBits & TagBits.BeginHierarchyCheck) == 0) { > sourceType.tagBits |= TagBits.BeginHierarchyCheck; > boolean noProblems = connectSuperclass(); > noProblems &= connectSuperInterfaces(); > sourceType.tagBits |= TagBits.EndHierarchyCheck; >- noProblems &= connectTypeVariables(referenceContext.typeParameters, false); >+ noProblems &= connectTypeVariables(this.referenceContext.typeParameters, false); > sourceType.tagBits |= TagBits.TypeVariablesAreConnected; > if (noProblems && sourceType.isHierarchyInconsistent()) > problemReporter().hierarchyHasProblems(sourceType); >@@ -991,10 +1010,10 @@ > connectMemberTypes(); > LookupEnvironment env = environment(); > try { >- env.missingClassFileLocation = referenceContext; >+ env.missingClassFileLocation = this.referenceContext; > checkForInheritedMemberTypes(sourceType); > } catch (AbortCompilation e) { >- e.updateContext(referenceContext, referenceCompilationUnit().compilationResult); >+ e.updateContext(this.referenceContext, referenceCompilationUnit().compilationResult); > throw e; > } finally { > env.missingClassFileLocation = null; >@@ -1003,16 +1022,16 @@ > > private void connectTypeHierarchyWithoutMembers() { > // must ensure the imports are resolved >- if (parent instanceof CompilationUnitScope) { >- if (((CompilationUnitScope) parent).imports == null) >- ((CompilationUnitScope) parent).checkAndSetImports(); >- } else if (parent instanceof ClassScope) { >+ if (this.parent instanceof CompilationUnitScope) { >+ if (((CompilationUnitScope) this.parent).imports == null) >+ ((CompilationUnitScope) this.parent).checkAndSetImports(); >+ } else if (this.parent instanceof ClassScope) { > // ensure that the enclosing type has already been checked >- ((ClassScope) parent).connectTypeHierarchyWithoutMembers(); >+ ((ClassScope) this.parent).connectTypeHierarchyWithoutMembers(); > } > > // double check that the hierarchy search has not already begun... >- SourceTypeBinding sourceType = referenceContext.binding; >+ SourceTypeBinding sourceType = this.referenceContext.binding; > if ((sourceType.tagBits & TagBits.BeginHierarchyCheck) != 0) > return; > >@@ -1020,7 +1039,7 @@ > boolean noProblems = connectSuperclass(); > noProblems &= connectSuperInterfaces(); > sourceType.tagBits |= TagBits.EndHierarchyCheck; >- noProblems &= connectTypeVariables(referenceContext.typeParameters, false); >+ noProblems &= connectTypeVariables(this.referenceContext.typeParameters, false); > sourceType.tagBits |= TagBits.TypeVariablesAreConnected; > if (noProblems && sourceType.isHierarchyInconsistent()) > problemReporter().hierarchyHasProblems(sourceType); >@@ -1037,7 +1056,7 @@ > if (superType.isParameterizedType()) > superType = ((ParameterizedTypeBinding) superType).genericType(); > compilationUnitScope().recordSuperTypeReference(superType); // to record supertypes >- return detectHierarchyCycle(referenceContext.binding, (ReferenceBinding) superType, reference); >+ return detectHierarchyCycle(this.referenceContext.binding, (ReferenceBinding) superType, reference); > } > return false; > } >@@ -1160,7 +1179,7 @@ > MethodScope outerMethodScope; > if ((outerMethodScope = outerMostMethodScope()) == null) { > ProblemReporter problemReporter = referenceCompilationUnit().problemReporter; >- problemReporter.referenceContext = referenceContext; >+ problemReporter.referenceContext = this.referenceContext; > return problemReporter; > } > return outerMethodScope.problemReporter(); >@@ -1170,13 +1189,13 @@ > * It is the nearest enclosing type of this scope. > */ > public TypeDeclaration referenceType() { >- return referenceContext; >+ return this.referenceContext; > } > > public String toString() { >- if (referenceContext != null) >+ if (this.referenceContext != null) > return "--- Class Scope ---\n\n" //$NON-NLS-1$ >- + referenceContext.binding.toString(); >+ + this.referenceContext.binding.toString(); > return "--- Class Scope ---\n\n Binding not initialized" ; //$NON-NLS-1$ > } > } >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedGenericMethodBinding.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedGenericMethodBinding.java,v >retrieving revision 1.62 >diff -u -r1.62 ParameterizedGenericMethodBinding.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedGenericMethodBinding.java 31 Jan 2008 17:02:33 -0000 1.62 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedGenericMethodBinding.java 20 Feb 2008 07:03:15 -0000 >@@ -267,7 +267,7 @@ > TypeBinding[] rawArguments = new TypeBinding[length]; > for (int i = 0; i < length; i++) { > rawArguments[i] = environment.convertToRawType(originalVariables[i].erasure(), false /*do not force conversion of enclosing types*/); >- } >+ } > this.isRaw = true; > this.tagBits = originalMethod.tagBits; > this.environment = environment; >@@ -311,6 +311,26 @@ > // error case where exception type variable would have been substituted by a non-reference type (207573) > if (this.thrownExceptions == null) this.thrownExceptions = Binding.NO_EXCEPTIONS; > this.returnType = Scope.substitute(this, originalMethod.returnType); >+ checkMissingType: { >+ if ((this.tagBits & TagBits.HasMissingType) != 0) >+ break checkMissingType; >+ if ((this.returnType.tagBits & TagBits.HasMissingType) != 0) { >+ this.tagBits |= TagBits.HasMissingType; >+ break checkMissingType; >+ } >+ for (int i = 0, max = this.parameters.length; i < max; i++) { >+ if ((this.parameters[i].tagBits & TagBits.HasMissingType) != 0) { >+ this.tagBits |= TagBits.HasMissingType; >+ break checkMissingType; >+ } >+ } >+ for (int i = 0, max = this.thrownExceptions.length; i < max; i++) { >+ if ((this.thrownExceptions[i].tagBits & TagBits.HasMissingType) != 0) { >+ this.tagBits |= TagBits.HasMissingType; >+ break checkMissingType; >+ } >+ } >+ } > this.wasInferred = true;// resulting from method invocation inferrence > } > >@@ -335,7 +355,6 @@ > char[] result = new char[resultLength]; > buffer.getChars(0, resultLength, result, 0); > return result; >- > } > > /** >@@ -438,6 +457,26 @@ > this.thrownExceptions = Scope.substitute(this, this.thrownExceptions); > // error case where exception type variable would have been substituted by a non-reference type (207573) > if (this.thrownExceptions == null) this.thrownExceptions = Binding.NO_EXCEPTIONS; >+ checkMissingType: { >+ if ((this.tagBits & TagBits.HasMissingType) != 0) >+ break checkMissingType; >+ if ((this.returnType.tagBits & TagBits.HasMissingType) != 0) { >+ this.tagBits |= TagBits.HasMissingType; >+ break checkMissingType; >+ } >+ for (int i = 0, max = this.parameters.length; i < max; i++) { >+ if ((this.parameters[i].tagBits & TagBits.HasMissingType) != 0) { >+ this.tagBits |= TagBits.HasMissingType; >+ break checkMissingType; >+ } >+ } >+ for (int i = 0, max = this.thrownExceptions.length; i < max; i++) { >+ if ((this.thrownExceptions[i].tagBits & TagBits.HasMissingType) != 0) { >+ this.tagBits |= TagBits.HasMissingType; >+ break checkMissingType; >+ } >+ } >+ } > return this; > } > >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java,v >retrieving revision 1.98 >diff -u -r1.98 MethodBinding.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java 9 Jan 2008 12:32:36 -0000 1.98 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java 20 Feb 2008 07:03:13 -0000 >@@ -10,6 +10,8 @@ > *******************************************************************************/ > package org.eclipse.jdt.internal.compiler.lookup; > >+import java.util.List; >+ > import org.eclipse.jdt.core.compiler.CharOperation; > import org.eclipse.jdt.internal.compiler.ClassFile; > import org.eclipse.jdt.internal.compiler.ast.ASTNode; >@@ -78,22 +80,6 @@ > return false; > return true; > } >-/* Answer true if the argument types & the receiver's parameters are equal >-*/ >-public final boolean areParametersEqual(MethodBinding method) { >- TypeBinding[] args = method.parameters; >- if (parameters == args) >- return true; >- >- int length = parameters.length; >- if (length != args.length) >- return false; >- >- for (int i = 0; i < length; i++) >- if (parameters[i] != args[i]) >- return false; >- return true; >-} > /* > * Returns true if given parameters are compatible with this method parameters. > * Callers to this method should first check that the number of TypeBindings >@@ -125,24 +111,27 @@ > return false; > return true; > } >- >-/* API >-* Answer the receiver's binding type from Binding.BindingID. >+/* Answer true if the argument types & the receiver's parameters are equal > */ >+public final boolean areParametersEqual(MethodBinding method) { >+ TypeBinding[] args = method.parameters; >+ if (parameters == args) >+ return true; > >-public final int kind() { >- return Binding.METHOD; >+ int length = parameters.length; >+ if (length != args.length) >+ return false; >+ >+ for (int i = 0; i < length; i++) >+ if (parameters[i] != args[i]) >+ return false; >+ return true; > } >-/* Answer true if the receiver is visible to the invocationPackage. >-*/ > >-public final boolean canBeSeenBy(PackageBinding invocationPackage) { >- if (isPublic()) return true; >- if (isPrivate()) return false; >+/* API >+* Answer the receiver's binding type from Binding.BindingID. >+*/ > >- // isProtected() or isDefault() >- return invocationPackage == declaringClass.getPackage(); >-} > /* Answer true if the type variables have the same erasure > */ > public final boolean areTypeVariableErasuresEqual(MethodBinding method) { >@@ -202,6 +191,14 @@ > // isDefault() > return invocationType.fPackage == declaringClass.fPackage; > } >+public final boolean canBeSeenBy(PackageBinding invocationPackage) { >+ if (isPublic()) return true; >+ if (isPrivate()) return false; >+ >+ // isProtected() or isDefault() >+ return invocationPackage == declaringClass.getPackage(); >+} >+ > /* Answer true if the receiver is visible to the type provided by the scope. > * InvocationSite implements isSuperAccess() to provide additional information > * if the receiver is protected. >@@ -299,6 +296,28 @@ > } while ((currentType = currentType.superclass()) != null); > return false; > } >+ >+public List collectMissingTypes(List missingTypes) { >+ if ((this.tagBits & TagBits.HasMissingType) != 0) { >+ missingTypes = this.returnType.collectMissingTypes(missingTypes); >+ for (int i = 0, max = this.parameters.length; i < max; i++) { >+ missingTypes = this.parameters[i].collectMissingTypes(missingTypes); >+ } >+ for (int i = 0, max = this.thrownExceptions.length; i < max; i++) { >+ missingTypes = this.thrownExceptions[i].collectMissingTypes(missingTypes); >+ } >+ for (int i = 0, max = this.typeVariables.length; i < max; i++) { >+ TypeVariableBinding variable = this.typeVariables[i]; >+ missingTypes = variable.superclass().collectMissingTypes(missingTypes); >+ ReferenceBinding[] interfaces = variable.superInterfaces(); >+ for (int j = 0, length = interfaces.length; j < length; j++) { >+ missingTypes = interfaces[i].collectMissingTypes(missingTypes); >+ } >+ } >+ } >+ return missingTypes; >+} >+ > MethodBinding computeSubstitutedMethod(MethodBinding method, LookupEnvironment env) { > int length = this.typeVariables.length; > TypeVariableBinding[] vars = method.typeVariables; >@@ -315,6 +334,7 @@ > return null; > return substitute; > } >+ > /* > * declaringUniqueKey dot selector genericSignature > * p.X { <T> void bar(X<T> t) } --> Lp/X;.bar<T:Ljava/lang/Object;>(LX<TT;>;)V >@@ -368,9 +388,9 @@ > } > } > } >- > return uniqueKey; > } >+ > /* > * Answer the declaring class to use in the constant pool > * may not be a reference binding (see subtypes) >@@ -378,6 +398,7 @@ > public TypeBinding constantPoolDeclaringClass() { > return this.declaringClass; > } >+ > /* Answer the receiver's constant pool name. > * > * <init> for constructors >@@ -387,6 +408,7 @@ > public final char[] constantPoolName() { > return selector; > } >+ > /** > *<typeParam1 ... typeParamM>(param1 ... paramN)returnType thrownException1 ... thrownExceptionP > * T foo(T t) throws X<T> ---> (TT;)TT;LX<TT;>; >@@ -431,53 +453,15 @@ > sig.getChars(0, sigLength, genericSignature, 0); > return genericSignature; > } >+ >+public final int getAccessFlags() { >+ return modifiers & ExtraCompilerModifiers.AccJustFlag; >+} >+ > public AnnotationBinding[] getAnnotations() { > MethodBinding originalMethod = this.original(); > return originalMethod.declaringClass.retrieveAnnotations(originalMethod); > } >-/** >- * @return the annotations for each of the method parameters or <code>null></code> >- * if there's no parameter or no annotation at all. >- */ >-public AnnotationBinding[][] getParameterAnnotations() { >- int length = this.parameters.length; >- if (this.parameters == null || length == 0) { >- return null; >- } >- MethodBinding originalMethod = this.original(); >- AnnotationHolder holder = originalMethod.declaringClass.retrieveAnnotationHolder(originalMethod, true); >- AnnotationBinding[][] allParameterAnnotations = holder == null ? null : holder.getParameterAnnotations(); >- if (allParameterAnnotations == null && (this.tagBits & TagBits.HasParameterAnnotations) != 0) { >- allParameterAnnotations = new AnnotationBinding[length][]; >- // forward reference to method, where param annotations have not yet been associated to method >- if (this.declaringClass instanceof SourceTypeBinding) { >- SourceTypeBinding sourceType = (SourceTypeBinding) this.declaringClass; >- if (sourceType.scope != null) { >- AbstractMethodDeclaration methodDecl = sourceType.scope.referenceType().declarationOf(this); >- for (int i = 0; i < length; i++) { >- Argument argument = methodDecl.arguments[i]; >- if (argument.annotations != null) { >- ASTNode.resolveAnnotations(methodDecl.scope, argument.annotations, argument.binding); >- allParameterAnnotations[i] = argument.binding.getAnnotations(); >- } >- } >- } else { >- for (int i = 0; i < length; i++) { >- allParameterAnnotations[i] = Binding.NO_ANNOTATIONS; >- } >- } >- } else { >- for (int i = 0; i < length; i++) { >- allParameterAnnotations[i] = Binding.NO_ANNOTATIONS; >- } >- } >- this.setParameterAnnotations(allParameterAnnotations); >- } >- return allParameterAnnotations; >-} >-public final int getAccessFlags() { >- return modifiers & ExtraCompilerModifiers.AccJustFlag; >-} > > /** > * Compute the tagbits for standard annotations. For source types, these could require >@@ -519,6 +503,47 @@ > AnnotationHolder holder = originalMethod.declaringClass.retrieveAnnotationHolder(originalMethod, true); > return holder == null ? null : holder.getDefaultValue(); > } >+ >+/** >+ * @return the annotations for each of the method parameters or <code>null></code> >+ * if there's no parameter or no annotation at all. >+ */ >+public AnnotationBinding[][] getParameterAnnotations() { >+ int length = this.parameters.length; >+ if (this.parameters == null || length == 0) { >+ return null; >+ } >+ MethodBinding originalMethod = this.original(); >+ AnnotationHolder holder = originalMethod.declaringClass.retrieveAnnotationHolder(originalMethod, true); >+ AnnotationBinding[][] allParameterAnnotations = holder == null ? null : holder.getParameterAnnotations(); >+ if (allParameterAnnotations == null && (this.tagBits & TagBits.HasParameterAnnotations) != 0) { >+ allParameterAnnotations = new AnnotationBinding[length][]; >+ // forward reference to method, where param annotations have not yet been associated to method >+ if (this.declaringClass instanceof SourceTypeBinding) { >+ SourceTypeBinding sourceType = (SourceTypeBinding) this.declaringClass; >+ if (sourceType.scope != null) { >+ AbstractMethodDeclaration methodDecl = sourceType.scope.referenceType().declarationOf(this); >+ for (int i = 0; i < length; i++) { >+ Argument argument = methodDecl.arguments[i]; >+ if (argument.annotations != null) { >+ ASTNode.resolveAnnotations(methodDecl.scope, argument.annotations, argument.binding); >+ allParameterAnnotations[i] = argument.binding.getAnnotations(); >+ } >+ } >+ } else { >+ for (int i = 0; i < length; i++) { >+ allParameterAnnotations[i] = Binding.NO_ANNOTATIONS; >+ } >+ } >+ } else { >+ for (int i = 0; i < length; i++) { >+ allParameterAnnotations[i] = Binding.NO_ANNOTATIONS; >+ } >+ } >+ this.setParameterAnnotations(allParameterAnnotations); >+ } >+ return allParameterAnnotations; >+} > public TypeVariableBinding getTypeVariable(char[] variableName) { > for (int i = this.typeVariables.length; --i >= 0;) > if (CharOperation.equals(this.typeVariables[i].sourceName, variableName)) >@@ -532,7 +557,6 @@ > public boolean hasSubstitutedParameters() { > return false; > } >- > /* Answer true if the return type got substituted. > */ > public boolean hasSubstitutedReturnType() { >@@ -589,18 +613,6 @@ > return (modifiers & ExtraCompilerModifiers.AccImplementing) != 0; > } > >-/* Answer true if the receiver is a native method >-*/ >-public final boolean isNative() { >- return (modifiers & ClassFileConstants.AccNative) != 0; >-} >- >-/* Answer true if the receiver is overriding another method >- * Only set for source methods >-*/ >-public final boolean isOverriding() { >- return (modifiers & ExtraCompilerModifiers.AccOverriding) != 0; >-} > /* > * Answer true if the receiver is a "public static void main(String[])" method > */ >@@ -616,18 +628,24 @@ > } > return false; > } >-/* Answer true if the receiver has private visibility >+ >+/* Answer true if the receiver is a native method > */ >-public final boolean isPrivate() { >- return (modifiers & ClassFileConstants.AccPrivate) != 0; >+public final boolean isNative() { >+ return (modifiers & ClassFileConstants.AccNative) != 0; > } > >-/* Answer true if the receiver has private visibility and is used locally >+/* Answer true if the receiver is overriding another method >+ * Only set for source methods > */ >-public final boolean isUsed() { >- return (modifiers & ExtraCompilerModifiers.AccLocallyUsed) != 0; >+public final boolean isOverriding() { >+ return (modifiers & ExtraCompilerModifiers.AccOverriding) != 0; >+} >+/* Answer true if the receiver has private visibility >+*/ >+public final boolean isPrivate() { >+ return (modifiers & ClassFileConstants.AccPrivate) != 0; > } >- > /* Answer true if the receiver has protected visibility > */ > public final boolean isProtected() { >@@ -664,6 +682,12 @@ > return (modifiers & ClassFileConstants.AccSynthetic) != 0; > } > >+/* Answer true if the receiver has private visibility and is used locally >+*/ >+public final boolean isUsed() { >+ return (modifiers & ExtraCompilerModifiers.AccLocallyUsed) != 0; >+} >+ > /* Answer true if the receiver method has varargs > */ > public final boolean isVarargs() { >@@ -676,6 +700,12 @@ > return (modifiers & (ClassFileConstants.AccDeprecated | ExtraCompilerModifiers.AccDeprecatedImplicitly)) != 0; > } > >+public final int kind() { >+ return Binding.METHOD; >+} >+/* Answer true if the receiver is visible to the invocationPackage. >+*/ >+ > /** > * Returns the original method (as opposed to parameterized instances) > */ >@@ -723,6 +753,11 @@ > else > setAnnotations(holder.getAnnotations(), parameterAnnotations, holder.getDefaultValue()); > } >+protected final void setSelector(char[] selector) { >+ this.selector = selector; >+ this.signature = null; >+} >+ > /** > * @see org.eclipse.jdt.internal.compiler.lookup.Binding#shortReadableName() > */ >@@ -747,11 +782,6 @@ > return shortReadableName; > } > >-protected final void setSelector(char[] selector) { >- this.selector = selector; >- this.signature = null; >-} >- > /* Answer the receiver's signature. > * > * NOTE: This method should only be used during/after code gen. >@@ -974,45 +1004,49 @@ > return method.sourceStart; > } > >+/** >+ * Returns the method to use during tiebreak (usually the method itself). >+ * For generic method invocations, tiebreak needs to use generic method with erasure substitutes. >+ */ >+public MethodBinding tiebreakMethod() { >+ return this; >+} > public String toString() { >- String s = (returnType != null) ? returnType.debugName() : "NULL TYPE"; //$NON-NLS-1$ >- s += " "; //$NON-NLS-1$ >- s += (selector != null) ? new String(selector) : "UNNAMED METHOD"; //$NON-NLS-1$ >- >- s += "("; //$NON-NLS-1$ >+ StringBuffer output = new StringBuffer(10); >+ if ((this.modifiers & ExtraCompilerModifiers.AccUnresolved) != 0) { >+ output.append("[unresolved] "); //$NON-NLS-1$ >+ } >+ ASTNode.printModifiers(this.modifiers, output); >+ output.append(returnType != null ? returnType.debugName() : "<no type>"); //$NON-NLS-1$ >+ output.append(" "); //$NON-NLS-1$ >+ output.append(selector != null ? new String(selector) : "<no selector>"); //$NON-NLS-1$ >+ output.append("("); //$NON-NLS-1$ > if (parameters != null) { > if (parameters != Binding.NO_PARAMETERS) { > for (int i = 0, length = parameters.length; i < length; i++) { > if (i > 0) >- s += ", "; //$NON-NLS-1$ >- s += (parameters[i] != null) ? parameters[i].debugName() : "NULL TYPE"; //$NON-NLS-1$ >+ output.append(", "); //$NON-NLS-1$ >+ output.append(parameters[i] != null ? parameters[i].debugName() : "<no argument type>"); //$NON-NLS-1$ > } > } > } else { >- s += "NULL PARAMETERS"; //$NON-NLS-1$ >+ output.append("<no argument types>"); //$NON-NLS-1$ > } >- s += ") "; //$NON-NLS-1$ >+ output.append(") "); //$NON-NLS-1$ > > if (thrownExceptions != null) { > if (thrownExceptions != Binding.NO_EXCEPTIONS) { >- s += "throws "; //$NON-NLS-1$ >+ output.append("throws "); //$NON-NLS-1$ > for (int i = 0, length = thrownExceptions.length; i < length; i++) { > if (i > 0) >- s += ", "; //$NON-NLS-1$ >- s += (thrownExceptions[i] != null) ? thrownExceptions[i].debugName() : "NULL TYPE"; //$NON-NLS-1$ >+ output.append(", "); //$NON-NLS-1$ >+ output.append((thrownExceptions[i] != null) ? thrownExceptions[i].debugName() : "<no exception type>"); //$NON-NLS-1$ > } > } > } else { >- s += "NULL THROWN EXCEPTIONS"; //$NON-NLS-1$ >+ output.append("<no exception types>"); //$NON-NLS-1$ > } >- return s; >-} >-/** >- * Returns the method to use during tiebreak (usually the method itself). >- * For generic method invocations, tiebreak needs to use generic method with erasure substitutes. >- */ >-public MethodBinding tiebreakMethod() { >- return this; >+ return output.toString(); > } > public TypeVariableBinding[] typeVariables() { > return this.typeVariables; >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.111 >diff -u -r1.111 CompilationUnitScope.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java 7 Jan 2008 14:16:16 -0000 1.111 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java 20 Feb 2008 07:03:07 -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 20 Feb 2008 07:03:13 -0000 >@@ -25,6 +25,11 @@ > protected PackageBinding() { > // for creating problem package > } >+public PackageBinding(char[] topLevelPackageName, LookupEnvironment environment) { >+ this(new char[][] {topLevelPackageName}, null, environment); >+} >+/* Create the default package. >+*/ > public PackageBinding(char[][] compoundName, PackageBinding parent, LookupEnvironment environment) { > this.compoundName = compoundName; > this.parent = parent; >@@ -32,11 +37,6 @@ > this.knownTypes = null; // initialized if used... class counts can be very large 300-600 > this.knownPackages = new HashtableOfPackage(3); // sub-package counts are typically 0-3 > } >-public PackageBinding(char[] topLevelPackageName, LookupEnvironment environment) { >- this(new char[][] {topLevelPackageName}, null, environment); >-} >-/* Create the default package. >-*/ > > public PackageBinding(LookupEnvironment environment) { > this(CharOperation.NO_CHAR_CHAR, null, environment); >@@ -50,19 +50,21 @@ > knownTypes.put(simpleName, LookupEnvironment.TheNotFoundType); > } > void addPackage(PackageBinding element) { >+ if ((element.tagBits & TagBits.HasMissingType) == 0) clearMissingTagBit(); > knownPackages.put(element.compoundName[element.compoundName.length - 1], element); > } > void addType(ReferenceBinding element) { >+ if ((element.tagBits & TagBits.HasMissingType) == 0) clearMissingTagBit(); > if (knownTypes == null) > knownTypes = new HashtableOfType(25); > knownTypes.put(element.compoundName[element.compoundName.length - 1], element); > } >-/* API >-* Answer the receiver's binding type from Binding.BindingID. >-*/ > >-public final int kind() { >- return Binding.PACKAGE; >+void clearMissingTagBit() { >+ PackageBinding current = this; >+ do { >+ current.tagBits &= ~TagBits.HasMissingType; >+ } while ((current = current.parent) != null); > } > /* > * slash separated name >@@ -85,7 +87,6 @@ > * > * NOTE: This should only be used when we know there is NOT a type with the same name. > */ >- > PackageBinding getPackage(char[] name) { > PackageBinding binding = getPackage0(name); > if (binding != null) { >@@ -135,7 +136,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 +167,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 +178,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; > } > >@@ -194,13 +195,33 @@ > > return null; > } >+ >+/* API >+* Answer the receiver's binding type from Binding.BindingID. >+*/ >+public final int kind() { >+ return Binding.PACKAGE; >+} >+ >+public int problemId() { >+ if ((this.tagBits & TagBits.HasMissingType) != 0) >+ return ProblemReasons.NotFound; >+ return ProblemReasons.NoError; >+} >+ > public char[] readableName() /*java.lang*/ { > return CharOperation.concatWith(compoundName, '.'); > } > public String toString() { >- if (compoundName == CharOperation.NO_CHAR_CHAR) >- return "The Default Package"; //$NON-NLS-1$ >- else >- return "package " + ((compoundName != null) ? CharOperation.toString(compoundName) : "UNNAMED"); //$NON-NLS-1$ //$NON-NLS-2$ >+ String str; >+ if (compoundName == CharOperation.NO_CHAR_CHAR) { >+ str = "The Default Package"; //$NON-NLS-1$ >+ } else { >+ str = "package " + ((compoundName != null) ? CharOperation.toString(compoundName) : "UNNAMED"); //$NON-NLS-1$ //$NON-NLS-2$ >+ } >+ if ((this.tagBits & TagBits.HasMissingType) != 0) { >+ str += "[MISSING]"; //$NON-NLS-1$ >+ } >+ return str; > } > } >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.116 >diff -u -r1.116 ReferenceBinding.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java 29 Jan 2008 10:15:20 -0000 1.116 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java 20 Feb 2008 07:03:21 -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.323 >diff -u -r1.323 Scope.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java 31 Jan 2008 11:13:40 -0000 1.323 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java 20 Feb 2008 07:03:31 -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,22 +753,18 @@ > ? 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; > } > > // Internal use only >- public MethodBinding findExactMethod( >- ReferenceBinding receiverType, >- char[] selector, >- TypeBinding[] argumentTypes, >- InvocationSite invocationSite) { >- >+ public MethodBinding findExactMethod(ReferenceBinding receiverType, char[] selector, TypeBinding[] argumentTypes, InvocationSite invocationSite) { > CompilationUnitScope unitScope = compilationUnitScope(); > unitScope.recordTypeReferences(argumentTypes); > MethodBinding exactMethod = receiverType.getExactMethod(selector, argumentTypes, unitScope); > if (exactMethod != null && exactMethod.typeVariables == Binding.NO_TYPE_VARIABLES && !exactMethod.isBridge()) { >+ > // must find both methods for this case: <S extends A> void foo() {} and <N extends B> N foo() { return null; } > // or find an inherited method when the exact match is to a bridge method > unitScope.recordTypeReferences(exactMethod.thrownExceptions); >@@ -948,7 +943,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 +994,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 +1011,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 +1035,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 +1364,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 +1584,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; > } >@@ -1665,7 +1664,7 @@ > } > if (compatibleIndex == 0) { > if (problemMethod == null) >- return new ProblemMethodBinding(TypeConstants.INIT, argumentTypes, ProblemReasons.NotFound); >+ return new ProblemMethodBinding(methods[0], TypeConstants.INIT, argumentTypes, ProblemReasons.NotFound); > return problemMethod; > } > // need a more descriptive error... cannot convert from X to Y >@@ -2047,7 +2046,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) { >@@ -2101,34 +2102,38 @@ > * from the binding & not assume the problem applies to the entire compoundName. > */ > public final Binding getPackage(char[][] compoundName) { >- compilationUnitScope().recordQualifiedReference(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.isValidBinding()) >+ if (binding == null) { >+ char[][] qName = new char[][] { compoundName[0] }; >+ return new ProblemReferenceBinding(qName, environment().createMissingType(null, compoundName), ProblemReasons.NotFound); >+ } >+ if (!binding.isValidBinding()) { >+ if (binding instanceof PackageBinding) { /* missing package */ >+ char[][] qName = new char[][] { compoundName[0] }; >+ return new ProblemReferenceBinding(qName, null /* no closest match since search for pkg*/, ProblemReasons.NotFound); >+ } > return binding; >- >+ } > if (!(binding instanceof PackageBinding)) return null; // compoundName does not start with a package > >- int currentIndex = 1; >+ int currentIndex = 1, length = compoundName.length; > PackageBinding packageBinding = (PackageBinding) binding; >- while (currentIndex < compoundName.length) { >+ while (currentIndex < 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()); > } > } >@@ -2289,7 +2300,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; >@@ -2316,19 +2327,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() || inheritedHasPrecedence) { > 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 visible shadows enclosing) > if (foundType == null || (inheritedHasPrecedence && foundType.problemId() == ProblemReasons.NotVisible)) > 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)) >@@ -2339,14 +2350,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; >@@ -2363,26 +2374,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 > } > } > >@@ -2416,9 +2427,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 >@@ -2447,7 +2465,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; >@@ -2480,7 +2498,18 @@ > > // Answer error binding -- could not find name > if (foundType == null) { >- foundType = new ProblemReferenceBinding(name, null, ProblemReasons.NotFound); >+ char[][] qName = new char[][] { name }; >+ ReferenceBinding closestMatch = null; >+ if ((mask & Binding.PACKAGE) != 0 || unitScope.environment.getTopLevelPackage(name) == null) { >+ closestMatch = environment().createMissingType(unitScope.fPackage, qName); >+ } >+ foundType = new ProblemReferenceBinding(qName, closestMatch, 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); >+ } >+ } else if ((foundType.tagBits & TagBits.HasMissingType) != 0) { >+ char[][] qName = new char[][] { name }; >+ foundType = new ProblemReferenceBinding(qName, 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); > } >@@ -2515,7 +2544,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; >@@ -2541,7 +2570,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.19 >diff -u -r1.19 ProblemReferenceBinding.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/ProblemReferenceBinding.java 20 Dec 2007 16:02:45 -0000 1.19 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/ProblemReferenceBinding.java 20 Feb 2008 07:03:19 -0000 >@@ -15,7 +15,7 @@ > import org.eclipse.jdt.core.compiler.CharOperation; > > public class ProblemReferenceBinding extends ReferenceBinding { >- private ReferenceBinding closestMatch; >+ ReferenceBinding closestMatch; > private int problemReason; > > // NOTE: must only answer the subset of the name related to the problem >@@ -25,14 +25,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/FieldBinding.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/FieldBinding.java,v >retrieving revision 1.48 >diff -u -r1.48 FieldBinding.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/FieldBinding.java 24 Sep 2007 22:49:54 -0000 1.48 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/FieldBinding.java 20 Feb 2008 07:03:07 -0000 >@@ -27,10 +27,6 @@ > super(name, type, modifiers, constant); > this.declaringClass = declaringClass; > } >-public FieldBinding(FieldDeclaration field, TypeBinding type, int modifiers, ReferenceBinding declaringClass) { >- this(field.name, type, modifiers, declaringClass, null); >- field.binding = this; // record binding in declaration >-} > // special API used to change field declaring class for runtime visibility check > public FieldBinding(FieldBinding initialFieldBinding, ReferenceBinding declaringClass) { > super(initialFieldBinding.name, initialFieldBinding.type, initialFieldBinding.modifiers, initialFieldBinding.constant()); >@@ -41,12 +37,10 @@ > /* API > * Answer the receiver's binding type from Binding.BindingID. > */ >- >-public final int kind() { >- return FIELD; >+public FieldBinding(FieldDeclaration field, TypeBinding type, int modifiers, ReferenceBinding declaringClass) { >+ this(field.name, type, modifiers, declaringClass, null); >+ field.binding = this; // record binding in declaration > } >-/* Answer true if the receiver is visible to the invocationPackage. >-*/ > > public final boolean canBeSeenBy(PackageBinding invocationPackage) { > if (isPublic()) return true; >@@ -153,6 +147,7 @@ > } while ((currentType = currentType.superclass()) != null); > return false; > } >+ > /* > * declaringUniqueKey dot fieldName ) returnTypeUniqueKey > * p.X { X<T> x} --> Lp/X;.x)p/X<TT;>; >@@ -183,7 +178,6 @@ > System.arraycopy(returnTypeKey, 0, uniqueKey, index, returnTypeLength); > return uniqueKey; > } >- > public Constant constant() { > Constant fieldConstant = this.constant; > if (fieldConstant == null) { >@@ -215,6 +209,7 @@ > } > return fieldConstant; > } >+ > /** > * X<T> t --> LX<TT;>; > */ >@@ -222,11 +217,19 @@ > if ((this.modifiers & ExtraCompilerModifiers.AccGenericSignature) == 0) return null; > return this.type.genericTypeSignature(); > } >- > public final int getAccessFlags() { > return modifiers & ExtraCompilerModifiers.AccJustFlag; > } > >+public AnnotationBinding[] getAnnotations() { >+ FieldBinding originalField = this.original(); >+ ReferenceBinding declaringClassBinding = originalField.declaringClass; >+ if (declaringClassBinding == null) { >+ return Binding.NO_ANNOTATIONS; >+ } >+ return declaringClassBinding.retrieveAnnotations(originalField); >+} >+ > /** > * Compute the tagbits for standard annotations. For source types, these could require > * lazily resolving corresponding annotation nodes, in case of forward references. >@@ -259,24 +262,15 @@ > return originalField.tagBits; > } > >-public AnnotationBinding[] getAnnotations() { >- FieldBinding originalField = this.original(); >- ReferenceBinding declaringClassBinding = originalField.declaringClass; >- if (declaringClassBinding == null) { >- return Binding.NO_ANNOTATIONS; >- } >- return declaringClassBinding.retrieveAnnotations(originalField); >-} >- >-/* Answer true if the receiver has default visibility >-*/ >- > public final boolean isDefault() { > return !isPublic() && !isProtected() && !isPrivate(); > } > /* Answer true if the receiver is a deprecated field > */ > >+/* Answer true if the receiver has default visibility >+*/ >+ > public final boolean isDeprecated() { > return (modifiers & ClassFileConstants.AccDeprecated) != 0; > } >@@ -289,12 +283,6 @@ > /* Answer true if the receiver has private visibility and is used locally > */ > >-public final boolean isUsed() { >- return (modifiers & ExtraCompilerModifiers.AccLocallyUsed) != 0; >-} >-/* Answer true if the receiver has protected visibility >-*/ >- > public final boolean isProtected() { > return (modifiers & ClassFileConstants.AccProtected) != 0; > } >@@ -325,6 +313,12 @@ > /* Answer true if the receiver's declaring type is deprecated (or any of its enclosing types) > */ > >+public final boolean isUsed() { >+ return (modifiers & ExtraCompilerModifiers.AccLocallyUsed) != 0; >+} >+/* Answer true if the receiver has protected visibility >+*/ >+ > public final boolean isViewedAsDeprecated() { > return (modifiers & (ClassFileConstants.AccDeprecated | ExtraCompilerModifiers.AccDeprecatedImplicitly)) != 0; > } >@@ -334,6 +328,12 @@ > public final boolean isVolatile() { > return (modifiers & ClassFileConstants.AccVolatile) != 0; > } >+ >+public final int kind() { >+ return FIELD; >+} >+/* Answer true if the receiver is visible to the invocationPackage. >+*/ > /** > * Returns the original field (as opposed to parameterized instances) > */ >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 20 Feb 2008 07:03:40 -0000 >@@ -10,6 +10,8 @@ > *******************************************************************************/ > package org.eclipse.jdt.internal.compiler.lookup; > >+import java.util.List; >+ > import org.eclipse.jdt.core.compiler.CharOperation; > import org.eclipse.jdt.internal.compiler.ast.Wildcard; > import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; >@@ -81,6 +83,16 @@ > } > > /** >+ * @see org.eclipse.jdt.internal.compiler.lookup.TypeBinding#collectMissingTypes(java.util.List) >+ */ >+ public List collectMissingTypes(List missingTypes) { >+ if ((this.tagBits & TagBits.HasMissingType) != 0) { >+ missingTypes = this.bound.collectMissingTypes(missingTypes); >+ } >+ return missingTypes; >+ } >+ >+ /** > * 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> > * Constraints: >@@ -404,7 +416,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.109 >diff -u -r1.109 BlockScope.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java 7 Jan 2008 14:16:16 -0000 1.109 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java 20 Feb 2008 07:03:02 -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.100 >diff -u -r1.100 ParameterizedTypeBinding.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java 15 Jan 2008 14:24:10 -0000 1.100 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java 20 Feb 2008 07:03:19 -0000 >@@ -10,6 +10,8 @@ > *******************************************************************************/ > package org.eclipse.jdt.internal.compiler.lookup; > >+import java.util.List; >+ > import org.eclipse.jdt.core.compiler.CharOperation; > import org.eclipse.jdt.internal.compiler.ast.TypeReference; > import org.eclipse.jdt.internal.compiler.ast.Wildcard; >@@ -72,7 +74,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]); >+ } > } > } > } >@@ -118,6 +123,25 @@ > } > return capturedParameterizedType; > } >+ >+ /** >+ * @see org.eclipse.jdt.internal.compiler.lookup.TypeBinding#collectMissingTypes(java.util.List) >+ */ >+ public List collectMissingTypes(List missingTypes) { >+ if ((this.tagBits & TagBits.HasMissingType) != 0) { >+ if (this.enclosingType != null) { >+ missingTypes = this.enclosingType.collectMissingTypes(missingTypes); >+ } >+ missingTypes = this.genericType().collectMissingTypes(missingTypes); >+ if (this.arguments != null) { >+ for (int i = 0, max = this.arguments.length; i < max; i++) { >+ missingTypes = this.arguments[i].collectMissingTypes(missingTypes); >+ } >+ } >+ } >+ return missingTypes; >+ } >+ > /** > * 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> >@@ -611,7 +635,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; >@@ -631,10 +655,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); > } > >@@ -806,7 +830,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/ParameterizedMethodBinding.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding.java,v >retrieving revision 1.24 >diff -u -r1.24 ParameterizedMethodBinding.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding.java 7 Jan 2008 14:16:15 -0000 1.24 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding.java 20 Feb 2008 07:03:17 -0000 >@@ -109,6 +109,26 @@ > // error case where exception type variable would have been substituted by a non-reference type (207573) > if (this.thrownExceptions == null) this.thrownExceptions = Binding.NO_EXCEPTIONS; > } >+ checkMissingType: { >+ if ((this.tagBits & TagBits.HasMissingType) != 0) >+ break checkMissingType; >+ if ((this.returnType.tagBits & TagBits.HasMissingType) != 0) { >+ this.tagBits |= TagBits.HasMissingType; >+ break checkMissingType; >+ } >+ for (int i = 0, max = this.parameters.length; i < max; i++) { >+ if ((this.parameters[i].tagBits & TagBits.HasMissingType) != 0) { >+ this.tagBits |= TagBits.HasMissingType; >+ break checkMissingType; >+ } >+ } >+ for (int i = 0, max = this.thrownExceptions.length; i < max; i++) { >+ if ((this.thrownExceptions[i].tagBits & TagBits.HasMissingType) != 0) { >+ this.tagBits |= TagBits.HasMissingType; >+ break checkMissingType; >+ } >+ } >+ } > } > > /** >@@ -200,6 +220,26 @@ > // error case where exception type variable would have been substituted by a non-reference type (207573) > if (this.thrownExceptions == null) this.thrownExceptions = Binding.NO_EXCEPTIONS; > } >+ checkMissingType: { >+ if ((this.tagBits & TagBits.HasMissingType) != 0) >+ break checkMissingType; >+ if ((this.returnType.tagBits & TagBits.HasMissingType) != 0) { >+ this.tagBits |= TagBits.HasMissingType; >+ break checkMissingType; >+ } >+ for (int i = 0, max = this.parameters.length; i < max; i++) { >+ if ((this.parameters[i].tagBits & TagBits.HasMissingType) != 0) { >+ this.tagBits |= TagBits.HasMissingType; >+ break checkMissingType; >+ } >+ } >+ for (int i = 0, max = this.thrownExceptions.length; i < max; i++) { >+ if ((this.thrownExceptions[i].tagBits & TagBits.HasMissingType) != 0) { >+ this.tagBits |= TagBits.HasMissingType; >+ break checkMissingType; >+ } >+ } >+ } > } > > public ParameterizedMethodBinding() { >@@ -218,6 +258,7 @@ > method.originalMethod = originalMethod; > method.parameters = originalMethod.parameters; > method.thrownExceptions = originalMethod.thrownExceptions; >+ method.tagBits = originalMethod.tagBits; > ReferenceBinding genericClassType = scope.getJavaLangClass(); > LookupEnvironment environment = scope.environment(); > TypeBinding rawType = environment.convertToRawType(receiverType.erasure(), false /*do not force conversion of enclosing types*/); >@@ -225,6 +266,9 @@ > genericClassType, > new TypeBinding[] { environment.createWildcard(genericClassType, 0, rawType, null /*no extra bound*/, Wildcard.EXTENDS) }, > null); >+ if ((method.returnType.tagBits & TagBits.HasMissingType) != 0) { >+ method.tagBits |= TagBits.HasMissingType; >+ } > return method; > } > >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 20 Feb 2008 07:03:38 -0000 >@@ -45,11 +45,19 @@ > 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 - only if not resolving a previously missing type >+ if ((this.tagBits & TagBits.HasMissingType) == 0) { >+ 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 20 Feb 2008 07:03:00 -0000 >@@ -46,22 +46,22 @@ > > protected SimpleLookupTable storedAnnotations = null; // keys are this ReferenceBinding & its fields and methods, value is an AnnotationHolder > >-static Object convertMemberValue(Object binaryValue, LookupEnvironment env) { >+static Object convertMemberValue(Object binaryValue, LookupEnvironment env, char[][][] missingTypeNames) { > if (binaryValue == null) return null; > if (binaryValue instanceof Constant) > return binaryValue; > if (binaryValue instanceof ClassSignature) { >- TypeBinding typeFromSignature = env.getTypeFromSignature(((ClassSignature) binaryValue).getTypeName(), 0, -1, false, null); >+ TypeBinding typeFromSignature = env.getTypeFromSignature(((ClassSignature) binaryValue).getTypeName(), 0, -1, false, null, missingTypeNames); > if (typeFromSignature.isBaseType()) { > return typeFromSignature; > } > return resolveType((ReferenceBinding) typeFromSignature, env, false); > } > if (binaryValue instanceof IBinaryAnnotation) >- return createAnnotation((IBinaryAnnotation) binaryValue, env); >+ return createAnnotation((IBinaryAnnotation) binaryValue, env, missingTypeNames); > if (binaryValue instanceof EnumConstantSignature) { > EnumConstantSignature ref = (EnumConstantSignature) binaryValue; >- ReferenceBinding enumType = (ReferenceBinding) env.getTypeFromSignature(ref.getTypeName(), 0, -1, false, null); >+ ReferenceBinding enumType = (ReferenceBinding) env.getTypeFromSignature(ref.getTypeName(), 0, -1, false, null, missingTypeNames); > enumType = resolveType(enumType, env, false); > return enumType.getField(ref.getEnumConstantName(), false); > } >@@ -71,29 +71,29 @@ > if (length == 0) return objects; > Object[] values = new Object[length]; > for (int i = 0; i < length; i++) >- values[i] = convertMemberValue(objects[i], env); >+ values[i] = convertMemberValue(objects[i], env, missingTypeNames); > return values; > } > > // should never reach here. > throw new IllegalStateException(); > } >-static AnnotationBinding createAnnotation(IBinaryAnnotation annotationInfo, LookupEnvironment env) { >+static AnnotationBinding createAnnotation(IBinaryAnnotation annotationInfo, LookupEnvironment env, char[][][] missingTypeNames) { > IBinaryElementValuePair[] binaryPairs = annotationInfo.getElementValuePairs(); > int length = binaryPairs == null ? 0 : binaryPairs.length; > ElementValuePair[] pairs = length == 0 ? Binding.NO_ELEMENT_VALUE_PAIRS : new ElementValuePair[length]; > for (int i = 0; i < length; i++) >- pairs[i] = new ElementValuePair(binaryPairs[i].getName(), convertMemberValue(binaryPairs[i].getValue(), env), null); >+ pairs[i] = new ElementValuePair(binaryPairs[i].getName(), convertMemberValue(binaryPairs[i].getValue(), env, missingTypeNames), null); > > char[] typeName = annotationInfo.getTypeName(); >- ReferenceBinding annotationType = env.getTypeFromConstantPoolName(typeName, 1, typeName.length - 1, false); >+ ReferenceBinding annotationType = env.getTypeFromConstantPoolName(typeName, 1, typeName.length - 1, false, missingTypeNames); > return new UnresolvedAnnotationBinding(annotationType, pairs, env); > } >-public static AnnotationBinding[] createAnnotations(IBinaryAnnotation[] annotationInfos, LookupEnvironment env) { >+public static AnnotationBinding[] createAnnotations(IBinaryAnnotation[] annotationInfos, LookupEnvironment env, char[][][] missingTypeNames) { > int length = annotationInfos == null ? 0 : annotationInfos.length; > AnnotationBinding[] result = length == 0 ? Binding.NO_ANNOTATIONS : new AnnotationBinding[length]; > for (int i = 0; i < length; i++) >- result[i] = createAnnotation(annotationInfos[i], env); >+ result[i] = createAnnotation(annotationInfos[i], env, missingTypeNames); > return result; > } > public static ReferenceBinding resolveType(ReferenceBinding type, LookupEnvironment environment, boolean convertGenericToRawType) { >@@ -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()) { >@@ -184,7 +184,7 @@ > char[] enclosingTypeName = binaryType.getEnclosingTypeName(); > if (enclosingTypeName != null) { > // attempt to find the enclosing type if it exists in the cache (otherwise - resolve it when requested) >- this.enclosingType = environment.getTypeFromConstantPoolName(enclosingTypeName, 0, -1, true); // pretend parameterized to avoid raw >+ this.enclosingType = environment.getTypeFromConstantPoolName(enclosingTypeName, 0, -1, true, null /* could not be missing */); // pretend parameterized to avoid raw > this.tagBits |= TagBits.MemberTypeMask; // must be a member type not a top-level or local type > this.tagBits |= TagBits.HasUnresolvedEnclosingType; > if (this.enclosingType().isStrictfp()) >@@ -266,22 +266,24 @@ > this.memberTypes = new ReferenceBinding[size]; > for (int i = 0; i < size; i++) > // attempt to find each member type if it exists in the cache (otherwise - resolve it when requested) >- this.memberTypes[i] = environment.getTypeFromConstantPoolName(memberTypeStructures[i].getName(), 0, -1, false); >+ this.memberTypes[i] = environment.getTypeFromConstantPoolName(memberTypeStructures[i].getName(), 0, -1, false, null /* could not be missing */); > this.tagBits |= TagBits.HasUnresolvedMemberTypes; > } > } > >+ > long sourceLevel = environment.globalOptions.sourceLevel; > char[] typeSignature = null; > if (sourceLevel >= ClassFileConstants.JDK1_5) { > typeSignature = binaryType.getGenericSignature(); > this.tagBits |= binaryType.getTagBits(); > } >+ char[][][] missingTypeNames = binaryType.getMissingTypeNames(); > if (typeSignature == null) { > char[] superclassName = binaryType.getSuperclassName(); > if (superclassName != null) { > // attempt to find the superclass if it exists in the cache (otherwise - resolve it when requested) >- this.superclass = environment.getTypeFromConstantPoolName(superclassName, 0, -1, false); >+ this.superclass = environment.getTypeFromConstantPoolName(superclassName, 0, -1, false, missingTypeNames); > this.tagBits |= TagBits.HasUnresolvedSuperclass; > } > >@@ -293,7 +295,7 @@ > this.superInterfaces = new ReferenceBinding[size]; > for (int i = 0; i < size; i++) > // attempt to find each superinterface if it exists in the cache (otherwise - resolve it when requested) >- this.superInterfaces[i] = environment.getTypeFromConstantPoolName(interfaceNames[i], 0, -1, false); >+ this.superInterfaces[i] = environment.getTypeFromConstantPoolName(interfaceNames[i], 0, -1, false, missingTypeNames); > this.tagBits |= TagBits.HasUnresolvedSuperinterfaces; > } > } >@@ -303,14 +305,14 @@ > if (wrapper.signature[wrapper.start] == '<') { > // ParameterPart = '<' ParameterSignature(s) '>' > wrapper.start++; // skip '<' >- this.typeVariables = createTypeVariables(wrapper, true); >+ this.typeVariables = createTypeVariables(wrapper, true, missingTypeNames); > wrapper.start++; // skip '>' > this.tagBits |= TagBits.HasUnresolvedTypeVariables; > this.modifiers |= ExtraCompilerModifiers.AccGenericSignature; > } > > // attempt to find the superclass if it exists in the cache (otherwise - resolve it when requested) >- this.superclass = (ReferenceBinding) environment.getTypeFromTypeSignature(wrapper, Binding.NO_TYPE_VARIABLES, this); >+ this.superclass = (ReferenceBinding) environment.getTypeFromTypeSignature(wrapper, Binding.NO_TYPE_VARIABLES, this, missingTypeNames); > this.tagBits |= TagBits.HasUnresolvedSuperclass; > > this.superInterfaces = Binding.NO_SUPERINTERFACES; >@@ -318,7 +320,7 @@ > // attempt to find each superinterface if it exists in the cache (otherwise - resolve it when requested) > java.util.ArrayList types = new java.util.ArrayList(2); > do { >- types.add(environment.getTypeFromTypeSignature(wrapper, Binding.NO_TYPE_VARIABLES, this)); >+ types.add(environment.getTypeFromTypeSignature(wrapper, Binding.NO_TYPE_VARIABLES, this, missingTypeNames)); > } while (!wrapper.atEnd()); > this.superInterfaces = new ReferenceBinding[types.size()]; > types.toArray(this.superInterfaces); >@@ -327,16 +329,16 @@ > } > > if (needFieldsAndMethods) { >- createFields(binaryType.getFields(), sourceLevel); >- createMethods(binaryType.getMethods(), sourceLevel); >+ createFields(binaryType.getFields(), sourceLevel, missingTypeNames); >+ createMethods(binaryType.getMethods(), sourceLevel, missingTypeNames); > } else { // protect against incorrect use of the needFieldsAndMethods flag, see 48459 > this.fields = Binding.NO_FIELDS; > this.methods = Binding.NO_METHODS; > } > if (this.environment.globalOptions.storeAnnotations) >- setAnnotations(createAnnotations(binaryType.getAnnotations(), this.environment)); >+ setAnnotations(createAnnotations(binaryType.getAnnotations(), this.environment, missingTypeNames)); > } >-private void createFields(IBinaryField[] iFields, long sourceLevel) { >+private void createFields(IBinaryField[] iFields, long sourceLevel, char[][][] missingTypeNames) { > this.fields = Binding.NO_FIELDS; > if (iFields != null) { > int size = iFields.length; >@@ -350,8 +352,8 @@ > IBinaryField binaryField = iFields[i]; > char[] fieldSignature = use15specifics ? binaryField.getGenericSignature() : null; > TypeBinding type = fieldSignature == null >- ? environment.getTypeFromSignature(binaryField.getTypeName(), 0, -1, false, this) >- : environment.getTypeFromTypeSignature(new SignatureWrapper(fieldSignature), Binding.NO_TYPE_VARIABLES, this); >+ ? environment.getTypeFromSignature(binaryField.getTypeName(), 0, -1, false, this, missingTypeNames) >+ : environment.getTypeFromTypeSignature(new SignatureWrapper(fieldSignature), Binding.NO_TYPE_VARIABLES, this, missingTypeNames); > FieldBinding field = > new FieldBinding( > binaryField.getName(), >@@ -378,13 +380,14 @@ > // second pass for reifying annotations, since may refer to fields being constructed (147875) > if (firstAnnotatedFieldIndex >= 0) { > for (int i = firstAnnotatedFieldIndex; i <size; i++) { >- this.fields[i].setAnnotations(createAnnotations(iFields[i].getAnnotations(), this.environment)); >+ IBinaryField binaryField = iFields[i]; >+ this.fields[i].setAnnotations(createAnnotations(binaryField.getAnnotations(), this.environment, missingTypeNames)); > } > } > } > } > } >-private MethodBinding createMethod(IBinaryMethod method, long sourceLevel) { >+private MethodBinding createMethod(IBinaryMethod method, long sourceLevel, char[][][] missingTypeNames) { > int methodModifiers = method.getModifiers() | ExtraCompilerModifiers.AccUnresolved; > if (sourceLevel < ClassFileConstants.JDK1_5) > methodModifiers &= ~ClassFileConstants.AccVarargs; // vararg methods are not recognized until 1.5 >@@ -424,11 +427,11 @@ > while ((nextChar = methodDescriptor[++end]) != ';'){/*empty*/} > > if (i >= startIndex) { // skip the synthetic arg if necessary >- parameters[i - startIndex] = environment.getTypeFromSignature(methodDescriptor, index, end, false, this); >+ parameters[i - startIndex] = environment.getTypeFromSignature(methodDescriptor, index, end, false, this, missingTypeNames); > // 'paramAnnotations' line up with 'parameters' > // int parameter to method.getParameterAnnotations() include the synthetic arg > if (paramAnnotations != null) >- paramAnnotations[i - startIndex] = createAnnotations(method.getParameterAnnotations(i), this.environment); >+ paramAnnotations[i - startIndex] = createAnnotations(method.getParameterAnnotations(i), this.environment, missingTypeNames); > } > index = end + 1; > } >@@ -440,12 +443,12 @@ > if (size > 0) { > exceptions = new ReferenceBinding[size]; > for (int i = 0; i < size; i++) >- exceptions[i] = environment.getTypeFromConstantPoolName(exceptionTypes[i], 0, -1, false); >+ exceptions[i] = environment.getTypeFromConstantPoolName(exceptionTypes[i], 0, -1, false, missingTypeNames); > } > } > > if (!method.isConstructor()) >- returnType = environment.getTypeFromSignature(methodDescriptor, index + 1, -1, false, this); // index is currently pointing at the ')' >+ returnType = environment.getTypeFromSignature(methodDescriptor, index + 1, -1, false, this, missingTypeNames); // index is currently pointing at the ')' > } else { > methodModifiers |= ExtraCompilerModifiers.AccGenericSignature; > // MethodTypeSignature = ParameterPart(optional) '(' TypeSignatures ')' return_typeSignature ['^' TypeSignature (optional)] >@@ -454,7 +457,7 @@ > // <A::Ljava/lang/annotation/Annotation;>(Ljava/lang/Class<TA;>;)TA; > // ParameterPart = '<' ParameterSignature(s) '>' > wrapper.start++; // skip '<' >- typeVars = createTypeVariables(wrapper, false); >+ typeVars = createTypeVariables(wrapper, false, missingTypeNames); > wrapper.start++; // skip '>' > } > >@@ -465,7 +468,7 @@ > } else { > java.util.ArrayList types = new java.util.ArrayList(2); > while (wrapper.signature[wrapper.start] != ')') >- types.add(environment.getTypeFromTypeSignature(wrapper, typeVars, this)); >+ types.add(environment.getTypeFromTypeSignature(wrapper, typeVars, this, missingTypeNames)); > wrapper.start++; // skip ')' > int numParam = types.size(); > parameters = new TypeBinding[numParam]; >@@ -473,20 +476,20 @@ > if (this.environment.globalOptions.storeAnnotations) { > paramAnnotations = new AnnotationBinding[numParam][]; > for (int i = 0; i < numParam; i++) >- paramAnnotations[i] = createAnnotations(method.getParameterAnnotations(i), this.environment); >+ paramAnnotations[i] = createAnnotations(method.getParameterAnnotations(i), this.environment, missingTypeNames); > } > } > } > > // always retrieve return type (for constructors, its V for void - will be ignored) >- returnType = environment.getTypeFromTypeSignature(wrapper, typeVars, this); >+ returnType = environment.getTypeFromTypeSignature(wrapper, typeVars, this, missingTypeNames); > > if (!wrapper.atEnd() && wrapper.signature[wrapper.start] == '^') { > // attempt to find each exception if it exists in the cache (otherwise - resolve it when requested) > java.util.ArrayList types = new java.util.ArrayList(2); > do { > wrapper.start++; // skip '^' >- types.add(environment.getTypeFromTypeSignature(wrapper, typeVars, this)); >+ types.add(environment.getTypeFromTypeSignature(wrapper, typeVars, this, missingTypeNames)); > } while (!wrapper.atEnd() && wrapper.signature[wrapper.start] == '^'); > exceptions = new ReferenceBinding[types.size()]; > types.toArray(exceptions); >@@ -497,7 +500,7 @@ > if (size > 0) { > exceptions = new ReferenceBinding[size]; > for (int i = 0; i < size; i++) >- exceptions[i] = environment.getTypeFromConstantPoolName(exceptionTypes[i], 0, -1, false); >+ exceptions[i] = environment.getTypeFromConstantPoolName(exceptionTypes[i], 0, -1, false, missingTypeNames); > } > } > } >@@ -508,9 +511,9 @@ > : new MethodBinding(methodModifiers, method.getSelector(), returnType, parameters, exceptions, this); > if (this.environment.globalOptions.storeAnnotations) > result.setAnnotations( >- createAnnotations(method.getAnnotations(), this.environment), >+ createAnnotations(method.getAnnotations(), this.environment, missingTypeNames), > paramAnnotations, >- isAnnotationType() ? convertMemberValue(method.getDefaultValue(), this.environment) : null); >+ isAnnotationType() ? convertMemberValue(method.getDefaultValue(), this.environment, missingTypeNames) : null); > > if (use15specifics) > result.tagBits |= method.getTagBits(); >@@ -523,7 +526,7 @@ > /** > * Create method bindings for binary type, filtering out <clinit> and synthetics > */ >-private void createMethods(IBinaryMethod[] iMethods, long sourceLevel) { >+private void createMethods(IBinaryMethod[] iMethods, long sourceLevel, char[][][] missingTypeNames) { > int total = 0, initialTotal = 0, iClinit = -1; > int[] toSkip = null; > if (iMethods != null) { >@@ -559,7 +562,7 @@ > this.methods = new MethodBinding[total]; > if (total == initialTotal) { > for (int i = 0; i < initialTotal; i++) { >- MethodBinding method = createMethod(iMethods[i], sourceLevel); >+ MethodBinding method = createMethod(iMethods[i], sourceLevel, missingTypeNames); > if (isViewedAsDeprecated && !method.isDeprecated()) > method.modifiers |= ExtraCompilerModifiers.AccDeprecatedImplicitly; > if (hasRestrictedAccess) >@@ -569,7 +572,7 @@ > } else { > for (int i = 0, index = 0; i < initialTotal; i++) { > if (iClinit != i && (toSkip == null || toSkip[i] != -1)) { >- MethodBinding method = createMethod(iMethods[i], sourceLevel); >+ MethodBinding method = createMethod(iMethods[i], sourceLevel, missingTypeNames); > if (isViewedAsDeprecated && !method.isDeprecated()) > method.modifiers |= ExtraCompilerModifiers.AccDeprecatedImplicitly; > if (hasRestrictedAccess) >@@ -579,7 +582,7 @@ > } > } > } >-private TypeVariableBinding[] createTypeVariables(SignatureWrapper wrapper, boolean assignVariables) { >+private TypeVariableBinding[] createTypeVariables(SignatureWrapper wrapper, boolean assignVariables, char[][][] missingTypeNames) { > // detect all type variables first > char[] typeSignature = wrapper.signature; > int depth = 0, length = typeSignature.length; >@@ -619,7 +622,7 @@ > if (assignVariables) > this.typeVariables = result; > for (int i = 0; i < rank; i++) { >- initializeTypeVariable(result[i], result, wrapper); >+ initializeTypeVariable(result[i], result, wrapper, missingTypeNames); > } > return result; > } >@@ -807,7 +810,7 @@ > variable.resolve(this.environment); > return variable; > } >-private void initializeTypeVariable(TypeVariableBinding variable, TypeVariableBinding[] existingVariables, SignatureWrapper wrapper) { >+private void initializeTypeVariable(TypeVariableBinding variable, TypeVariableBinding[] existingVariables, SignatureWrapper wrapper, char[][][] missingTypeNames) { > // ParameterSignature = Identifier ':' TypeSignature > // or Identifier ':' TypeSignature(optional) InterfaceBound(s) > // InterfaceBound = ':' TypeSignature >@@ -817,7 +820,7 @@ > if (wrapper.signature[wrapper.start] == ':') { > type = environment.getResolvedType(TypeConstants.JAVA_LANG_OBJECT, null); > } else { >- type = (ReferenceBinding) environment.getTypeFromTypeSignature(wrapper, existingVariables, this); >+ type = (ReferenceBinding) environment.getTypeFromTypeSignature(wrapper, existingVariables, this, missingTypeNames); > firstBound = type; > } > >@@ -830,7 +833,7 @@ > java.util.ArrayList types = new java.util.ArrayList(2); > do { > wrapper.start++; // skip ':' >- types.add(environment.getTypeFromTypeSignature(wrapper, existingVariables, this)); >+ types.add(environment.getTypeFromTypeSignature(wrapper, existingVariables, this, missingTypeNames)); > } while (wrapper.signature[wrapper.start] == ':'); > bounds = new ReferenceBinding[types.size()]; > types.toArray(bounds); >@@ -897,7 +900,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 +912,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 20 Feb 2008 07:03:34 -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.153 >diff -u -r1.153 SourceTypeBinding.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java 7 Jan 2008 14:16:18 -0000 1.153 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java 20 Feb 2008 07:03:34 -0000 >@@ -40,13 +40,13 @@ > public ClassScope scope; > > // Synthetics are separated into 5 categories: methods, super methods, fields, class literals, changed declaring type bindings and bridge methods >- // if a new category is added, also increment EMUL_MAX_VALUE >+ // if a new category is added, also increment MAX_SYNTHETICS > private final static int METHOD_EMUL = 0; > private final static int FIELD_EMUL = 1; > private final static int CLASS_LITERAL_EMUL = 2; > private final static int RECEIVER_TYPE_EMUL = 3; > >- private final static int EMUL_MAX_VALUE = 4; >+ private final static int MAX_SYNTHETICS = 4; > > HashMap[] synthetics; > char[] genericReferenceTypeSignature; >@@ -144,7 +144,7 @@ > */ > public FieldBinding addSyntheticFieldForInnerclass(LocalVariableBinding actualOuterLocalVariable) { > if (this.synthetics == null) >- this.synthetics = new HashMap[EMUL_MAX_VALUE]; >+ this.synthetics = new HashMap[MAX_SYNTHETICS]; > if (this.synthetics[SourceTypeBinding.FIELD_EMUL] == null) > this.synthetics[SourceTypeBinding.FIELD_EMUL] = new HashMap(5); > >@@ -188,7 +188,7 @@ > */ > public FieldBinding addSyntheticFieldForInnerclass(ReferenceBinding enclosingType) { > if (this.synthetics == null) >- this.synthetics = new HashMap[EMUL_MAX_VALUE]; >+ this.synthetics = new HashMap[MAX_SYNTHETICS]; > if (this.synthetics[SourceTypeBinding.FIELD_EMUL] == null) > this.synthetics[SourceTypeBinding.FIELD_EMUL] = new HashMap(5); > >@@ -235,7 +235,7 @@ > */ > public FieldBinding addSyntheticFieldForClassLiteral(TypeBinding targetType, BlockScope blockScope) { > if (this.synthetics == null) >- this.synthetics = new HashMap[EMUL_MAX_VALUE]; >+ this.synthetics = new HashMap[MAX_SYNTHETICS]; > if (this.synthetics[SourceTypeBinding.CLASS_LITERAL_EMUL] == null) > this.synthetics[SourceTypeBinding.CLASS_LITERAL_EMUL] = new HashMap(5); > >@@ -272,7 +272,7 @@ > */ > public FieldBinding addSyntheticFieldForAssert(BlockScope blockScope) { > if (this.synthetics == null) >- this.synthetics = new HashMap[EMUL_MAX_VALUE]; >+ this.synthetics = new HashMap[MAX_SYNTHETICS]; > if (this.synthetics[SourceTypeBinding.FIELD_EMUL] == null) > this.synthetics[SourceTypeBinding.FIELD_EMUL] = new HashMap(5); > >@@ -315,7 +315,7 @@ > */ > public FieldBinding addSyntheticFieldForEnumValues() { > if (this.synthetics == null) >- this.synthetics = new HashMap[EMUL_MAX_VALUE]; >+ this.synthetics = new HashMap[MAX_SYNTHETICS]; > if (this.synthetics[SourceTypeBinding.FIELD_EMUL] == null) > this.synthetics[SourceTypeBinding.FIELD_EMUL] = new HashMap(5); > >@@ -358,7 +358,7 @@ > */ > public SyntheticMethodBinding addSyntheticMethod(FieldBinding targetField, boolean isReadAccess) { > if (this.synthetics == null) >- this.synthetics = new HashMap[EMUL_MAX_VALUE]; >+ this.synthetics = new HashMap[MAX_SYNTHETICS]; > if (this.synthetics[SourceTypeBinding.METHOD_EMUL] == null) > this.synthetics[SourceTypeBinding.METHOD_EMUL] = new HashMap(5); > >@@ -381,7 +381,7 @@ > */ > public SyntheticMethodBinding addSyntheticEnumMethod(char[] selector) { > if (this.synthetics == null) >- this.synthetics = new HashMap[EMUL_MAX_VALUE]; >+ this.synthetics = new HashMap[MAX_SYNTHETICS]; > if (this.synthetics[SourceTypeBinding.METHOD_EMUL] == null) > this.synthetics[SourceTypeBinding.METHOD_EMUL] = new HashMap(5); > >@@ -404,7 +404,7 @@ > */ > public SyntheticFieldBinding addSyntheticFieldForSwitchEnum(char[] fieldName, String key) { > if (this.synthetics == null) >- this.synthetics = new HashMap[EMUL_MAX_VALUE]; >+ this.synthetics = new HashMap[MAX_SYNTHETICS]; > if (this.synthetics[SourceTypeBinding.FIELD_EMUL] == null) > this.synthetics[SourceTypeBinding.FIELD_EMUL] = new HashMap(5); > >@@ -446,7 +446,7 @@ > */ > public SyntheticMethodBinding addSyntheticMethodForSwitchEnum(TypeBinding enumBinding) { > if (this.synthetics == null) >- this.synthetics = new HashMap[EMUL_MAX_VALUE]; >+ this.synthetics = new HashMap[MAX_SYNTHETICS]; > if (this.synthetics[SourceTypeBinding.METHOD_EMUL] == null) > this.synthetics[SourceTypeBinding.METHOD_EMUL] = new HashMap(5); > >@@ -477,7 +477,7 @@ > */ > public SyntheticMethodBinding addSyntheticMethod(MethodBinding targetMethod, boolean isSuperAccess) { > if (this.synthetics == null) >- this.synthetics = new HashMap[EMUL_MAX_VALUE]; >+ this.synthetics = new HashMap[MAX_SYNTHETICS]; > if (this.synthetics[SourceTypeBinding.METHOD_EMUL] == null) > this.synthetics[SourceTypeBinding.METHOD_EMUL] = new HashMap(5); > >@@ -506,7 +506,7 @@ > return null; // do not need bridge method > } > if (this.synthetics == null) >- this.synthetics = new HashMap[EMUL_MAX_VALUE]; >+ this.synthetics = new HashMap[MAX_SYNTHETICS]; > if (this.synthetics[SourceTypeBinding.METHOD_EMUL] == null) { > this.synthetics[SourceTypeBinding.METHOD_EMUL] = new HashMap(5); > } else { >@@ -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 >@@ -1047,7 +1049,7 @@ > } > public FieldBinding getUpdatedFieldBinding(FieldBinding targetField, ReferenceBinding newDeclaringClass) { > if (this.synthetics == null) >- this.synthetics = new HashMap[EMUL_MAX_VALUE]; >+ this.synthetics = new HashMap[MAX_SYNTHETICS]; > if (this.synthetics[SourceTypeBinding.RECEIVER_TYPE_EMUL] == null) > this.synthetics[SourceTypeBinding.RECEIVER_TYPE_EMUL] = new HashMap(5); > >@@ -1065,7 +1067,7 @@ > } > public MethodBinding getUpdatedMethodBinding(MethodBinding targetMethod, ReferenceBinding newDeclaringClass) { > if (this.synthetics == null) >- this.synthetics = new HashMap[EMUL_MAX_VALUE]; >+ this.synthetics = new HashMap[MAX_SYNTHETICS]; > if (this.synthetics[SourceTypeBinding.RECEIVER_TYPE_EMUL] == null) > this.synthetics[SourceTypeBinding.RECEIVER_TYPE_EMUL] = new HashMap(5); > >@@ -1292,6 +1294,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 +1346,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) >@@ -1370,6 +1379,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; >@@ -1400,6 +1412,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.91 >diff -u -r1.91 LookupEnvironment.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java 1 Feb 2008 16:17:58 -0000 1.91 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java 20 Feb 2008 07:03:11 -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()) >+ typeRequestor.accept(answer.getBinaryType(), computePackageFrom(compoundName, false /* valid pkg */), answer.getAccessRestriction()); >+ } 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()); >- >+ typeRequestor.accept(answer.getSourceTypes(), computePackageFrom(compoundName, false /* valid pkg */), answer.getAccessRestriction()); >+ } > return getCachedType(compoundName); > } > /* Ask the oracle for a type named name in the packageBinding. >@@ -125,88 +123,55 @@ > 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); > > if (existingType == null || existingType instanceof UnresolvedReferenceBinding) > // only add the binary type if its not already in the cache >- return createBinaryTypeFrom(binaryType, computePackageFrom(compoundName), needFieldsAndMethods, accessRestriction); >+ return createBinaryTypeFrom(binaryType, computePackageFrom(compoundName, false /* valid pkg */), 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,14 +346,16 @@ > } > } > return type; >-} >-private PackageBinding computePackageFrom(char[][] constantPoolName) { >+} >+ >+private PackageBinding computePackageFrom(char[][] constantPoolName, boolean isMissing) { > if (constantPoolName.length == 1) > return defaultPackage; > > PackageBinding packageBinding = getPackage0(constantPoolName[0]); > if (packageBinding == null || packageBinding == TheNotFoundPackage) { > packageBinding = new PackageBinding(constantPoolName[0], this); >+ if (isMissing) packageBinding.tagBits |= TagBits.HasMissingType; > knownPackages.put(constantPoolName[0], packageBinding); > } > >@@ -388,34 +363,14 @@ > PackageBinding parent = packageBinding; > if ((packageBinding = parent.getPackage0(constantPoolName[i])) == null || packageBinding == TheNotFoundPackage) { > packageBinding = new PackageBinding(CharOperation.subarray(constantPoolName, 0, i + 1), parent, this); >+ if (isMissing) { >+ packageBinding.tagBits |= TagBits.HasMissingType; >+ } > parent.addPackage(packageBinding); > } > } > 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, false /*do not force conversion of enclosing types*/) >- : 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) { >@@ -535,6 +490,29 @@ > } > > /** >+ * 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, false /*do not force conversion of enclosing types*/) >+ : convertToParameterizedType(originalEnclosingType); >+ needToConvert |= originalEnclosingType != convertedEnclosingType; >+ } >+ if (needToConvert) { >+ return createParameterizedType(originalType, isGeneric ? originalType.typeVariables() : null, convertedEnclosingType); >+ } >+ } >+ return originalType; >+} >+ >+/** > * Returns the given binding's raw type binding. > * @param type the TypeBinding to raw convert > * @param forceRawEnclosingType forces recursive raw conversion of enclosing types (used in Javadoc references only) >@@ -606,6 +584,7 @@ > return type; > } > >+ > // variation for unresolved types in binaries (consider generic type as raw) > public TypeBinding convertUnresolvedBinaryToRawType(TypeBinding type) { > int dimension; >@@ -664,6 +643,7 @@ > } > return type; > } >+ > /* > * Used to guarantee annotation identity. > */ >@@ -673,7 +653,6 @@ > } > return new AnnotationBinding(annotationType, pairs); > } >- > /* > * Used to guarantee array type identity. > */ >@@ -715,6 +694,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); > } >@@ -734,15 +714,41 @@ > return null; > } > } >- > packageBinding.addType(binaryBinding); > setAccessRestriction(binaryBinding, accessRestriction); > binaryBinding.cachePartsFrom(binaryType, needFieldsAndMethods); > return binaryBinding; > } >-/* Used to create packages from the package statement. >+ >+/* >+ * Used to create types denoting missing types. >+ * If package is given, then reuse the package; if not then infer a package from compound name. >+ * If the package is existing, then install the missing type in type cache > */ >+public MissingTypeBinding createMissingType(PackageBinding packageBinding, char[][] compoundName) { >+ // create a proxy for the missing BinaryType >+ if (packageBinding == null) { >+ packageBinding = computePackageFrom(compoundName, true /* missing */); >+ if (packageBinding == TheNotFoundPackage) packageBinding = this.defaultPackage; >+ } >+ MissingTypeBinding missingType = new MissingTypeBinding(packageBinding, compoundName, this); >+ 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) { >@@ -778,7 +784,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; >@@ -811,7 +816,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; >@@ -851,7 +855,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; >@@ -926,7 +929,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; >@@ -986,14 +988,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; >@@ -1003,6 +1003,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. >@@ -1010,10 +1011,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. >@@ -1023,15 +1024,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) { >@@ -1048,11 +1052,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; > >@@ -1095,61 +1099,75 @@ > return new ProblemReferenceBinding(compoundName, referenceBinding, InternalNameProvided); > return referenceBinding; > } >-private TypeBinding[] getTypeArgumentsFromSignature(SignatureWrapper wrapper, TypeVariableBinding[] staticVariables, ReferenceBinding enclosingType, ReferenceBinding genericType) { >+ >+private TypeBinding[] getTypeArgumentsFromSignature(SignatureWrapper wrapper, TypeVariableBinding[] staticVariables, ReferenceBinding enclosingType, ReferenceBinding genericType, char[][][] missingTypeNames) { > java.util.ArrayList args = new java.util.ArrayList(2); > int rank = 0; > do { >- args.add(getTypeFromVariantTypeSignature(wrapper, staticVariables, enclosingType, genericType, rank++)); >+ args.add(getTypeFromVariantTypeSignature(wrapper, staticVariables, enclosingType, genericType, rank++, missingTypeNames)); > } while (wrapper.signature[wrapper.start] != '>'); > wrapper.start++; // skip '>' > TypeBinding[] typeArguments = new TypeBinding[args.size()]; > 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) { >+private ReferenceBinding getTypeFromCompoundName(char[][] compoundName, boolean isParameterized, boolean wasMissingType) { > ReferenceBinding binding = getCachedType(compoundName); > if (binding == null) { >- PackageBinding packageBinding = computePackageFrom(compoundName); >+ PackageBinding packageBinding = computePackageFrom(compoundName, false /* valid pkg */); > binding = new UnresolvedReferenceBinding(compoundName, packageBinding); >+ if (wasMissingType) { >+ binding.tagBits |= TagBits.HasMissingType; // record it was bound to a missing type >+ } > 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) { >+ReferenceBinding getTypeFromConstantPoolName(char[] signature, int start, int end, boolean isParameterized, char[][][] missingTypeNames) { > if (end == -1) > end = signature.length; >- > char[][] compoundName = CharOperation.splitOn('/', signature, start, end); >- return getTypeFromCompoundName(compoundName, isParameterized); >+ boolean wasMissingType = false; >+ if (missingTypeNames != null) { >+ for (int i = 0, max = missingTypeNames.length; i < max; i++) { >+ if (CharOperation.equals(compoundName, missingTypeNames[i])) { >+ wasMissingType = true; >+ break; >+ } >+ } >+ } >+ return getTypeFromCompoundName(compoundName, isParameterized, wasMissingType); > } >+ > /* 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) { >+TypeBinding getTypeFromSignature(char[] signature, int start, int end, boolean isParameterized, TypeBinding enclosingType, char[][][] missingTypeNames) { > int dimension = 0; > while (signature[start] == '[') { > start++; >@@ -1194,14 +1212,15 @@ > // will never reach here, since error will cause abort > } > } else { >- binding = getTypeFromConstantPoolName(signature, start + 1, end, isParameterized); // skip leading 'L' or 'T' >+ binding = getTypeFromConstantPoolName(signature, start + 1, end, isParameterized, missingTypeNames); // skip leading 'L' or 'T' > } > > if (dimension == 0) > return binding; > return createArrayType(binding, dimension); > } >-TypeBinding getTypeFromTypeSignature(SignatureWrapper wrapper, TypeVariableBinding[] staticVariables, ReferenceBinding enclosingType) { >+ >+TypeBinding getTypeFromTypeSignature(SignatureWrapper wrapper, TypeVariableBinding[] staticVariables, ReferenceBinding enclosingType, char[][][] missingTypeNames) { > // TypeVariableSignature = 'T' Identifier ';' > // ArrayTypeSignature = '[' TypeSignature > // ClassTypeSignature = 'L' Identifier TypeArgs(optional) ';' >@@ -1212,7 +1231,6 @@ > wrapper.start++; > dimension++; > } >- > if (wrapper.signature[wrapper.start] == 'T') { > int varStart = wrapper.start + 1; > int varEnd = wrapper.computeEnd(); >@@ -1232,7 +1250,7 @@ > return null; // cannot reach this, since previous problem will abort compilation > } > boolean isParameterized; >- TypeBinding type = getTypeFromSignature(wrapper.signature, wrapper.start, wrapper.computeEnd(), isParameterized = (wrapper.end == wrapper.bracket), enclosingType); >+ TypeBinding type = getTypeFromSignature(wrapper.signature, wrapper.start, wrapper.computeEnd(), isParameterized = (wrapper.end == wrapper.bracket), enclosingType, missingTypeNames); > if (!isParameterized) > return dimension == 0 ? type : createArrayType(type, dimension); > >@@ -1248,7 +1266,7 @@ > // The actualType needs to be a ParameterizedTypeBinding when its a member type, whose enclosing type is a generic > genericType = createParameterizedType(actualType, null, actualEnclosing); > } >- TypeBinding[] typeArguments = getTypeArgumentsFromSignature(wrapper, staticVariables, enclosingType, genericType); >+ TypeBinding[] typeArguments = getTypeArgumentsFromSignature(wrapper, staticVariables, enclosingType, genericType, missingTypeNames); > ParameterizedTypeBinding parameterizedType = createParameterizedType(actualType, typeArguments, actualEnclosing); > > while (wrapper.signature[wrapper.start] == '.') { >@@ -1258,7 +1276,7 @@ > ReferenceBinding memberType = parameterizedType.genericType().getMemberType(memberName); > if (wrapper.signature[wrapper.start] == '<') { > wrapper.start++; // skip '<' >- typeArguments = getTypeArgumentsFromSignature(wrapper, staticVariables, enclosingType, memberType); >+ typeArguments = getTypeArgumentsFromSignature(wrapper, staticVariables, enclosingType, memberType, missingTypeNames); > } else { > typeArguments = null; > } >@@ -1267,12 +1285,14 @@ > 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, >+ char[][][] missingTypeNames) { > // VariantTypeSignature = '-' TypeSignature > // or '+' TypeSignature > // or TypeSignature >@@ -1281,19 +1301,19 @@ > case '-' : > // ? super aType > wrapper.start++; >- TypeBinding bound = getTypeFromTypeSignature(wrapper, staticVariables, enclosingType); >+ TypeBinding bound = getTypeFromTypeSignature(wrapper, staticVariables, enclosingType, missingTypeNames); > return createWildcard(genericType, rank, bound, null /*no extra bound*/, Wildcard.SUPER); > case '+' : > // ? extends aType > wrapper.start++; >- bound = getTypeFromTypeSignature(wrapper, staticVariables, enclosingType); >+ bound = getTypeFromTypeSignature(wrapper, staticVariables, enclosingType, missingTypeNames); > return createWildcard(genericType, rank, bound, null /*no extra bound*/, Wildcard.EXTENDS); > case '*' : > // ? > wrapper.start++; > return createWildcard(genericType, rank, null, null /*no extra bound*/, Wildcard.UNBOUND); > default : >- return getTypeFromTypeSignature(wrapper, staticVariables, enclosingType); >+ return getTypeFromTypeSignature(wrapper, staticVariables, enclosingType, missingTypeNames); > } > } > >@@ -1304,8 +1324,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 >@@ -1313,6 +1333,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; >@@ -1342,6 +1363,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) >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 20 Feb 2008 07:02:58 -0000 >@@ -10,6 +10,8 @@ > *******************************************************************************/ > package org.eclipse.jdt.internal.compiler.lookup; > >+import java.util.List; >+ > import org.eclipse.jdt.core.compiler.CharOperation; > import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; > import org.eclipse.jdt.internal.compiler.impl.Constant; >@@ -33,7 +35,28 @@ > 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; >+ } >+ TypeBinding leafClosestMatch = this.leafComponentType.closestMatch(); >+ if (leafClosestMatch == null) { >+ return null; >+ } >+ return this.environment.createArrayType(this.leafComponentType.closestMatch(), this.dimensions); >+} >+ >+/** >+ * @see org.eclipse.jdt.internal.compiler.lookup.TypeBinding#collectMissingTypes(java.util.List) >+ */ >+public List collectMissingTypes(List missingTypes) { >+ if ((this.tagBits & TagBits.HasMissingType) != 0) { >+ missingTypes = this.leafComponentType.collectMissingTypes(missingTypes); >+ } >+ return missingTypes; > } > > /** >@@ -241,7 +264,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.93 >diff -u -r1.93 TypeBinding.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java 31 Jan 2008 17:02:33 -0000 1.93 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java 20 Feb 2008 07:03:38 -0000 >@@ -10,6 +10,8 @@ > *******************************************************************************/ > package org.eclipse.jdt.internal.compiler.lookup; > >+import java.util.List; >+ > import org.eclipse.jdt.core.compiler.CharOperation; > import org.eclipse.jdt.internal.compiler.ast.Wildcard; > >@@ -104,6 +106,23 @@ > } > > /** >+ * 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 >+} >+ >+/** >+ * Iterate through the type components to collect instances of leaf missing types >+ * @param missingTypes >+ * @return missing types >+ */ >+public List collectMissingTypes(List missingTypes) { >+ return missingTypes; >+} >+ >+/** > * 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 20 Feb 2008 07:02:35 -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.38 >diff -u -r1.38 TypeReference.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/TypeReference.java 7 Jan 2008 14:16:20 -0000 1.38 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/TypeReference.java 20 Feb 2008 07:02:54 -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,81 +106,99 @@ > * @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 : >+ case ProblemReasons.InheritedNameHidesEnclosingName : >+ TypeBinding type = this.resolvedType.closestMatch(); >+ if (type == null) return null; >+ return scope.environment().convertToRawType(type, false /*do not force conversion of enclosing types*/); >+ 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 : >+ case ProblemReasons.InheritedNameHidesEnclosingName : >+ 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, false /*do not force conversion of enclosing types*/); >+ } >+ type = scope.environment().convertToRawType(type, false /*do not force conversion of enclosing types*/); > 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); >+ return superType; >+} >+ >+public final TypeBinding resolveType(BlockScope blockScope) { >+ return resolveType(blockScope, true /* checkbounds if any */); >+} > >- type = scope.environment().convertToRawType(type, false /*do not force conversion of enclosing types*/); >- 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; >+public TypeBinding resolveType(BlockScope scope, boolean checkBounds) { >+ return internalResolveType(scope); >+} >+ >+public TypeBinding resolveType(ClassScope scope) { >+ return internalResolveType(scope); > } > > public TypeBinding resolveTypeArgument(BlockScope blockScope, ReferenceBinding genericType, int rank) { >@@ -190,13 +208,8 @@ > public TypeBinding resolveTypeArgument(ClassScope classScope, ReferenceBinding genericType, int rank) { > return resolveType(classScope); > } >- >-protected void reportInvalidType(Scope scope) { >- scope.problemReporter().invalidType(this, this.resolvedType); >-} >-protected void reportDeprecatedType(TypeBinding type, Scope scope) { >- scope.problemReporter().deprecatedType(type, this); >-} >+ > public abstract void traverse(ASTVisitor visitor, BlockScope scope); >+ > public abstract void traverse(ASTVisitor visitor, ClassScope scope); > } >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.100 >diff -u -r1.100 SingleNameReference.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java 7 Jan 2008 14:16:21 -0000 1.100 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java 20 Feb 2008 07:02:47 -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); >@@ -853,10 +853,14 @@ > } > // perform capture conversion if read access > TypeBinding fieldType = checkFieldAccess(scope); >- return this.resolvedType = >- (((this.bits & IsStrictlyAssigned) == 0) >+ this.resolvedType = fieldType = (((this.bits & IsStrictlyAssigned) == 0) > ? fieldType.capture(scope, this.sourceEnd) > : fieldType); >+ if ((fieldType.tagBits & TagBits.HasMissingType) != 0) { >+ scope.problemReporter().invalidType(this, fieldType); >+ return null; >+ } >+ return this.resolvedType; > } > > // thus it was a type >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 20 Feb 2008 07:01:54 -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/JavadocImplicitTypeReference.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocImplicitTypeReference.java,v >retrieving revision 1.12 >diff -u -r1.12 JavadocImplicitTypeReference.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/JavadocImplicitTypeReference.java 7 Jan 2008 14:16:22 -0000 1.12 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/JavadocImplicitTypeReference.java 20 Feb 2008 07:02:04 -0000 >@@ -61,28 +61,57 @@ > * 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.enclosingReceiverType(); >- 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); >- >+ if (isTypeUseDeprecated(type, scope)) { >+ reportDeprecatedType(type, scope); >+ } > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=209936 > // raw convert all enclosing types when dealing with Javadoc references >- if (this.resolvedType.isGenericType() || this.resolvedType.isParameterizedType()) { >- return this.resolvedType = scope.environment().convertToRawType(this.resolvedType, true /*force the conversion of enclosing types*/); >+ if (type.isGenericType() || type.isParameterizedType()) { >+ type = scope.environment().convertToRawType(type, true /*force the conversion of enclosing types*/); > } >- return this.resolvedType; >+ >+ if (hasError) { >+ // do not store the computed type, keep the problem type instead >+ return type; >+ } >+ return this.resolvedType = type; > } > > protected void reportInvalidType(Scope scope) { >@@ -92,14 +121,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.92 >diff -u -r1.92 ASTNode.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java 29 Jan 2008 09:38:31 -0000 1.92 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java 20 Feb 2008 07:01:50 -0000 >@@ -431,14 +431,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 20 Feb 2008 07:01:50 -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,11 +339,18 @@ > } > 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; > } >+ if ((this.binding.tagBits & TagBits.HasMissingType) != 0) { >+ scope.problemReporter().missingTypeInConstructor(this, this.binding); >+ } > if (isMethodUseDeprecated(binding, scope, true)) > scope.problemReporter().deprecatedMethod(binding, this); > checkInvocationArguments(scope, null, allocationType, this.binding, this.arguments, argumentTypes, argsContainCast, this); >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.23 >diff -u -r1.23 JavadocSingleTypeReference.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/JavadocSingleTypeReference.java 7 Jan 2008 14:16:22 -0000 1.23 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/JavadocSingleTypeReference.java 20 Feb 2008 07:02:09 -0000 >@@ -17,11 +17,10 @@ > import org.eclipse.jdt.internal.compiler.lookup.ClassScope; > import org.eclipse.jdt.internal.compiler.lookup.PackageBinding; > 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 int tagSourceStart, tagSourceEnd; >@@ -34,36 +33,27 @@ > 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 > */ >- 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 >- >+ 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 : >+ case ProblemReasons.InheritedNameHidesEnclosingName : >+ TypeBinding type = this.resolvedType.closestMatch(); >+ return type; >+ default : >+ return null; >+ } >+ } >+ } > this.resolvedType = getTypeBinding(scope); > // End resolution when getTypeBinding(scope) returns null. This may happen in > // certain circumstances, typically when an illegal access is done on a type >@@ -77,7 +67,7 @@ > this.packageBinding = (PackageBinding) binding; > } else { > if (this.resolvedType.problemId() == ProblemReasons.NonStaticReferenceInStaticContext) { >- ReferenceBinding closestMatch = ((ProblemReferenceBinding)this.resolvedType).closestMatch(); >+ 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; >@@ -89,24 +79,32 @@ > } > if (isTypeUseDeprecated(this.resolvedType, scope)) > reportDeprecatedType(this.resolvedType, scope); >- > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=209936 > // raw convert all enclosing types when dealing with Javadoc references > if (this.resolvedType.isGenericType() || this.resolvedType.isParameterizedType()) { >- return this.resolvedType = scope.environment().convertToRawType(this.resolvedType, true /*force the conversion of enclosing types*/); >+ this.resolvedType = scope.environment().convertToRawType(this.resolvedType, true /*force the conversion of enclosing types*/); > } > 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()); >+ } >+ > /* (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.34 >diff -u -r1.34 JavadocMessageSend.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/JavadocMessageSend.java 7 Jan 2008 14:16:21 -0000 1.34 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/JavadocMessageSend.java 20 Feb 2008 07:02:09 -0000 >@@ -129,6 +129,10 @@ > } > } > if (!this.binding.isValidBinding()) { >+ if (this.receiver.resolvedType instanceof ProblemReferenceBinding) { >+ // 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 20 Feb 2008 07:02:04 -0000 >@@ -41,7 +41,7 @@ > > this.constant = Constant.NotAConstant; > if (this.receiver == null) { >- this.receiverType = scope.enclosingSourceType(); >+ this.receiverType = scope.enclosingReceiverType(); > } else if (scope.kind == Scope.CLASS_SCOPE) { > this.receiverType = this.receiver.resolveType((ClassScope) scope); > } else { >@@ -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 instanceof ProblemReferenceBinding) { >+ // 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.46 >diff -u -r1.46 ParameterizedQualifiedTypeReference.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.java 7 Jan 2008 14:16:21 -0000 1.46 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.java 20 Feb 2008 07:02:22 -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,19 @@ > > 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); >+ 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 +276,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/Expression.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java,v >retrieving revision 1.114 >diff -u -r1.114 Expression.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java 9 Oct 2007 20:30:15 -0000 1.114 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java 20 Feb 2008 07:02:02 -0000 >@@ -934,9 +934,7 @@ > return null; > } > >- public TypeBinding resolveTypeExpecting( >- BlockScope scope, >- TypeBinding expectedType) { >+ public TypeBinding resolveTypeExpecting(BlockScope scope, TypeBinding expectedType) { > > this.setExpectedType(expectedType); // needed in case of generic method invocation > TypeBinding expressionType = this.resolveType(scope); >@@ -947,7 +945,7 @@ > if (scope.isBoxingCompatibleWith(expressionType, expectedType)) { > this.computeConversion(scope, expectedType, expressionType); > } else { >- scope.problemReporter().typeMismatchError(expressionType, expectedType, this); >+ scope.problemReporter().typeMismatchError(expressionType, expectedType, this, null); > return null; > } > } >Index: compiler/org/eclipse/jdt/internal/compiler/ast/Assignment.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Assignment.java,v >retrieving revision 1.80 >diff -u -r1.80 Assignment.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/Assignment.java 18 Oct 2007 07:33:44 -0000 1.80 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/Assignment.java 20 Feb 2008 07:01:54 -0000 >@@ -186,13 +186,13 @@ > } > TypeBinding lhsType = lhs.resolveType(scope); > this.expression.setExpectedType(lhsType); // needed in case of generic method invocation >- if (lhsType != null) >+ if (lhsType != null) { > this.resolvedType = lhsType.capture(scope, this.sourceEnd); >+ } > TypeBinding rhsType = this.expression.resolveType(scope); > if (lhsType == null || rhsType == null) { > return null; > } >- > // check for assignment with no effect > Binding left = getDirectBinding(this.lhs); > if (left != null && left == getDirectBinding(this.expression)) { >@@ -201,8 +201,9 @@ > > // Compile-time conversion of base-types : implicit narrowing integer into byte/short/character > // may require to widen the rhs expression at runtime >- if (lhsType != rhsType) // must call before computeConversion() and typeMismatchError() >+ if (lhsType != rhsType) { // must call before computeConversion() and typeMismatchError() > scope.compilationUnitScope().recordTypeConversion(lhsType, rhsType); >+ } > if ((this.expression.isConstantValueOfTypeAssignableToType(rhsType, lhsType) > || (lhsType.isBaseType() && BaseTypeBinding.isWidening(lhsType.id, rhsType.id))) > || rhsType.isCompatibleWith(lhsType)) { >@@ -224,8 +225,8 @@ > CastExpression.checkNeedForAssignedCast(scope, lhsType, (CastExpression) this.expression); > } > return this.resolvedType; >- } >- scope.problemReporter().typeMismatchError(rhsType, lhsType, this.expression); >+ } >+ scope.problemReporter().typeMismatchError(rhsType, lhsType, this.expression, this.lhs); > return lhsType; > } > >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.43 >diff -u -r1.43 QualifiedTypeReference.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java 7 Jan 2008 14:16:20 -0000 1.43 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java 20 Feb 2008 07:02:35 -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,13 +64,18 @@ > } > 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()) >+ if (binding != null && !binding.isValidBinding()) { >+ if (binding instanceof ProblemReferenceBinding && binding.problemId() == ProblemReasons.NotFound) { >+ ProblemReferenceBinding problemBinding = (ProblemReferenceBinding) binding; >+ Binding pkg = scope.getTypeOrPackage(this.tokens); >+ return new ProblemReferenceBinding(problemBinding.compoundName, pkg instanceof PackageBinding ? null : scope.environment().createMissingType(null, this.tokens), ProblemReasons.NotFound); >+ } > return (ReferenceBinding) binding; // not found >- >+ } > PackageBinding packageBinding = binding == null ? null : (PackageBinding) binding; > boolean isClassScope = scope.kind == Scope.CLASS_SCOPE; > ReferenceBinding qualifiedType = null; >@@ -79,7 +85,7 @@ > return this.resolvedType; > if (i == 0 && this.resolvedType.isTypeVariable() && ((TypeVariableBinding) this.resolvedType).firstBound == null) { // cannot select from a type variable > scope.problemReporter().illegalAccessFromTypeVariable((TypeVariableBinding) this.resolvedType, this); >- return this.resolvedType = null; >+ return null; > } > if (i < last && isTypeUseDeprecated(this.resolvedType, scope)) { > reportDeprecatedType(this.resolvedType, scope); >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 20 Feb 2008 07:02:04 -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 instanceof ProblemReferenceBinding) { >+ // problem already got signaled on receiver, do not report secondary problem >+ return null; >+ } > scope.problemReporter().invalidField(this, this.receiverType); > return null; > } >@@ -572,10 +576,17 @@ > } > } > TypeBinding fieldType = fieldBinding.type; >- if (fieldType != null && ((this.bits & IsStrictlyAssigned) == 0)) { >- fieldType = fieldType.capture(scope, this.sourceEnd); // perform capture conversion if read access >+ if (fieldType != null) { >+ if ((this.bits & IsStrictlyAssigned) == 0) { >+ fieldType = fieldType.capture(scope, this.sourceEnd); // perform capture conversion if read access >+ } >+ this.resolvedType = fieldType; >+ if ((fieldType.tagBits & TagBits.HasMissingType) != 0) { >+ scope.problemReporter().invalidType(this, fieldType); >+ return null; >+ } > } >- return this.resolvedType = fieldType; >+ return fieldType; > } > > public void setActualReceiverType(ReferenceBinding receiverType) { >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.29 >diff -u -r1.29 SingleTypeReference.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/SingleTypeReference.java 7 Jan 2008 14:16:22 -0000 1.29 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/SingleTypeReference.java 20 Feb 2008 07:02:47 -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.42 >diff -u -r1.42 ParameterizedSingleTypeReference.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.java 28 Jan 2008 21:52:20 -0000 1.42 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.java 20 Feb 2008 07:02:22 -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) { >@@ -160,8 +172,18 @@ > > 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); >+ return null; >+ } >+ 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; >@@ -176,9 +198,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 20 Feb 2008 07:01:54 -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/MemberValuePair.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MemberValuePair.java,v >retrieving revision 1.30 >diff -u -r1.30 MemberValuePair.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/MemberValuePair.java 27 Apr 2007 15:51:38 -0000 1.30 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/MemberValuePair.java 20 Feb 2008 07:02:16 -0000 >@@ -101,7 +101,7 @@ > if (leafType.isAnnotationType() && !valueType.isAnnotationType()) { > scope.problemReporter().annotationValueMustBeAnnotation(this.binding.declaringClass, this.name, this.value, leafType); > } else { >- scope.problemReporter().typeMismatchError(valueType, requiredType, this.value); >+ scope.problemReporter().typeMismatchError(valueType, requiredType, this.value, null); > } > return; // may allow to proceed to find more errors at once > } >Index: compiler/org/eclipse/jdt/internal/compiler/ast/ReturnStatement.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ReturnStatement.java,v >retrieving revision 1.59 >diff -u -r1.59 ReturnStatement.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/ReturnStatement.java 19 Jul 2007 14:05:58 -0000 1.59 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/ReturnStatement.java 20 Feb 2008 07:02:41 -0000 >@@ -250,7 +250,7 @@ > CastExpression.checkNeedForAssignedCast(scope, methodType, (CastExpression) this.expression); > } return; > } >- scope.problemReporter().typeMismatchError(expressionType, methodType, this.expression); >+ scope.problemReporter().typeMismatchError(expressionType, methodType, this.expression, null); > } > > public void traverse(ASTVisitor visitor, BlockScope scope) { >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 20 Feb 2008 07:02:28 -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,10 +379,16 @@ > 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; > } >- >+ if ((this.binding.tagBits & TagBits.HasMissingType) != 0) { >+ scope.problemReporter().missingTypeInConstructor(this, this.binding); >+ } > // The enclosing instance must be compatible with the innermost enclosing type > ReferenceBinding expectedType = this.binding.declaringClass.enclosingType(); > if (expectedType != enclosingInstanceType) // must call before computeConversion() and typeMismatchError() >@@ -378,12 +397,12 @@ > this.enclosingInstance.computeConversion(scope, expectedType, enclosingInstanceType); > return this.resolvedType = receiverType; > } >- scope.problemReporter().typeMismatchError(enclosingInstanceType, expectedType, this.enclosingInstance); >+ scope.problemReporter().typeMismatchError(enclosingInstanceType, expectedType, this.enclosingInstance, null); > return this.resolvedType = receiverType; > } > 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,16 +426,24 @@ > 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; > } >+ // unneeded since diagnosed recursively >+ //if ((inheritedBinding.tagBits & TagBits.HasMissingType) != 0) { >+ // scope.problemReporter().missingTypeInConstructor(this, inheritedBinding); >+ //} > if (this.enclosingInstance != null) { > ReferenceBinding targetEnclosing = inheritedBinding.declaringClass.enclosingType(); > if (targetEnclosing == null) { > scope.problemReporter().unnecessaryEnclosingInstanceSpecification(this.enclosingInstance, superType); > return this.resolvedType; > } else if (!enclosingInstanceType.isCompatibleWith(targetEnclosing) && !scope.isBoxingCompatibleWith(enclosingInstanceType, targetEnclosing)) { >- scope.problemReporter().typeMismatchError(enclosingInstanceType, targetEnclosing, this.enclosingInstance); >+ scope.problemReporter().typeMismatchError(enclosingInstanceType, targetEnclosing, this.enclosingInstance, null); > return this.resolvedType; > } > this.enclosingInstance.computeConversion(scope, targetEnclosing, enclosingInstanceType); >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.61 >diff -u -r1.61 Annotation.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/Annotation.java 25 Jan 2008 11:59:21 -0000 1.61 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/Annotation.java 20 Feb 2008 07:01:50 -0000 >@@ -234,8 +234,8 @@ > } > this.resolvedType = typeBinding; > // ensure type refers to an annotation type >- if (!typeBinding.isAnnotationType()) { >- scope.problemReporter().typeMismatchError(typeBinding, scope.getJavaLangAnnotationAnnotation(), this.type); >+ if (!typeBinding.isAnnotationType() && typeBinding.isValidBinding()) { >+ scope.problemReporter().typeMismatchError(typeBinding, scope.getJavaLangAnnotationAnnotation(), this.type, null); > 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 20 Feb 2008 07:02:54 -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.20 >diff -u -r1.20 JavadocQualifiedTypeReference.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/JavadocQualifiedTypeReference.java 7 Jan 2008 14:16:22 -0000 1.20 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/JavadocQualifiedTypeReference.java 20 Feb 2008 07:02:09 -0000 >@@ -32,26 +32,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 > */ >@@ -59,15 +39,14 @@ > // 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); >+ TypeBinding type = this.resolvedType = getTypeBinding(scope); > // End resolution when getTypeBinding(scope) returns null. This may happen in > // certain circumstances, typically when an illegal access is done on a type > // variable (see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=204749) >- if (this.resolvedType == null) return null; >- >- if (!this.resolvedType.isValidBinding()) { >+ if (type == null) return null; >+ if (!type.isValidBinding()) { > Binding binding = scope.getTypeOrPackage(this.tokens); > if (binding instanceof PackageBinding) { > this.packageBinding = (PackageBinding) binding; >@@ -76,17 +55,22 @@ > } > return null; > } >- if (isTypeUseDeprecated(this.resolvedType, scope)) >- reportDeprecatedType(this.resolvedType, scope); >- >+ if (isTypeUseDeprecated(type, scope)) >+ reportDeprecatedType(type, scope); > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=209936 > // raw convert all enclosing types when dealing with Javadoc references >- if (this.resolvedType.isGenericType() || this.resolvedType.isParameterizedType()) { >- return this.resolvedType = scope.environment().convertToRawType(this.resolvedType, true /*force the conversion of enclosing types*/); >- } >+ if (type.isGenericType() || type.isParameterizedType()) { >+ this.resolvedType = scope.environment().convertToRawType(type, true /*force the conversion of enclosing types*/); >+ } > 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); > } >@@ -94,4 +78,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/ArrayInitializer.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayInitializer.java,v >retrieving revision 1.48 >diff -u -r1.48 ArrayInitializer.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/ArrayInitializer.java 29 Mar 2007 13:17:27 -0000 1.48 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/ArrayInitializer.java 20 Feb 2008 07:01:54 -0000 >@@ -176,7 +176,7 @@ > && expression.isConstantValueOfTypeAssignableToType(expressionType, scope.environment().computeBoxingType(elementType)))) { > expression.computeConversion(scope, elementType, expressionType); > } else { >- scope.problemReporter().typeMismatchError(expressionType, elementType, expression); >+ scope.problemReporter().typeMismatchError(expressionType, elementType, expression, null); > } > } > return this.binding; >@@ -212,7 +212,7 @@ > if (leafElementType != null) { > this.resolvedType = scope.createArrayType(leafElementType, dim); > if (expectedType != null) >- scope.problemReporter().typeMismatchError(this.resolvedType, expectedType, this); >+ scope.problemReporter().typeMismatchError(this.resolvedType, expectedType, this, null); > } > return null; > } >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 20 Feb 2008 07:02:00 -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,35 @@ > } > 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 ((this.binding.tagBits & TagBits.HasMissingType) != 0) { >+ scope.problemReporter().missingTypeInConstructor(this, this.binding); >+ } >+ 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 +428,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.114 >diff -u -r1.114 CastExpression.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/CastExpression.java 1 Feb 2008 16:17:51 -0000 1.114 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/CastExpression.java 20 Feb 2008 07:01:57 -0000 >@@ -484,7 +484,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 20 Feb 2008 07:02:16 -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; > } > } >@@ -425,7 +430,7 @@ > this.binding = > this.receiver.isImplicitThis() > ? scope.getImplicitMethod(this.selector, argumentTypes, this) >- : scope.getMethod(this.actualReceiverType, this.selector, argumentTypes, this); >+ : scope.getMethod(this.actualReceiverType, this.selector, argumentTypes, this); > if (!this.binding.isValidBinding()) { > if (this.binding.declaringClass == null) { > if (this.actualReceiverType instanceof ReferenceBinding) { >@@ -458,11 +463,14 @@ > closestMatchOriginal.modifiers |= ExtraCompilerModifiers.AccLocallyUsed; > } > } >- return this.resolvedType; >+ return (this.resolvedType != null && (this.resolvedType.tagBits & TagBits.HasMissingType) == 0) ? this.resolvedType : null; >+ } >+ if ((this.binding.tagBits & TagBits.HasMissingType) != 0) { >+ scope.problemReporter().missingTypeInMethod(this, this.binding); > } > final CompilerOptions compilerOptions = scope.compilerOptions(); > if (!this.binding.isStatic()) { >- // the "receiver" must not be a type, in other words, a NameReference that the TC has bound to a Type >+ // the "receiver" must not be a type > if (receiverIsType) { > scope.problemReporter().mustUseAStaticMethod(this, this.binding); > if (this.actualReceiverType.isRawType() >@@ -527,7 +535,7 @@ > if (this.typeArguments != null && this.binding.original().typeVariables == Binding.NO_TYPE_VARIABLES) { > scope.problemReporter().unnecessaryTypeArgumentsForMethodInvocation(this.binding, this.genericTypeArguments, this.typeArguments); > } >- return this.resolvedType; >+ return ((this.resolvedType.tagBits & TagBits.HasMissingType) == 0) ? this.resolvedType : null; > } > > public void setActualReceiverType(ReferenceBinding receiverType) { >Index: compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java,v >retrieving revision 1.62 >diff -u -r1.62 LocalDeclaration.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java 28 Oct 2006 04:11:27 -0000 1.62 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java 20 Feb 2008 07:02:09 -0000 >@@ -209,7 +209,10 @@ > CastExpression.checkNeedForAssignedCast(scope, variableType, (CastExpression) this.initialization); > } > } else { >- scope.problemReporter().typeMismatchError(initializationType, variableType, this.initialization); >+ if (this.type.resolvedType.isValidBinding()) { >+ // if problem already got signaled on type, do not report secondary problem >+ scope.problemReporter().typeMismatchError(initializationType, variableType, this.initialization, 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.121 >diff -u -r1.121 QualifiedNameReference.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java 7 Jan 2008 14:16:21 -0000 1.121 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java 20 Feb 2008 07:02:35 -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); >@@ -1005,7 +1006,13 @@ > this); > this.bits &= ~ASTNode.RestrictiveFlagMASK; // clear bits > this.bits |= Binding.LOCAL; >- return this.resolvedType = getOtherFieldBindings(scope); >+ this.resolvedType = getOtherFieldBindings(scope); >+ if (this.resolvedType != null && (this.resolvedType.tagBits & TagBits.HasMissingType) != 0) { >+ FieldBinding lastField = this.otherBindings[otherBindings.length - 1]; >+ scope.problemReporter().invalidField(this, new ProblemFieldBinding(lastField.declaringClass, lastField.name, ProblemReasons.NotFound), this.tokens.length, this.resolvedType.leafComponentType()); >+ return null; >+ } >+ return this.resolvedType; > } > if (this.binding instanceof FieldBinding) { > FieldBinding fieldBinding = (FieldBinding) this.binding; >@@ -1032,8 +1039,13 @@ > // if (isTypeUseDeprecated(this.actualReceiverType, scope)) > // scope.problemReporter().deprecatedType(this.actualReceiverType, this); > // } >- >- return this.resolvedType = getOtherFieldBindings(scope); >+ this.resolvedType = getOtherFieldBindings(scope); >+ if (this.resolvedType != null && (this.resolvedType.tagBits & TagBits.HasMissingType) != 0) { >+ FieldBinding lastField = this.indexOfFirstFieldBinding == this.tokens.length ? (FieldBinding)this.binding : this.otherBindings[otherBindings.length - 1]; >+ scope.problemReporter().invalidField(this, new ProblemFieldBinding(lastField.declaringClass, lastField.name, ProblemReasons.NotFound), this.tokens.length, this.resolvedType.leafComponentType()); >+ return null; >+ } >+ return this.resolvedType; > } > // thus it was a type > this.bits &= ~ASTNode.RestrictiveFlagMASK; // clear bits >Index: compiler/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java,v >retrieving revision 1.85 >diff -u -r1.85 FieldDeclaration.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java 2 Nov 2007 11:59:50 -0000 1.85 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java 20 Feb 2008 07:02:02 -0000 >@@ -240,7 +240,10 @@ > CastExpression.checkNeedForAssignedCast(initializationScope, fieldType, (CastExpression) this.initialization); > } > } else { >- initializationScope.problemReporter().typeMismatchError(initializationType, fieldType, this.initialization); >+ if (this.type.resolvedType.isValidBinding()) { >+ // if problem already got signaled on type, do not report secondary problem >+ initializationScope.problemReporter().typeMismatchError(initializationType, fieldType, this.initialization, null); >+ } > } > if (this.binding.isFinal()){ // cast from constant actual type to variable type > this.binding.setConstant(this.initialization.constant.castTo((this.binding.type.id << 4) + this.initialization.constant.typeID())); >Index: compiler/org/eclipse/jdt/internal/compiler/ast/CaseStatement.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CaseStatement.java,v >retrieving revision 1.28 >diff -u -r1.28 CaseStatement.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/CaseStatement.java 12 Apr 2007 10:37:18 -0000 1.28 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/CaseStatement.java 20 Feb 2008 07:01:57 -0000 >@@ -135,7 +135,7 @@ > // constantExpression.computeConversion(scope, caseType, switchExpressionType); - do not report boxing/unboxing conversion > return this.constantExpression.constant; > } >- scope.problemReporter().typeMismatchError(caseType, switchExpressionType, this.constantExpression); >+ scope.problemReporter().typeMismatchError(caseType, switchExpressionType, this.constantExpression, switchStatement.expression); > return Constant.NotAConstant; > } > >Index: eval/org/eclipse/jdt/internal/eval/CodeSnippetSkeleton.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetSkeleton.java,v >retrieving revision 1.39 >diff -u -r1.39 CodeSnippetSkeleton.java >--- eval/org/eclipse/jdt/internal/eval/CodeSnippetSkeleton.java 6 Mar 2007 02:38:49 -0000 1.39 >+++ eval/org/eclipse/jdt/internal/eval/CodeSnippetSkeleton.java 20 Feb 2008 07:04:13 -0000 >@@ -28,27 +28,6 @@ > * throws checked exceptio without having to catch those. > */ > public class CodeSnippetSkeleton implements IBinaryType, EvaluationConstants { >- IBinaryMethod[] methods = new IBinaryMethod[] { >- new BinaryMethodSkeleton( >- "<init>".toCharArray(), //$NON-NLS-1$ >- "()V".toCharArray(), //$NON-NLS-1$ >- new char[][] {}, >- true >- ), >- new BinaryMethodSkeleton( >- "run".toCharArray(), //$NON-NLS-1$ >- "()V".toCharArray(), //$NON-NLS-1$ >- new char[][] {"java/lang/Throwable".toCharArray()}, //$NON-NLS-1$ >- false >- ), >- new BinaryMethodSkeleton( >- "setResult".toCharArray(), //$NON-NLS-1$ >- "(Ljava/lang/Object;Ljava/lang/Class;)V".toCharArray(), //$NON-NLS-1$ >- new char[][] {}, >- false >- ) >- }; >- > public static class BinaryMethodSkeleton implements IBinaryMethod { > char[][] exceptionTypeNames; > char[] methodDescriptor; >@@ -61,43 +40,64 @@ > this.exceptionTypeNames = exceptionTypeNames; > this.isConstructor = isConstructor; > } >+ public IBinaryAnnotation[] getAnnotations() { >+ return null; >+ } >+ public char[][] getArgumentNames() { >+ return null; >+ } >+ public Object getDefaultValue() { >+ return null; >+ } > public char[][] getExceptionTypeNames() { > return this.exceptionTypeNames; > } >+ public char[] getGenericSignature() { >+ return null; >+ } > public char[] getMethodDescriptor() { > return this.methodDescriptor; > } > public int getModifiers() { > return ClassFileConstants.AccPublic; > } >+ public IBinaryAnnotation[] getParameterAnnotations(int index) { >+ return null; >+ } > public char[] getSelector() { > return this.selector; > } >+ public long getTagBits() { >+ return 0; >+ } > public boolean isClinit() { > return false; > } > public boolean isConstructor() { > return this.isConstructor; > } >- public char[][] getArgumentNames() { >- return null; >- } >- public char[] getGenericSignature() { >- return null; >- } >- public long getTagBits() { >- return 0; >- } >- public IBinaryAnnotation[] getAnnotations() { >- return null; >- } >- public IBinaryAnnotation[] getParameterAnnotations(int index) { >- return null; >- } >- public Object getDefaultValue() { >- return null; >- } > } >+ >+ IBinaryMethod[] methods = new IBinaryMethod[] { >+ new BinaryMethodSkeleton( >+ "<init>".toCharArray(), //$NON-NLS-1$ >+ "()V".toCharArray(), //$NON-NLS-1$ >+ new char[][] {}, >+ true >+ ), >+ new BinaryMethodSkeleton( >+ "run".toCharArray(), //$NON-NLS-1$ >+ "()V".toCharArray(), //$NON-NLS-1$ >+ new char[][] {"java/lang/Throwable".toCharArray()}, //$NON-NLS-1$ >+ false >+ ), >+ new BinaryMethodSkeleton( >+ "setResult".toCharArray(), //$NON-NLS-1$ >+ "(Ljava/lang/Object;Ljava/lang/Class;)V".toCharArray(), //$NON-NLS-1$ >+ new char[][] {}, >+ false >+ ) >+ }; > > /** > * CodeSnippetSkeleton constructor comment. >@@ -105,6 +105,9 @@ > public CodeSnippetSkeleton() { > super(); > } >+public IBinaryAnnotation[] getAnnotations() { >+ return null; >+} > public char[] getEnclosingTypeName() { > return null; > } >@@ -123,6 +126,12 @@ > public char[][] getInterfaceNames() { > return null; > } >+public String getJavadocContents() { >+ return null; >+} >+public String getJavadocContents(IProgressMonitor monitor, String defaultEncoding) throws JavaModelException { >+ return null; >+} > public IBinaryNestedType[] getMemberTypes() { > return null; > } >@@ -132,6 +141,9 @@ > public int getModifiers() { > return ClassFileConstants.AccPublic; > } >+public char[][][] getMissingTypeNames() { >+ return null; >+} > public char[] getName() { > return CODE_SNIPPET_NAME; > } >@@ -141,6 +153,12 @@ > public char[] getSuperclassName() { > return null; > } >+public long getTagBits() { >+ return 0; >+} >+public String getURLContents(String docUrlValue, String defaultEncoding) { >+ return null; >+} > public boolean isAnonymous() { > return false; > } >@@ -156,19 +174,4 @@ > public char[] sourceFileName() { > return null; > } >-public IBinaryAnnotation[] getAnnotations() { >- return null; >-} >-public long getTagBits() { >- return 0; >-} >-public String getJavadocContents(IProgressMonitor monitor, String defaultEncoding) throws JavaModelException { >- return null; >-} >-public String getJavadocContents() { >- return null; >-} >-public String getURLContents(String docUrlValue, String defaultEncoding) { >- return null; >-} > } >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 20 Feb 2008 07:04:13 -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 20 Feb 2008 07:04:11 -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: 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 20 Feb 2008 07:04:20 -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 20 Feb 2008 07:04:19 -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 20 Feb 2008 07:04:19 -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/BindingResolver.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BindingResolver.java,v >retrieving revision 1.48 >diff -u -r1.48 BindingResolver.java >--- dom/org/eclipse/jdt/core/dom/BindingResolver.java 24 Apr 2007 15:25:16 -0000 1.48 >+++ dom/org/eclipse/jdt/core/dom/BindingResolver.java 20 Feb 2008 07:04:01 -0000 >@@ -267,6 +267,15 @@ > return null; > } > >+ /** >+ * Return whether the binding resolution is recovering inconsistent types >+ * @return a boolean telling if binding resolution is recovering inconsistent types >+ */ >+ boolean isRecoveringBindings() { >+ return false; >+ } >+ >+ > boolean isResolvedTypeInferredFromExpectedType(MethodInvocation methodInvocation) { > return false; > } >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.57 >diff -u -r1.57 VariableBinding.java >--- dom/org/eclipse/jdt/core/dom/VariableBinding.java 15 Feb 2008 10:41:25 -0000 1.57 >+++ dom/org/eclipse/jdt/core/dom/VariableBinding.java 20 Feb 2008 07:04:11 -0000 >@@ -37,26 +37,39 @@ > private String name; > private BindingResolver resolver; > private ITypeBinding type; >- >+ private IAnnotationBinding[] annotations; >+ > VariableBinding(BindingResolver resolver, org.eclipse.jdt.internal.compiler.lookup.VariableBinding binding) { > this.resolver = resolver; > this.binding = binding; > } > > public IAnnotationBinding[] getAnnotations() { >+ if (this.annotations != null) { >+ return this.annotations; >+ } > org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding[] internalAnnotations = this.binding.getAnnotations(); >- // the variable is not an enum constant nor a field nor an argument. > int length = internalAnnotations == null ? 0 : internalAnnotations.length; >- IAnnotationBinding[] domInstances = >- length == 0 ? AnnotationBinding.NoAnnotations : new AnnotationBinding[length]; >- for (int i = 0; i < length; i++) { >- final IAnnotationBinding annotationInstance = this.resolver.getAnnotationInstance(internalAnnotations[i]); >- if (annotationInstance == null) {// not resolving binding >- return AnnotationBinding.NoAnnotations; >+ if (length != 0) { >+ IAnnotationBinding[] tempAnnotations = new IAnnotationBinding[length]; >+ int convertedAnnotationCount = 0; >+ for (int i = 0; i < length; i++) { >+ org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding internalAnnotation = internalAnnotations[i]; >+ final IAnnotationBinding annotationInstance = this.resolver.getAnnotationInstance(internalAnnotation); >+ if (annotationInstance == null) { >+ continue; >+ } >+ tempAnnotations[convertedAnnotationCount++] = annotationInstance; >+ } >+ if (convertedAnnotationCount != length) { >+ if (convertedAnnotationCount == 0) { >+ return this.annotations = AnnotationBinding.NoAnnotations; >+ } >+ System.arraycopy(tempAnnotations, 0, (tempAnnotations = new IAnnotationBinding[convertedAnnotationCount]), 0, convertedAnnotationCount); > } >- domInstances[i] = annotationInstance; >+ return this.annotations = tempAnnotations; > } >- return domInstances; >+ return this.annotations = AnnotationBinding.NoAnnotations; > } > > /* (non-Javadoc) >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 20 Feb 2008 07:04:11 -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; >@@ -51,7 +52,9 @@ > import org.eclipse.jdt.internal.compiler.util.SuffixConstants; > import org.eclipse.jdt.internal.compiler.util.Util; > import org.eclipse.jdt.internal.core.ClassFile; >+import org.eclipse.jdt.internal.core.CompilationUnit; > import org.eclipse.jdt.internal.core.JavaElement; >+import org.eclipse.jdt.internal.core.PackageFragment; > > /** > * Internal implementation of type bindings. >@@ -103,16 +106,20 @@ > int length = internalAnnotations == null ? 0 : internalAnnotations.length; > if (length != 0) { > IAnnotationBinding[] tempAnnotations = new IAnnotationBinding[length]; >- int annotationsCounter = 0; >+ int convertedAnnotationCount = 0; > for (int i = 0; i < length; i++) { >- final IAnnotationBinding annotationInstance = this.resolver.getAnnotationInstance(internalAnnotations[i]); >+ org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding internalAnnotation = internalAnnotations[i]; >+ IAnnotationBinding annotationInstance = this.resolver.getAnnotationInstance(internalAnnotation); > if (annotationInstance == null) { > continue; > } >- tempAnnotations[annotationsCounter++] = annotationInstance; >+ tempAnnotations[convertedAnnotationCount++] = annotationInstance; > } >- if (length != annotationsCounter) { >- System.arraycopy(tempAnnotations, 0, (tempAnnotations = new IAnnotationBinding[annotationsCounter]), 0, annotationsCounter); >+ if (convertedAnnotationCount != length) { >+ if (convertedAnnotationCount == 0) { >+ return this.annotations = AnnotationBinding.NoAnnotations; >+ } >+ System.arraycopy(tempAnnotations, 0, (tempAnnotations = new IAnnotationBinding[convertedAnnotationCount]), 0, convertedAnnotationCount); > } > return this.annotations = tempAnnotations; > } >@@ -240,14 +247,23 @@ > FieldBinding[] fieldBindings = referenceBinding.availableFields(); // resilience > int length = fieldBindings.length; > if (length != 0) { >+ int convertedFieldCount = 0; > IVariableBinding[] newFields = new IVariableBinding[length]; > for (int i = 0; i < length; i++) { >- IVariableBinding variableBinding = this.resolver.getVariableBinding(fieldBindings[i]); >+ FieldBinding fieldBinding = fieldBindings[i]; >+ IVariableBinding variableBinding = this.resolver.getVariableBinding(fieldBinding); > if (variableBinding == null) { > return this.fields = NO_VARIABLE_BINDINGS; > } >- newFields[i] = variableBinding; >+ newFields[convertedFieldCount++] = variableBinding; > } >+ >+ if (convertedFieldCount != length) { >+ if (convertedFieldCount == 0) { >+ return this.fields = NO_VARIABLE_BINDINGS; >+ } >+ System.arraycopy(newFields, 0, (newFields = new IVariableBinding[convertedFieldCount]), 0, convertedFieldCount); >+ } > return this.fields = newFields; > } > } >@@ -275,19 +291,23 @@ > org.eclipse.jdt.internal.compiler.lookup.MethodBinding[] internalMethods = referenceBinding.availableMethods(); // be resilient > int length = internalMethods.length; > if (length != 0) { >- int removeSyntheticsCounter = 0; >+ int convertedMethodCount = 0; > IMethodBinding[] newMethods = new IMethodBinding[length]; > for (int i = 0; i < length; i++) { > org.eclipse.jdt.internal.compiler.lookup.MethodBinding methodBinding = internalMethods[i]; >- if (!shouldBeRemoved(methodBinding)) { >- IMethodBinding methodBinding2 = this.resolver.getMethodBinding(methodBinding); >- if (methodBinding2 != null) { >- newMethods[removeSyntheticsCounter++] = methodBinding2; >- } >+ if (methodBinding.isDefaultAbstract() || methodBinding.isSynthetic() || (methodBinding.isConstructor() && isInterface())) { >+ continue; >+ } >+ IMethodBinding methodBinding2 = this.resolver.getMethodBinding(methodBinding); >+ if (methodBinding2 != null) { >+ newMethods[convertedMethodCount++] = methodBinding2; > } > } >- if (removeSyntheticsCounter != length) { >- System.arraycopy(newMethods, 0, (newMethods = new IMethodBinding[removeSyntheticsCounter]), 0, removeSyntheticsCounter); >+ if (convertedMethodCount != length) { >+ if (convertedMethodCount == 0) { >+ return this.methods = NO_METHOD_BINDINGS; >+ } >+ System.arraycopy(newMethods, 0, (newMethods = new IMethodBinding[convertedMethodCount]), 0, convertedMethodCount); > } > return this.methods = newMethods; > } >@@ -501,6 +521,20 @@ > } > > public IJavaElement getJavaElement() { >+ if (this.isRecovered()) { >+ try { >+ IPackageBinding packageBinding = getPackage(); >+ if (packageBinding != null) { >+ final IJavaElement javaElement = packageBinding.getJavaElement(); >+ if (javaElement != null && javaElement.getElementType() == IJavaElement.PACKAGE_FRAGMENT) { >+ return new CompilationUnit((PackageFragment) javaElement, new String(this.binding.sourceName()), this.resolver.getWorkingCopyOwner()).getWorkingCopy(this.resolver.getWorkingCopyOwner(), null); >+ } >+ } >+ } catch (JavaModelException e) { >+ //ignore >+ } >+ return null; >+ } > JavaElement element = getUnresolvedJavaElement(); > if (element == null) > return null; >@@ -1309,7 +1343,7 @@ > * @see IBinding#isRecovered() > */ > public boolean isRecovered() { >- return false; >+ return (this.binding.tagBits & TagBits.HasMissingType) != 0; > } > > /* (non-Javadoc) >@@ -1375,10 +1409,6 @@ > return this.binding.isWildcard(); > } > >- private boolean shouldBeRemoved(org.eclipse.jdt.internal.compiler.lookup.MethodBinding methodBinding) { >- return methodBinding.isDefaultAbstract() || methodBinding.isSynthetic() || (methodBinding.isConstructor() && isInterface()); >- } >- > /* > * For debugging purpose only. > * @see java.lang.Object#toString() >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 20 Feb 2008 07:04:05 -0000 >@@ -57,6 +57,7 @@ > 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.TagBits; > import org.eclipse.jdt.internal.compiler.lookup.TypeConstants; > import org.eclipse.jdt.internal.compiler.lookup.TypeIds; > import org.eclipse.jdt.internal.compiler.problem.AbortCompilation; >@@ -128,29 +129,32 @@ > */ > WorkingCopyOwner workingCopyOwner; > >- boolean isRecoveredBinding; >+ /** >+ * Toggle controlling whether DOM bindings should be created when missing internal compiler bindings.. >+ */ >+ boolean isRecoveringBindings; > > /** > * Constructor for DefaultBindingResolver. > */ >- DefaultBindingResolver(CompilationUnitScope scope, WorkingCopyOwner workingCopyOwner, BindingTables bindingTables, boolean isRecoveredBinding) { >+ DefaultBindingResolver(CompilationUnitScope scope, WorkingCopyOwner workingCopyOwner, BindingTables bindingTables, boolean isRecoveringBindings) { > this.newAstToOldAst = new HashMap(); > this.astNodesToBlockScope = new HashMap(); > this.bindingsToAstNodes = new HashMap(); > this.bindingTables = bindingTables; > this.scope = scope; > this.workingCopyOwner = workingCopyOwner; >- this.isRecoveredBinding = isRecoveredBinding; >+ this.isRecoveringBindings = isRecoveringBindings; > } > >- DefaultBindingResolver(LookupEnvironment lookupEnvironment, WorkingCopyOwner workingCopyOwner, BindingTables bindingTables, boolean isRecoveredBinding) { >+ DefaultBindingResolver(LookupEnvironment lookupEnvironment, WorkingCopyOwner workingCopyOwner, BindingTables bindingTables, boolean isRecoveringBindings) { > this.newAstToOldAst = new HashMap(); > this.astNodesToBlockScope = new HashMap(); > this.bindingsToAstNodes = new HashMap(); > this.bindingTables = bindingTables; > this.scope = new CompilationUnitScope(new CompilationUnitDeclaration(null, null, -1), lookupEnvironment); > this.workingCopyOwner = workingCopyOwner; >- this.isRecoveredBinding = isRecoveredBinding; >+ this.isRecoveringBindings = isRecoveringBindings; > } > > /* >@@ -213,10 +217,17 @@ > * Method declared on BindingResolver. > */ > synchronized IMethodBinding getMethodBinding(org.eclipse.jdt.internal.compiler.lookup.MethodBinding methodBinding) { >- if (methodBinding != null && !methodBinding.isValidBinding()) { >- org.eclipse.jdt.internal.compiler.lookup.ProblemMethodBinding problemMethodBinding = >- (org.eclipse.jdt.internal.compiler.lookup.ProblemMethodBinding) methodBinding; >- methodBinding = problemMethodBinding.closestMatch; >+ if (methodBinding != null) { >+ //if ((methodBinding.tagBits & TagBits.HasMissingType) != 0 >+ // && !this.isRecoveringBindings() >+ // && !methodBinding.declaringClass.isBinaryBinding()) { // binaries have been resilient since 3.2.2 >+ // return null; >+ //} >+ if (!methodBinding.isValidBinding()) { >+ org.eclipse.jdt.internal.compiler.lookup.ProblemMethodBinding problemMethodBinding = >+ (org.eclipse.jdt.internal.compiler.lookup.ProblemMethodBinding) methodBinding; >+ methodBinding = problemMethodBinding.closestMatch; >+ } > } > > if (methodBinding != null) { >@@ -246,7 +257,7 @@ > * Method declared on BindingResolver. > */ > synchronized IPackageBinding getPackageBinding(org.eclipse.jdt.internal.compiler.lookup.PackageBinding packageBinding) { >- if (packageBinding == null || !packageBinding.isValidBinding()) { >+ if (packageBinding == null) { > return null; > } > IPackageBinding binding = (IPackageBinding) this.bindingTables.compilerBindingsToASTBindings.get(packageBinding); >@@ -322,7 +333,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; >@@ -333,15 +344,17 @@ > } > break; > case ProblemReasons.NotFound : >- if (this.isRecoveredBinding) { >- ITypeBinding binding = (ITypeBinding) this.bindingTables.compilerBindingsToASTBindings.get(referenceBinding); >- if (binding != null) { >- return binding; >- } >- binding = new RecoveredTypeBinding(this, referenceBinding); >- this.bindingTables.compilerBindingsToASTBindings.put(referenceBinding, binding); >+ ITypeBinding binding = (ITypeBinding) this.bindingTables.compilerBindingsToASTBindings.get(referenceBinding); >+ if (binding != null) { > return binding; > } >+ if ((referenceBinding.tagBits & TagBits.HasMissingType) != 0) { >+ binding = new TypeBinding(this, referenceBinding); >+ } else if (this.isRecoveringBindings) { >+ binding = new RecoveredTypeBinding(this, referenceBinding); >+ } >+ this.bindingTables.compilerBindingsToASTBindings.put(referenceBinding, binding); >+ return binding; > } > return null; > } else { >@@ -366,8 +379,13 @@ > } > > synchronized IVariableBinding getVariableBinding(org.eclipse.jdt.internal.compiler.lookup.VariableBinding variableBinding, VariableDeclaration variableDeclaration) { >- if (this.isRecoveredBinding) { >+ if (this.isRecoveringBindings) { > if (variableBinding != null) { >+ //if ((variableBinding.tagBits & TagBits.HasMissingType) != 0 >+ // && !this.isRecoveringBindings() >+ // && (variableBinding.kind() == Binding.FIELD && !((FieldBinding)variableBinding).declaringClass.isBinaryBinding())) { // binaries have been resilient since 3.2.2 >+ // return null; >+ //} > if (variableBinding.isValidBinding()) { > IVariableBinding binding = (IVariableBinding) this.bindingTables.compilerBindingsToASTBindings.get(variableBinding); > if (binding != null) { >@@ -461,6 +479,9 @@ > > synchronized IAnnotationBinding getAnnotationInstance(org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding internalInstance) { > if (internalInstance == null) return null; >+ //if ((internalInstance.getAnnotationType().tagBits & TagBits.HasMissingType) != 0 && !this.isRecoveringBindings) { >+ // return null; >+ //} > IAnnotationBinding domInstance = > (IAnnotationBinding) this.bindingTables.compilerBindingsToASTBindings.get(internalInstance); > if (domInstance != null) >@@ -470,6 +491,9 @@ > return domInstance; > } > >+ boolean isRecoveringBindings() { >+ return this.isRecoveringBindings; >+ } > boolean isResolvedTypeInferredFromExpectedType(MethodInvocation methodInvocation) { > Object oldNode = this.newAstToOldAst.get(methodInvocation); > if (oldNode instanceof MessageSend) { >@@ -1283,17 +1307,18 @@ > } else if (node instanceof FieldReference) { > return getVariableBinding(((FieldReference) node).binding); > } else if (node instanceof SingleTypeReference) { >+ if (node instanceof JavadocSingleTypeReference) { >+ JavadocSingleTypeReference typeRef = (JavadocSingleTypeReference) node; >+ if (typeRef.packageBinding != null) { >+ return getPackageBinding(typeRef.packageBinding); >+ } >+ } > SingleTypeReference singleTypeReference = (SingleTypeReference) node; > org.eclipse.jdt.internal.compiler.lookup.TypeBinding binding = singleTypeReference.resolvedType; >- if (binding != null) { >- if (!binding.isValidBinding() && node instanceof JavadocSingleTypeReference) { >- JavadocSingleTypeReference typeRef = (JavadocSingleTypeReference) node; >- if (typeRef.packageBinding != null) { >- return getPackageBinding(typeRef.packageBinding); >- } >- } >- return this.getTypeBinding(binding.leafComponentType()); >+ if (binding == null) { >+ return null; > } >+ return this.getTypeBinding(binding.leafComponentType()); > } else if (node instanceof org.eclipse.jdt.internal.compiler.ast.FieldDeclaration) { > org.eclipse.jdt.internal.compiler.ast.FieldDeclaration fieldDeclaration = (org.eclipse.jdt.internal.compiler.ast.FieldDeclaration) node; > return this.getVariableBinding(fieldDeclaration.binding); >@@ -1742,7 +1767,7 @@ > * @throws IllegalArgumentException if the type binding represents the <code>void</code> type binding > */ > ITypeBinding resolveArrayType(ITypeBinding typeBinding, int dimensions) { >- if (typeBinding.isRecovered()) throw new IllegalArgumentException("Cannot be called on a recovered type binding"); //$NON-NLS-1$ >+ if (typeBinding instanceof RecoveredTypeBinding) throw new IllegalArgumentException("Cannot be called on a recovered type binding"); //$NON-NLS-1$ > ITypeBinding leafComponentType = typeBinding; > int actualDimensions = dimensions; > if (typeBinding.isArray()) { >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.89 >diff -u -r1.89 MethodBinding.java >--- dom/org/eclipse/jdt/core/dom/MethodBinding.java 9 Jan 2008 12:32:36 -0000 1.89 >+++ dom/org/eclipse/jdt/core/dom/MethodBinding.java 20 Feb 2008 07:04:07 -0000 >@@ -107,20 +107,28 @@ > if (this.annotations != null) { > return this.annotations; > } >- org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding[] annots = this.binding.getAnnotations(); >- int length = annots == null ? 0 : annots.length; >- if (length == 0) { >- return this.annotations = AnnotationBinding.NoAnnotations; >- } >- IAnnotationBinding[] domInstances = new AnnotationBinding[length]; >- for (int i = 0; i < length; i++) { >- final IAnnotationBinding annotationInstance = this.resolver.getAnnotationInstance(annots[i]); >- if (annotationInstance == null) { >- return this.annotations = AnnotationBinding.NoAnnotations; >+ org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding[] internalAnnotations = this.binding.getAnnotations(); >+ int length = internalAnnotations == null ? 0 : internalAnnotations.length; >+ if (length != 0) { >+ IAnnotationBinding[] tempAnnotations = new IAnnotationBinding[length]; >+ int convertedAnnotationCount = 0; >+ for (int i = 0; i < length; i++) { >+ org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding internalAnnotation = internalAnnotations[i]; >+ final IAnnotationBinding annotationInstance = this.resolver.getAnnotationInstance(internalAnnotation); >+ if (annotationInstance == null) { >+ continue; >+ } >+ tempAnnotations[convertedAnnotationCount++] = annotationInstance; >+ } >+ if (convertedAnnotationCount != length) { >+ if (convertedAnnotationCount == 0) { >+ return this.annotations = AnnotationBinding.NoAnnotations; >+ } >+ System.arraycopy(tempAnnotations, 0, (tempAnnotations = new IAnnotationBinding[convertedAnnotationCount]), 0, convertedAnnotationCount); > } >- domInstances[i] = annotationInstance; >+ return this.annotations = tempAnnotations; > } >- return this.annotations = domInstances; >+ return this.annotations = AnnotationBinding.NoAnnotations; > } > > /** >Index: dom/org/eclipse/jdt/core/dom/AnnotationBinding.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AnnotationBinding.java,v >retrieving revision 1.6 >diff -u -r1.6 AnnotationBinding.java >--- dom/org/eclipse/jdt/core/dom/AnnotationBinding.java 19 Dec 2007 16:58:35 -0000 1.6 >+++ dom/org/eclipse/jdt/core/dom/AnnotationBinding.java 20 Feb 2008 07:03:59 -0000 >@@ -42,7 +42,7 @@ > > public ITypeBinding getAnnotationType() { > ITypeBinding typeBinding = this.bindingResolver.getTypeBinding(this.binding.getAnnotationType()); >- if (typeBinding == null || !typeBinding.isAnnotation()) >+ if (typeBinding == null) > return null; > return typeBinding; > } >Index: dom/org/eclipse/jdt/core/dom/PackageBinding.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/PackageBinding.java,v >retrieving revision 1.37 >diff -u -r1.37 PackageBinding.java >--- dom/org/eclipse/jdt/core/dom/PackageBinding.java 26 Mar 2007 17:30:24 -0000 1.37 >+++ dom/org/eclipse/jdt/core/dom/PackageBinding.java 20 Feb 2008 07:04:07 -0000 >@@ -25,6 +25,7 @@ > import org.eclipse.jdt.internal.compiler.env.INameEnvironment; > import org.eclipse.jdt.internal.compiler.env.NameEnvironmentAnswer; > import org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding; >+import org.eclipse.jdt.internal.compiler.lookup.TagBits; > import org.eclipse.jdt.internal.compiler.lookup.TypeConstants; > import org.eclipse.jdt.internal.compiler.util.Util; > import org.eclipse.jdt.internal.core.NameLookup; >@@ -98,9 +99,10 @@ > nameEnvironment.findType(TypeConstants.PACKAGE_INFO_NAME, this.binding.compoundName); > if (answer != null && answer.isBinaryType()) { > IBinaryType type = answer.getBinaryType(); >+ char[][][] missingTypeNames = type.getMissingTypeNames(); > IBinaryAnnotation[] binaryAnnotations = type.getAnnotations(); > org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding[] binaryInstances = >- BinaryTypeBinding.createAnnotations(binaryAnnotations, this.binding.environment); >+ BinaryTypeBinding.createAnnotations(binaryAnnotations, this.binding.environment, missingTypeNames); > org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding[] allInstances = > org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding.addStandardAnnotations(binaryInstances, type.getTagBits(), this.binding.environment); > int total = allInstances.length; >Index: compiler/org/eclipse/jdt/internal/compiler/codegen/AttributeNamesConstants.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/AttributeNamesConstants.java,v >retrieving revision 1.18 >diff -u -r1.18 AttributeNamesConstants.java >--- compiler/org/eclipse/jdt/internal/compiler/codegen/AttributeNamesConstants.java 13 Sep 2007 18:00:48 -0000 1.18 >+++ compiler/org/eclipse/jdt/internal/compiler/codegen/AttributeNamesConstants.java 20 Feb 2008 07:02:56 -0000 >@@ -32,4 +32,5 @@ > final char[] InconsistentHierarchy = "InconsistentHierarchy".toCharArray(); //$NON-NLS-1$ > final char[] VarargsName = "Varargs".toCharArray(); //$NON-NLS-1$ > final char[] StackMapName = "StackMap".toCharArray(); //$NON-NLS-1$ >+ final char[] MissingTypesName = "MissingTypes".toCharArray(); //$NON-NLS-1$ > } >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 20 Feb 2008 07:01:17 -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 20 Feb 2008 07:01:17 -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: 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.80 >diff -u -r1.80 HierarchyResolver.java >--- model/org/eclipse/jdt/internal/core/hierarchy/HierarchyResolver.java 23 Jan 2008 12:42:36 -0000 1.80 >+++ model/org/eclipse/jdt/internal/core/hierarchy/HierarchyResolver.java 20 Feb 2008 07:04:15 -0000 >@@ -343,12 +343,20 @@ > 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) { >- // ensure we are not creating a cycle (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=215681 ) >- if (!(subTypeOfType(superInterface, typeBinding))) { >- interfaceBindings[index++] = superInterface; >+ if (!superInterface.isValidBinding()) { >+ TypeBinding closestMatch = superInterface.closestMatch(); >+ if (closestMatch instanceof ReferenceBinding) { >+ superInterface = (ReferenceBinding) closestMatch; >+ } else { >+ superInterface = null; >+ } >+ } >+ if (superInterface != null) { >+ // ensure we are not creating a cycle (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=215681 ) >+ if (!(subTypeOfType(superInterface, typeBinding))) { >+ interfaceBindings[index++] = superInterface; >+ } > } > } > } >Index: model/org/eclipse/jdt/internal/core/hierarchy/HierarchyBinaryType.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/HierarchyBinaryType.java,v >retrieving revision 1.35 >diff -u -r1.35 HierarchyBinaryType.java >--- model/org/eclipse/jdt/internal/core/hierarchy/HierarchyBinaryType.java 31 Mar 2006 22:13:25 -0000 1.35 >+++ model/org/eclipse/jdt/internal/core/hierarchy/HierarchyBinaryType.java 20 Feb 2008 07:04:13 -0000 >@@ -46,6 +46,12 @@ > CharOperation.replace(this.name, '.', '/'); > } > /** >+ * @see org.eclipse.jdt.internal.compiler.env.IBinaryType >+ */ >+public IBinaryAnnotation[] getAnnotations() { >+ return null; >+} >+/** > * Answer the resolved name of the enclosing type in the > * class file format as specified in section 4.2 of the Java 2 VM spec > * or null if the receiver is a top level type. >@@ -112,6 +118,14 @@ > public IBinaryMethod[] getMethods() { > return null; > } >+ >+/** >+ * @see org.eclipse.jdt.internal.compiler.env.IBinaryType#getMissingTypeNames() >+ */ >+public char[][][] getMissingTypeNames() { >+ return null; >+} >+ > /** > * Answer an int whose bits are set according the access constants > * defined by the VM spec. >@@ -119,6 +133,7 @@ > public int getModifiers() { > return this.modifiers; > } >+ > /** > * Answer the resolved name of the type in the > * class file format as specified in section 4.2 of the Java 2 VM spec. >@@ -132,7 +147,6 @@ > public char[] getSourceName() { > return this.sourceName; > } >- > /** > * Answer the resolved name of the receiver's superclass in the > * class file format as specified in section 4.2 of the Java 2 VM spec >@@ -143,10 +157,14 @@ > public char[] getSuperclassName() { > return this.superclass; > } >+ >+// TODO (jerome) please verify that we don't need the tagbits for the receiver >+public long getTagBits() { >+ return 0; >+} > public boolean isAnonymous() { > return false; // index did not record this information (since unused for hierarchies) > } >- > /** > * Answer whether the receiver contains the resolved binary form > * or the unresolved source form of the type. >@@ -154,6 +172,7 @@ > public boolean isBinaryType() { > return true; > } >+ > public boolean isLocal() { > return false; // index did not record this information (since unused for hierarchies) > } >@@ -192,6 +211,13 @@ > } > } > } >+ >+/** >+ * @see org.eclipse.jdt.internal.compiler.env.IBinaryType >+ */ >+public char[] sourceFileName() { >+ return null; >+} > public String toString() { > StringBuffer buffer = new StringBuffer(); > if (this.modifiers == ClassFileConstants.AccPublic) { >@@ -227,22 +253,4 @@ > } > return buffer.toString(); > } >- >-/** >- * @see org.eclipse.jdt.internal.compiler.env.IBinaryType >- */ >-public IBinaryAnnotation[] getAnnotations() { >- return null; >-} >- >-/** >- * @see org.eclipse.jdt.internal.compiler.env.IBinaryType >- */ >-public char[] sourceFileName() { >- return null; >-} >-// TODO (jerome) please verify that we don't need the tagbits for the receiver >-public long getTagBits() { >- return 0; >-} > } >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 20 Feb 2008 07:01:15 -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 20 Feb 2008 07:01:15 -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: compiler/org/eclipse/jdt/internal/compiler/ClassFile.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ClassFile.java,v >retrieving revision 1.162 >diff -u -r1.162 ClassFile.java >--- compiler/org/eclipse/jdt/internal/compiler/ClassFile.java 23 Jan 2008 02:06:58 -0000 1.162 >+++ compiler/org/eclipse/jdt/internal/compiler/ClassFile.java 20 Feb 2008 07:01:43 -0000 >@@ -18,6 +18,7 @@ > import java.util.Arrays; > import java.util.Comparator; > import java.util.HashSet; >+import java.util.List; > import java.util.Set; > import java.util.StringTokenizer; > >@@ -123,6 +124,9 @@ > public int produceAttributes; > public SourceTypeBinding referenceBinding; > public long targetJDK; >+ >+ public List missingTypes = null; >+ > public static final int INITIAL_CONTENTS_SIZE = 400; > public static final int INITIAL_HEADER_SIZE = 1500; > public static final int INNER_CLASSES_SIZE = 5; >@@ -459,7 +463,7 @@ > contents[methodCountOffset++] = (byte) (methodCount >> 8); > contents[methodCountOffset] = (byte) methodCount; > >- int attributeNumber = 0; >+ int attributesNumber = 0; > // leave two bytes for the number of attributes and store the current offset > int attributeOffset = contentsOffset; > contentsOffset += 2; >@@ -492,7 +496,7 @@ > int fileNameIndex = constantPool.literalIndex(fullFileName.toCharArray()); > contents[contentsOffset++] = (byte) (fileNameIndex >> 8); > contents[contentsOffset++] = (byte) fileNameIndex; >- attributeNumber++; >+ attributesNumber++; > } > // Deprecated attribute > if (referenceBinding.isDeprecated()) { >@@ -510,7 +514,7 @@ > contents[contentsOffset++] = 0; > contents[contentsOffset++] = 0; > contents[contentsOffset++] = 0; >- attributeNumber++; >+ attributesNumber++; > } > // add signature attribute > char[] genericSignature = referenceBinding.genericSignature(); >@@ -533,7 +537,7 @@ > constantPool.literalIndex(genericSignature); > contents[contentsOffset++] = (byte) (signatureIndex >> 8); > contents[contentsOffset++] = (byte) signatureIndex; >- attributeNumber++; >+ attributesNumber++; > } > if (targetJDK >= ClassFileConstants.JDK1_5 > && this.referenceBinding.isNestedType() >@@ -567,19 +571,27 @@ > } > contents[contentsOffset++] = methodIndexByte1; > contents[contentsOffset++] = methodIndexByte2; >- attributeNumber++; >+ attributesNumber++; > } > if (this.targetJDK >= ClassFileConstants.JDK1_5) { > TypeDeclaration typeDeclaration = referenceBinding.scope.referenceContext; > if (typeDeclaration != null) { > final Annotation[] annotations = typeDeclaration.annotations; > if (annotations != null) { >- attributeNumber += generateRuntimeAnnotations(annotations); >+ attributesNumber += generateRuntimeAnnotations(annotations); > } > } > } > > if (this.referenceBinding.isHierarchyInconsistent()) { >+ ReferenceBinding superclass = this.referenceBinding.superclass; >+ if (superclass != null) { >+ this.missingTypes = superclass.collectMissingTypes(this.missingTypes); >+ } >+ ReferenceBinding[] superInterfaces = this.referenceBinding.superInterfaces(); >+ for (int i = 0, max = superInterfaces.length; i < max; i++) { >+ this.missingTypes = superInterfaces[i].collectMissingTypes(this.missingTypes); >+ } > // add an attribute for inconsistent hierarchy > if (contentsOffset + 6 >= contents.length) { > resizeContents(6); >@@ -593,7 +605,7 @@ > contents[contentsOffset++] = 0; > contents[contentsOffset++] = 0; > contents[contentsOffset++] = 0; >- attributeNumber++; >+ attributesNumber++; > } > // Inner class attribute > int numberOfInnerClasses = this.innerClassesBindings == null ? 0 : this.innerClassesBindings.size(); >@@ -662,14 +674,18 @@ > contents[contentsOffset++] = (byte) (accessFlags >> 8); > contents[contentsOffset++] = (byte) accessFlags; > } >- attributeNumber++; >+ attributesNumber++; >+ } >+ if (this.missingTypes != null) { >+ generateMissingTypesAttribute(); >+ attributesNumber++; > } > // update the number of attributes > if (attributeOffset + 2 >= this.contents.length) { > resizeContents(2); > } >- contents[attributeOffset++] = (byte) (attributeNumber >> 8); >- contents[attributeOffset] = (byte) attributeNumber; >+ contents[attributeOffset++] = (byte) (attributesNumber >> 8); >+ contents[attributeOffset] = (byte) attributesNumber; > > // resynchronize all offsets of the classfile > header = constantPool.poolContent; >@@ -838,6 +854,9 @@ > } > } > } >+ if ((fieldBinding.tagBits & TagBits.HasMissingType) != 0) { >+ this.missingTypes = fieldBinding.type.collectMissingTypes(this.missingTypes); >+ } > return attributesNumber; > } > >@@ -880,6 +899,7 @@ > contents[fieldAttributeOffset++] = (byte) (attributeNumber >> 8); > contents[fieldAttributeOffset] = (byte) attributeNumber; > } >+ > /** > * INTERNAL USE-ONLY > * This methods generate all the fields infos for the receiver. >@@ -922,6 +942,7 @@ > } > } > } >+ > private void addMissingAbstractProblemMethod(MethodDeclaration methodDeclaration, MethodBinding methodBinding, CategorizedProblem problem, CompilationResult compilationResult) { > // always clear the strictfp/native/abstract bit for a problem method > generateMethodInfoHeader(methodBinding, methodBinding.modifiers & ~(ClassFileConstants.AccStrictfp | ClassFileConstants.AccNative | ClassFileConstants.AccAbstract)); >@@ -1008,7 +1029,6 @@ > contents[attributeOffset++] = (byte) (attributeNumber >> 8); > contents[attributeOffset] = (byte) attributeNumber; > } >- > /** > * INTERNAL USE-ONLY > * Generate the byte for a problem method info that correspond to a boggus constructor. >@@ -1070,7 +1090,6 @@ > problemLine); > completeMethodInfo(methodAttributeOffset, attributeNumber); > } >- > /** > * INTERNAL USE-ONLY > * Generate the byte for a problem method info that correspond to a boggus constructor. >@@ -1365,6 +1384,7 @@ > contents[methodAttributeOffset++] = (byte) (attributeNumber >> 8); > contents[methodAttributeOffset] = (byte) attributeNumber; > } >+ > /** > * INTERNAL USE-ONLY > * Generate the byte for a problem method info that correspond to a synthetic method that >@@ -6304,32 +6324,7 @@ > contentsOffset = attributeOffset; > } > } >- public int generateMethodInfoAttribute(MethodBinding methodBinding, AnnotationMethodDeclaration declaration) { >- int attributesNumber = generateMethodInfoAttribute(methodBinding); >- int attributeOffset = contentsOffset; >- if ((declaration.modifiers & ClassFileConstants.AccAnnotationDefault) != 0) { >- // add an annotation default attribute >- int annotationDefaultNameIndex = >- constantPool.literalIndex(AttributeNamesConstants.AnnotationDefaultName); >- contents[contentsOffset++] = (byte) (annotationDefaultNameIndex >> 8); >- contents[contentsOffset++] = (byte) annotationDefaultNameIndex; >- int attributeLengthOffset = contentsOffset; >- contentsOffset += 4; >- if (contentsOffset + 4 >= this.contents.length) { >- resizeContents(4); >- } >- generateElementValue(declaration.defaultValue, declaration.binding.returnType, attributeOffset); >- if (contentsOffset != attributeOffset) { >- int attributeLength = contentsOffset - attributeLengthOffset - 4; >- contents[attributeLengthOffset++] = (byte) (attributeLength >> 24); >- contents[attributeLengthOffset++] = (byte) (attributeLength >> 16); >- contents[attributeLengthOffset++] = (byte) (attributeLength >> 8); >- contents[attributeLengthOffset++] = (byte) attributeLength; >- attributesNumber++; >- } >- } >- return attributesNumber; >- } >+ > /** > * INTERNAL USE-ONLY > * That method generates the attributes of a code attribute. >@@ -6483,9 +6478,38 @@ > } > } > } >+ if ((methodBinding.tagBits & TagBits.HasMissingType) != 0) { >+ this.missingTypes = methodBinding.collectMissingTypes(this.missingTypes); >+ } > return attributeNumber; > } > >+ public int generateMethodInfoAttribute(MethodBinding methodBinding, AnnotationMethodDeclaration declaration) { >+ int attributesNumber = generateMethodInfoAttribute(methodBinding); >+ int attributeOffset = contentsOffset; >+ if ((declaration.modifiers & ClassFileConstants.AccAnnotationDefault) != 0) { >+ // add an annotation default attribute >+ int annotationDefaultNameIndex = >+ constantPool.literalIndex(AttributeNamesConstants.AnnotationDefaultName); >+ contents[contentsOffset++] = (byte) (annotationDefaultNameIndex >> 8); >+ contents[contentsOffset++] = (byte) annotationDefaultNameIndex; >+ int attributeLengthOffset = contentsOffset; >+ contentsOffset += 4; >+ if (contentsOffset + 4 >= this.contents.length) { >+ resizeContents(4); >+ } >+ generateElementValue(declaration.defaultValue, declaration.binding.returnType, attributeOffset); >+ if (contentsOffset != attributeOffset) { >+ int attributeLength = contentsOffset - attributeLengthOffset - 4; >+ contents[attributeLengthOffset++] = (byte) (attributeLength >> 24); >+ contents[attributeLengthOffset++] = (byte) (attributeLength >> 16); >+ contents[attributeLengthOffset++] = (byte) (attributeLength >> 8); >+ contents[attributeLengthOffset++] = (byte) attributeLength; >+ attributesNumber++; >+ } >+ } >+ return attributesNumber; >+ } > /** > * INTERNAL USE-ONLY > * That method generates the header of a method info: >@@ -6499,7 +6523,6 @@ > public void generateMethodInfoHeader(MethodBinding methodBinding) { > generateMethodInfoHeader(methodBinding, methodBinding.modifiers); > } >- > /** > * INTERNAL USE-ONLY > * That method generates the header of a method info: >@@ -6535,6 +6558,7 @@ > contents[contentsOffset++] = (byte) (descriptorIndex >> 8); > contents[contentsOffset++] = (byte) descriptorIndex; > } >+ > /** > * INTERNAL USE-ONLY > * That method generates the method info header of a clinit: >@@ -6597,6 +6621,42 @@ > } > } > >+ private void generateMissingTypesAttribute() { >+ int numberOfMissingTypes = this.missingTypes.size(); >+ TypeBinding[] missingTypesArray; >+ this.missingTypes.toArray(missingTypesArray = new TypeBinding[numberOfMissingTypes]); >+ Arrays.sort(missingTypesArray, new Comparator() { >+ public int compare(Object o1, Object o2) { >+ TypeBinding binding1 = (TypeBinding) o1; >+ TypeBinding binding2 = (TypeBinding) o2; >+ return CharOperation.compareTo(binding1.constantPoolName(), binding2.constantPoolName()); >+ } >+ }); >+ int attributeLength = numberOfMissingTypes * 2 + 2; >+ if (this.contentsOffset + attributeLength + 6 >= this.contents.length) { >+ resizeContents(attributeLength + 6); >+ } >+ int missingTypesNameIndex = this.constantPool.literalIndex(AttributeNamesConstants.MissingTypesName); >+ this.contents[this.contentsOffset++] = (byte) (missingTypesNameIndex >> 8); >+ this.contents[this.contentsOffset++] = (byte) missingTypesNameIndex; >+ >+ // generate attribute length >+ this.contents[this.contentsOffset++] = (byte) (attributeLength >> 24); >+ this.contents[this.contentsOffset++] = (byte) (attributeLength >> 16); >+ this.contents[this.contentsOffset++] = (byte) (attributeLength >> 8); >+ this.contents[this.contentsOffset++] = (byte) attributeLength; >+ >+ // generate number of missing types >+ this.contents[this.contentsOffset++] = (byte) (numberOfMissingTypes >> 8); >+ this.contents[this.contentsOffset++] = (byte) numberOfMissingTypes; >+ // generate entry for each missing type >+ for (int i = 0; i < numberOfMissingTypes; i++) { >+ int missingTypeIndex = this.constantPool.literalIndexForType(missingTypesArray[i]); >+ this.contents[this.contentsOffset++] = (byte) (missingTypeIndex >> 8); >+ this.contents[this.contentsOffset++] = (byte) missingTypeIndex; >+ } >+ } >+ > /** > * @param annotations > * @return the number of attributes created while dumping the annotations in the .class file >@@ -6875,6 +6935,67 @@ > return CharOperation.splitOn('/', fileName()); > } > >+ private int getParametersCount(char[] methodSignature) { >+ int i = CharOperation.indexOf('(', methodSignature); >+ i++; >+ char currentCharacter = methodSignature[i]; >+ if (currentCharacter == ')') { >+ return 0; >+ } >+ int result = 0; >+ while (true) { >+ currentCharacter = methodSignature[i]; >+ if (currentCharacter == ')') { >+ return result; >+ } >+ switch (currentCharacter) { >+ case '[': >+ // array type >+ int scanType = scanType(methodSignature, i + 1); >+ result++; >+ i = scanType + 1; >+ break; >+ case 'L': >+ scanType = CharOperation.indexOf(';', methodSignature, >+ i + 1); >+ result++; >+ i = scanType + 1; >+ break; >+ case 'Z': >+ case 'B': >+ case 'C': >+ case 'D': >+ case 'F': >+ case 'I': >+ case 'J': >+ case 'S': >+ result++; >+ i++; >+ break; >+ default: >+ throw new IllegalArgumentException(); >+ } >+ } >+ } >+ >+ private char[] getReturnType(char[] methodSignature) { >+ // skip type parameters >+ int paren = CharOperation.lastIndexOf(')', methodSignature); >+ // there could be thrown exceptions behind, thus scan one type exactly >+ return CharOperation.subarray(methodSignature, paren + 1, >+ methodSignature.length); >+ } >+ >+ >+ private final int i4At(byte[] reference, int relativeOffset, >+ int structOffset) { >+ int position = relativeOffset + structOffset; >+ return ((reference[position++] & 0xFF) << 24) >+ + ((reference[position++] & 0xFF) << 16) >+ + ((reference[position++] & 0xFF) << 8) >+ + (reference[position] & 0xFF); >+ } >+ > protected void initByteArrays() { > int members = referenceBinding.methods().length + referenceBinding.fields().length; > this.header = new byte[INITIAL_HEADER_SIZE]; >@@ -6963,48 +7084,235 @@ > } > } > >+ private void initializeDefaultLocals(StackMapFrame frame, >+ MethodBinding methodBinding, >+ int maxLocals, >+ int codeLength) { >+ if (maxLocals != 0) { >+ int resolvedPosition = 0; >+ // take into account enum constructor synthetic name+ordinal >+ final boolean isConstructor = methodBinding.isConstructor(); >+ if (isConstructor) { >+ LocalVariableBinding localVariableBinding = new LocalVariableBinding("this".toCharArray(), methodBinding.declaringClass, 0, false); //$NON-NLS-1$ >+ localVariableBinding.resolvedPosition = 0; >+ codeStream.record(localVariableBinding); >+ localVariableBinding.recordInitializationStartPC(0); >+ localVariableBinding.recordInitializationEndPC(codeLength); >+ frame.putLocal(resolvedPosition, new VerificationTypeInfo( >+ VerificationTypeInfo.ITEM_UNINITIALIZED_THIS, >+ methodBinding.declaringClass)); >+ resolvedPosition++; >+ } else if (!methodBinding.isStatic()) { >+ LocalVariableBinding localVariableBinding = new LocalVariableBinding("this".toCharArray(), methodBinding.declaringClass, 0, false); //$NON-NLS-1$ >+ localVariableBinding.resolvedPosition = 0; >+ codeStream.record(localVariableBinding); >+ localVariableBinding.recordInitializationStartPC(0); >+ localVariableBinding.recordInitializationEndPC(codeLength); >+ frame.putLocal(resolvedPosition, new VerificationTypeInfo( >+ VerificationTypeInfo.ITEM_OBJECT, >+ methodBinding.declaringClass)); >+ resolvedPosition++; >+ } > >- private boolean isRuntimeInvisible(Annotation annotation) { >- final TypeBinding annotationBinding = annotation.resolvedType; >- if (annotationBinding == null) { >- return false; >- } >- long metaTagBits = annotationBinding.getAnnotationTagBits(); // could be forward reference >- if ((metaTagBits & TagBits.AnnotationRetentionMASK) == 0) >- return true; // by default the retention is CLASS >- >- return (metaTagBits & TagBits.AnnotationRetentionMASK) == TagBits.AnnotationClassRetention; >- } >+ if (isConstructor) { >+ if (methodBinding.declaringClass.isEnum()) { >+ LocalVariableBinding localVariableBinding = new LocalVariableBinding(" name".toCharArray(), this.referenceBinding.scope.getJavaLangString(), 0, false); //$NON-NLS-1$ >+ localVariableBinding.resolvedPosition = resolvedPosition; >+ codeStream.record(localVariableBinding); >+ localVariableBinding.recordInitializationStartPC(0); >+ localVariableBinding.recordInitializationEndPC(codeLength); > >- private boolean isRuntimeVisible(Annotation annotation) { >- final TypeBinding annotationBinding = annotation.resolvedType; >- if (annotationBinding == null) { >- return false; >- } >- long metaTagBits = annotationBinding.getAnnotationTagBits(); >- if ((metaTagBits & TagBits.AnnotationRetentionMASK) == 0) >- return false; // by default the retention is CLASS >+ frame.putLocal(resolvedPosition, new VerificationTypeInfo( >+ TypeIds.T_JavaLangString, >+ ConstantPool.JavaLangStringConstantPoolName)); >+ resolvedPosition++; > >- return (metaTagBits & TagBits.AnnotationRetentionMASK) == TagBits.AnnotationRuntimeRetention; >- } >+ localVariableBinding = new LocalVariableBinding(" ordinal".toCharArray(), TypeBinding.INT, 0, false); //$NON-NLS-1$ >+ localVariableBinding.resolvedPosition = resolvedPosition; >+ codeStream.record(localVariableBinding); >+ localVariableBinding.recordInitializationStartPC(0); >+ localVariableBinding.recordInitializationEndPC(codeLength); >+ frame.putLocal(resolvedPosition, new VerificationTypeInfo( >+ TypeBinding.INT)); >+ resolvedPosition++; >+ } > >- /** >- * INTERNAL USE-ONLY >- * Returns the most enclosing classfile of the receiver. This is used know to store the constant pool name >- * for all inner types of the receiver. >- * @return org.eclipse.jdt.internal.compiler.codegen.ClassFile >- */ >- public ClassFile outerMostEnclosingClassFile() { >- ClassFile current = this; >- while (current.enclosingClassFile != null) >- current = current.enclosingClassFile; >- return current; >- } >+ // take into account the synthetic parameters >+ if (methodBinding.declaringClass.isNestedType()) { >+ ReferenceBinding enclosingInstanceTypes[]; >+ if ((enclosingInstanceTypes = methodBinding.declaringClass >+ .syntheticEnclosingInstanceTypes()) != null) { >+ for (int i = 0, max = enclosingInstanceTypes.length; i < max; i++) { >+ // an enclosingInstanceType can only be a reference >+ // binding. It cannot be >+ // LongBinding or DoubleBinding >+ LocalVariableBinding localVariableBinding = new LocalVariableBinding((" enclosingType" + i).toCharArray(), enclosingInstanceTypes[i], 0, false); //$NON-NLS-1$ >+ localVariableBinding.resolvedPosition = resolvedPosition; >+ codeStream.record(localVariableBinding); >+ localVariableBinding.recordInitializationStartPC(0); >+ localVariableBinding.recordInitializationEndPC(codeLength); >+ >+ frame.putLocal(resolvedPosition, >+ new VerificationTypeInfo( >+ enclosingInstanceTypes[i])); >+ resolvedPosition++; >+ } >+ } > >- public void recordInnerClasses(TypeBinding binding) { >- if (this.innerClassesBindings == null) { >- this.innerClassesBindings = new HashSet(INNER_CLASSES_SIZE); >- } >+ TypeBinding[] arguments; >+ if ((arguments = methodBinding.parameters) != null) { >+ for (int i = 0, max = arguments.length; i < max; i++) { >+ final TypeBinding typeBinding = arguments[i]; >+ frame.putLocal(resolvedPosition, >+ new VerificationTypeInfo(typeBinding)); >+ switch (typeBinding.id) { >+ case TypeIds.T_double: >+ case TypeIds.T_long: >+ resolvedPosition += 2; >+ break; >+ default: >+ resolvedPosition++; >+ } >+ } >+ } >+ >+ SyntheticArgumentBinding syntheticArguments[]; >+ if ((syntheticArguments = methodBinding.declaringClass.syntheticOuterLocalVariables()) != null) { >+ for (int i = 0, max = syntheticArguments.length; i < max; i++) { >+ final TypeBinding typeBinding = syntheticArguments[i].type; >+ LocalVariableBinding localVariableBinding = new LocalVariableBinding((" synthetic" + i).toCharArray(), typeBinding, 0, false); //$NON-NLS-1$ >+ localVariableBinding.resolvedPosition = resolvedPosition; >+ codeStream.record(localVariableBinding); >+ localVariableBinding.recordInitializationStartPC(0); >+ localVariableBinding.recordInitializationEndPC(codeLength); >+ >+ frame.putLocal(resolvedPosition, >+ new VerificationTypeInfo(typeBinding)); >+ switch (typeBinding.id) { >+ case TypeIds.T_double: >+ case TypeIds.T_long: >+ resolvedPosition += 2; >+ break; >+ default: >+ resolvedPosition++; >+ } >+ } >+ } >+ } else { >+ TypeBinding[] arguments; >+ if ((arguments = methodBinding.parameters) != null) { >+ for (int i = 0, max = arguments.length; i < max; i++) { >+ final TypeBinding typeBinding = arguments[i]; >+ frame.putLocal(resolvedPosition, >+ new VerificationTypeInfo(typeBinding)); >+ switch (typeBinding.id) { >+ case TypeIds.T_double: >+ case TypeIds.T_long: >+ resolvedPosition += 2; >+ break; >+ default: >+ resolvedPosition++; >+ } >+ } >+ } >+ } >+ } else { >+ TypeBinding[] arguments; >+ if ((arguments = methodBinding.parameters) != null) { >+ for (int i = 0, max = arguments.length; i < max; i++) { >+ final TypeBinding typeBinding = arguments[i]; >+ frame.putLocal(resolvedPosition, >+ new VerificationTypeInfo(typeBinding)); >+ switch (typeBinding.id) { >+ case TypeIds.T_double: >+ case TypeIds.T_long: >+ resolvedPosition += 2; >+ break; >+ default: >+ resolvedPosition++; >+ } >+ } >+ } >+ } >+ } >+ } >+ >+ private void initializeLocals(boolean isStatic, int currentPC, StackMapFrame currentFrame) { >+ VerificationTypeInfo[] locals = currentFrame.locals; >+ int localsLength = locals.length; >+ int i = 0; >+ if (!isStatic) { >+ // we don't want to reset the first local if the method is not static >+ i = 1; >+ } >+ for (; i < localsLength; i++) { >+ locals[i] = null; >+ } >+ i = 0; >+ locals: for (int max = codeStream.allLocalsCounter; i < max; i++) { >+ LocalVariableBinding localVariable = codeStream.locals[i]; >+ if (localVariable == null) continue; >+ int resolvedPosition = localVariable.resolvedPosition; >+ final TypeBinding localVariableTypeBinding = localVariable.type; >+ inits: for (int j = 0; j < localVariable.initializationCount; j++) { >+ int startPC = localVariable.initializationPCs[j << 1]; >+ int endPC = localVariable.initializationPCs[(j << 1) + 1]; >+ if (currentPC < startPC) { >+ continue inits; >+ } else if (currentPC < endPC) { >+ // the current local is an active local >+ if (currentFrame.locals[resolvedPosition] == null) { >+ currentFrame.locals[resolvedPosition] = >+ new VerificationTypeInfo( >+ localVariableTypeBinding); >+ } >+ continue locals; >+ } >+ } >+ } >+ } >+ >+ private boolean isRuntimeInvisible(Annotation annotation) { >+ final TypeBinding annotationBinding = annotation.resolvedType; >+ if (annotationBinding == null) { >+ return false; >+ } >+ long metaTagBits = annotationBinding.getAnnotationTagBits(); // could be forward reference >+ if ((metaTagBits & TagBits.AnnotationRetentionMASK) == 0) >+ return true; // by default the retention is CLASS >+ >+ return (metaTagBits & TagBits.AnnotationRetentionMASK) == TagBits.AnnotationClassRetention; >+ } >+ >+ private boolean isRuntimeVisible(Annotation annotation) { >+ final TypeBinding annotationBinding = annotation.resolvedType; >+ if (annotationBinding == null) { >+ return false; >+ } >+ long metaTagBits = annotationBinding.getAnnotationTagBits(); >+ if ((metaTagBits & TagBits.AnnotationRetentionMASK) == 0) >+ return false; // by default the retention is CLASS >+ >+ return (metaTagBits & TagBits.AnnotationRetentionMASK) == TagBits.AnnotationRuntimeRetention; >+ } >+ >+ /** >+ * INTERNAL USE-ONLY >+ * Returns the most enclosing classfile of the receiver. This is used know to store the constant pool name >+ * for all inner types of the receiver. >+ * @return org.eclipse.jdt.internal.compiler.codegen.ClassFile >+ */ >+ public ClassFile outerMostEnclosingClassFile() { >+ ClassFile current = this; >+ while (current.enclosingClassFile != null) >+ current = current.enclosingClassFile; >+ return current; >+ } >+ >+ public void recordInnerClasses(TypeBinding binding) { >+ if (this.innerClassesBindings == null) { >+ this.innerClassesBindings = new HashSet(INNER_CLASSES_SIZE); >+ } > ReferenceBinding innerClass = (ReferenceBinding) binding; > this.innerClassesBindings.add(innerClass.erasure()); > ReferenceBinding enclosingType = innerClass.enclosingType(); >@@ -7053,6 +7361,47 @@ > System.arraycopy(this.contents, 0, this.contents = new byte[length + toAdd], 0, length); > } > >+ private VerificationTypeInfo retrieveLocal(int currentPC, int resolvedPosition) { >+ for (int i = 0, max = codeStream.allLocalsCounter; i < max; i++) { >+ LocalVariableBinding localVariable = codeStream.locals[i]; >+ if (localVariable == null) continue; >+ if (resolvedPosition == localVariable.resolvedPosition) { >+ inits: for (int j = 0; j < localVariable.initializationCount; j++) { >+ int startPC = localVariable.initializationPCs[j << 1]; >+ int endPC = localVariable.initializationPCs[(j << 1) + 1]; >+ if (currentPC < startPC) { >+ continue inits; >+ } else if (currentPC < endPC) { >+ // the current local is an active local >+ return new VerificationTypeInfo(localVariable.type); >+ } >+ } >+ } >+ } >+ return null; >+ } >+ >+ private int scanType(char[] methodSignature, int index) { >+ switch (methodSignature[index]) { >+ case '[': >+ // array type >+ return scanType(methodSignature, index + 1); >+ case 'L': >+ return CharOperation.indexOf(';', methodSignature, index + 1); >+ case 'Z': >+ case 'B': >+ case 'C': >+ case 'D': >+ case 'F': >+ case 'I': >+ case 'J': >+ case 'S': >+ return index; >+ default: >+ throw new IllegalArgumentException(); >+ } >+ } >+ > /** > * INTERNAL USE-ONLY > * This methods leaves the space for method counts recording. >@@ -8301,229 +8650,12 @@ > } > } > } >- >- private void initializeDefaultLocals(StackMapFrame frame, >- MethodBinding methodBinding, >- int maxLocals, >- int codeLength) { >- if (maxLocals != 0) { >- int resolvedPosition = 0; >- // take into account enum constructor synthetic name+ordinal >- final boolean isConstructor = methodBinding.isConstructor(); >- if (isConstructor) { >- LocalVariableBinding localVariableBinding = new LocalVariableBinding("this".toCharArray(), methodBinding.declaringClass, 0, false); //$NON-NLS-1$ >- localVariableBinding.resolvedPosition = 0; >- codeStream.record(localVariableBinding); >- localVariableBinding.recordInitializationStartPC(0); >- localVariableBinding.recordInitializationEndPC(codeLength); >- frame.putLocal(resolvedPosition, new VerificationTypeInfo( >- VerificationTypeInfo.ITEM_UNINITIALIZED_THIS, >- methodBinding.declaringClass)); >- resolvedPosition++; >- } else if (!methodBinding.isStatic()) { >- LocalVariableBinding localVariableBinding = new LocalVariableBinding("this".toCharArray(), methodBinding.declaringClass, 0, false); //$NON-NLS-1$ >- localVariableBinding.resolvedPosition = 0; >- codeStream.record(localVariableBinding); >- localVariableBinding.recordInitializationStartPC(0); >- localVariableBinding.recordInitializationEndPC(codeLength); >- frame.putLocal(resolvedPosition, new VerificationTypeInfo( >- VerificationTypeInfo.ITEM_OBJECT, >- methodBinding.declaringClass)); >- resolvedPosition++; >- } >- >- if (isConstructor) { >- if (methodBinding.declaringClass.isEnum()) { >- LocalVariableBinding localVariableBinding = new LocalVariableBinding(" name".toCharArray(), this.referenceBinding.scope.getJavaLangString(), 0, false); //$NON-NLS-1$ >- localVariableBinding.resolvedPosition = resolvedPosition; >- codeStream.record(localVariableBinding); >- localVariableBinding.recordInitializationStartPC(0); >- localVariableBinding.recordInitializationEndPC(codeLength); >- >- frame.putLocal(resolvedPosition, new VerificationTypeInfo( >- TypeIds.T_JavaLangString, >- ConstantPool.JavaLangStringConstantPoolName)); >- resolvedPosition++; >- >- localVariableBinding = new LocalVariableBinding(" ordinal".toCharArray(), TypeBinding.INT, 0, false); //$NON-NLS-1$ >- localVariableBinding.resolvedPosition = resolvedPosition; >- codeStream.record(localVariableBinding); >- localVariableBinding.recordInitializationStartPC(0); >- localVariableBinding.recordInitializationEndPC(codeLength); >- frame.putLocal(resolvedPosition, new VerificationTypeInfo( >- TypeBinding.INT)); >- resolvedPosition++; >- } >- >- // take into account the synthetic parameters >- if (methodBinding.declaringClass.isNestedType()) { >- ReferenceBinding enclosingInstanceTypes[]; >- if ((enclosingInstanceTypes = methodBinding.declaringClass >- .syntheticEnclosingInstanceTypes()) != null) { >- for (int i = 0, max = enclosingInstanceTypes.length; i < max; i++) { >- // an enclosingInstanceType can only be a reference >- // binding. It cannot be >- // LongBinding or DoubleBinding >- LocalVariableBinding localVariableBinding = new LocalVariableBinding((" enclosingType" + i).toCharArray(), enclosingInstanceTypes[i], 0, false); //$NON-NLS-1$ >- localVariableBinding.resolvedPosition = resolvedPosition; >- codeStream.record(localVariableBinding); >- localVariableBinding.recordInitializationStartPC(0); >- localVariableBinding.recordInitializationEndPC(codeLength); >- >- frame.putLocal(resolvedPosition, >- new VerificationTypeInfo( >- enclosingInstanceTypes[i])); >- resolvedPosition++; >- } >- } >- >- TypeBinding[] arguments; >- if ((arguments = methodBinding.parameters) != null) { >- for (int i = 0, max = arguments.length; i < max; i++) { >- final TypeBinding typeBinding = arguments[i]; >- frame.putLocal(resolvedPosition, >- new VerificationTypeInfo(typeBinding)); >- switch (typeBinding.id) { >- case TypeIds.T_double: >- case TypeIds.T_long: >- resolvedPosition += 2; >- break; >- default: >- resolvedPosition++; >- } >- } >- } >- >- SyntheticArgumentBinding syntheticArguments[]; >- if ((syntheticArguments = methodBinding.declaringClass.syntheticOuterLocalVariables()) != null) { >- for (int i = 0, max = syntheticArguments.length; i < max; i++) { >- final TypeBinding typeBinding = syntheticArguments[i].type; >- LocalVariableBinding localVariableBinding = new LocalVariableBinding((" synthetic" + i).toCharArray(), typeBinding, 0, false); //$NON-NLS-1$ >- localVariableBinding.resolvedPosition = resolvedPosition; >- codeStream.record(localVariableBinding); >- localVariableBinding.recordInitializationStartPC(0); >- localVariableBinding.recordInitializationEndPC(codeLength); >- >- frame.putLocal(resolvedPosition, >- new VerificationTypeInfo(typeBinding)); >- switch (typeBinding.id) { >- case TypeIds.T_double: >- case TypeIds.T_long: >- resolvedPosition += 2; >- break; >- default: >- resolvedPosition++; >- } >- } >- } >- } else { >- TypeBinding[] arguments; >- if ((arguments = methodBinding.parameters) != null) { >- for (int i = 0, max = arguments.length; i < max; i++) { >- final TypeBinding typeBinding = arguments[i]; >- frame.putLocal(resolvedPosition, >- new VerificationTypeInfo(typeBinding)); >- switch (typeBinding.id) { >- case TypeIds.T_double: >- case TypeIds.T_long: >- resolvedPosition += 2; >- break; >- default: >- resolvedPosition++; >- } >- } >- } >- } >- } else { >- TypeBinding[] arguments; >- if ((arguments = methodBinding.parameters) != null) { >- for (int i = 0, max = arguments.length; i < max; i++) { >- final TypeBinding typeBinding = arguments[i]; >- frame.putLocal(resolvedPosition, >- new VerificationTypeInfo(typeBinding)); >- switch (typeBinding.id) { >- case TypeIds.T_double: >- case TypeIds.T_long: >- resolvedPosition += 2; >- break; >- default: >- resolvedPosition++; >- } >- } >- } >- } >- } >- } >- >- private void initializeLocals(boolean isStatic, int currentPC, StackMapFrame currentFrame) { >- VerificationTypeInfo[] locals = currentFrame.locals; >- int localsLength = locals.length; >- int i = 0; >- if (!isStatic) { >- // we don't want to reset the first local if the method is not static >- i = 1; >- } >- for (; i < localsLength; i++) { >- locals[i] = null; >- } >- i = 0; >- locals: for (int max = codeStream.allLocalsCounter; i < max; i++) { >- LocalVariableBinding localVariable = codeStream.locals[i]; >- if (localVariable == null) continue; >- int resolvedPosition = localVariable.resolvedPosition; >- final TypeBinding localVariableTypeBinding = localVariable.type; >- inits: for (int j = 0; j < localVariable.initializationCount; j++) { >- int startPC = localVariable.initializationPCs[j << 1]; >- int endPC = localVariable.initializationPCs[(j << 1) + 1]; >- if (currentPC < startPC) { >- continue inits; >- } else if (currentPC < endPC) { >- // the current local is an active local >- if (currentFrame.locals[resolvedPosition] == null) { >- currentFrame.locals[resolvedPosition] = >- new VerificationTypeInfo( >- localVariableTypeBinding); >- } >- continue locals; >- } >- } >- } >- } >- >- private VerificationTypeInfo retrieveLocal(int currentPC, int resolvedPosition) { >- for (int i = 0, max = codeStream.allLocalsCounter; i < max; i++) { >- LocalVariableBinding localVariable = codeStream.locals[i]; >- if (localVariable == null) continue; >- if (resolvedPosition == localVariable.resolvedPosition) { >- inits: for (int j = 0; j < localVariable.initializationCount; j++) { >- int startPC = localVariable.initializationPCs[j << 1]; >- int endPC = localVariable.initializationPCs[(j << 1) + 1]; >- if (currentPC < startPC) { >- continue inits; >- } else if (currentPC < endPC) { >- // the current local is an active local >- return new VerificationTypeInfo(localVariable.type); >- } >- } >- } >- } >- return null; >- } > > private final int u1At(byte[] reference, int relativeOffset, > int structOffset) { > return (reference[relativeOffset + structOffset] & 0xFF); > } > >- private final int i4At(byte[] reference, int relativeOffset, >- int structOffset) { >- int position = relativeOffset + structOffset; >- return ((reference[position++] & 0xFF) << 24) >- + ((reference[position++] & 0xFF) << 16) >- + ((reference[position++] & 0xFF) << 8) >- + (reference[position] & 0xFF); >- } >- > private final int u2At(byte[] reference, int relativeOffset, > int structOffset) { > int position = relativeOffset + structOffset; >@@ -8569,76 +8701,4 @@ > } > return outputBuf; > } >- >- private char[] getReturnType(char[] methodSignature) { >- // skip type parameters >- int paren = CharOperation.lastIndexOf(')', methodSignature); >- // there could be thrown exceptions behind, thus scan one type exactly >- return CharOperation.subarray(methodSignature, paren + 1, >- methodSignature.length); >- } >- >- private int getParametersCount(char[] methodSignature) { >- int i = CharOperation.indexOf('(', methodSignature); >- i++; >- char currentCharacter = methodSignature[i]; >- if (currentCharacter == ')') { >- return 0; >- } >- int result = 0; >- while (true) { >- currentCharacter = methodSignature[i]; >- if (currentCharacter == ')') { >- return result; >- } >- switch (currentCharacter) { >- case '[': >- // array type >- int scanType = scanType(methodSignature, i + 1); >- result++; >- i = scanType + 1; >- break; >- case 'L': >- scanType = CharOperation.indexOf(';', methodSignature, >- i + 1); >- result++; >- i = scanType + 1; >- break; >- case 'Z': >- case 'B': >- case 'C': >- case 'D': >- case 'F': >- case 'I': >- case 'J': >- case 'S': >- result++; >- i++; >- break; >- default: >- throw new IllegalArgumentException(); >- } >- } >- } >- >- private int scanType(char[] methodSignature, int index) { >- switch (methodSignature[index]) { >- case '[': >- // array type >- return scanType(methodSignature, index + 1); >- case 'L': >- return CharOperation.indexOf(';', methodSignature, index + 1); >- case 'Z': >- case 'B': >- case 'C': >- case 'D': >- case 'F': >- case 'I': >- case 'J': >- case 'S': >- return index; >- default: >- throw new IllegalArgumentException(); >- } >- } > } >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 20 Feb 2008 07:02:56 -0000 >@@ -24,6 +24,33 @@ > import org.eclipse.jdt.internal.compiler.util.Util; > > public class ClassFileReader extends ClassFileStruct implements IBinaryType { >+ >+ private int accessFlags; >+ private char[] classFileName; >+ private char[] className; >+ private int classNameIndex; >+ private int constantPoolCount; >+ private AnnotationInfo[] annotations; >+ private FieldInfo[] fields; >+ private int fieldsCount; >+ >+ // initialized in case the .class file is a nested type >+ private InnerClassInfo innerInfo; >+ private int innerInfoIndex; >+ private InnerClassInfo[] innerInfos; >+ private char[][] interfaceNames; >+ private int interfacesCount; >+ private MethodInfo[] methods; >+ private int methodsCount; >+ private char[] signature; >+ private char[] sourceName; >+ private char[] sourceFileName; >+ private char[] superclassName; >+ private long tagBits; >+ private long version; >+ private char[] enclosingTypeName; >+ private char[][][] missingTypeNames; >+ > private static String printTypeModifiers(int modifiers) { > java.io.ByteArrayOutputStream out = new java.io.ByteArrayOutputStream(); > java.io.PrintWriter print = new java.io.PrintWriter(out); >@@ -37,34 +64,40 @@ > print.flush(); > return out.toString(); > } >-public static ClassFileReader read(InputStream stream, String fileName) throws ClassFormatException, IOException { >- return read(stream, fileName, false); >-} >+ > public static ClassFileReader read(File file) throws ClassFormatException, IOException { > return read(file, false); > } >-public static ClassFileReader read(InputStream stream, String fileName, boolean fullyInitialize) throws ClassFormatException, IOException { >- byte classFileBytes[] = Util.getInputStreamAsByteArray(stream, -1); >- ClassFileReader classFileReader = new ClassFileReader(classFileBytes, fileName.toCharArray()); >+ >+public static ClassFileReader read(File file, boolean fullyInitialize) throws ClassFormatException, IOException { >+ byte classFileBytes[] = Util.getFileByteContent(file); >+ ClassFileReader classFileReader = new ClassFileReader(classFileBytes, file.getAbsolutePath().toCharArray()); > if (fullyInitialize) { > classFileReader.initialize(); > } > return classFileReader; > } >-public static ClassFileReader read(File file, boolean fullyInitialize) throws ClassFormatException, IOException { >- byte classFileBytes[] = Util.getFileByteContent(file); >- ClassFileReader classFileReader = new ClassFileReader(classFileBytes, file.getAbsolutePath().toCharArray()); >+ >+public static ClassFileReader read(InputStream stream, String fileName) throws ClassFormatException, IOException { >+ return read(stream, fileName, false); >+} >+ >+public static ClassFileReader read(InputStream stream, String fileName, boolean fullyInitialize) throws ClassFormatException, IOException { >+ byte classFileBytes[] = Util.getInputStreamAsByteArray(stream, -1); >+ ClassFileReader classFileReader = new ClassFileReader(classFileBytes, fileName.toCharArray()); > if (fullyInitialize) { > classFileReader.initialize(); > } > return classFileReader; > } >+ > public static ClassFileReader read( > java.util.zip.ZipFile zip, > String filename) > throws ClassFormatException, java.io.IOException { > return read(zip, filename, false); > } >+ > public static ClassFileReader read( > java.util.zip.ZipFile zip, > String filename, >@@ -80,36 +113,14 @@ > } > return classFileReader; > } >+ > public static ClassFileReader read(String fileName) throws ClassFormatException, java.io.IOException { > return read(fileName, false); > } >+ > public static ClassFileReader read(String fileName, boolean fullyInitialize) throws ClassFormatException, java.io.IOException { > return read(new File(fileName), fullyInitialize); > } >- private int accessFlags; >- private char[] classFileName; >- private char[] className; >- private int classNameIndex; >- private int constantPoolCount; >- private AnnotationInfo[] annotations; >- private FieldInfo[] fields; >- private int fieldsCount; >- // initialized in case the .class file is a nested type >- private InnerClassInfo innerInfo; >- private int innerInfoIndex; >- private InnerClassInfo[] innerInfos; >- private char[][] interfaceNames; >- private int interfacesCount; >- private MethodInfo[] methods; >- private int methodsCount; >- private char[] signature; >- private char[] sourceName; >- private char[] sourceFileName; >- private char[] superclassName; >- private long tagBits; >- private long version; >- >- private char[] enclosingTypeName; > > /** > * @param classFileBytes Actual bytes of a .class file >@@ -298,7 +309,7 @@ > } > } > } else if (CharOperation.equals(attributeName, AttributeNamesConstants.InconsistentHierarchy)) { >- this.tagBits |= TagBits.HasInconsistentHierarchy; >+ this.tagBits |= TagBits.HierarchyHasProblems; > } > break; > case 'S' : >@@ -318,7 +329,7 @@ > case 'i' : > if (CharOperation.equals(attributeName, AttributeNamesConstants.SignatureName)) { > utf8Offset = this.constantPoolOffsets[u2At(readOffset + 6)]; >- this.signature = utf8At(utf8Offset + 3, u2At(utf8Offset + 1)); >+ this.signature = utf8At(utf8Offset + 3, u2At(utf8Offset + 1)); > } > } > } >@@ -330,6 +341,22 @@ > decodeAnnotations(readOffset, false); > } > break; >+ case 'M' : >+ if (CharOperation.equals(attributeName, AttributeNamesConstants.MissingTypesName)) { >+ // decode the missing types >+ int missingTypeOffset = readOffset + 6; >+ int numberOfMissingTypes = u2At(missingTypeOffset); >+ if (numberOfMissingTypes != 0) { >+ missingTypeNames = new char[numberOfMissingTypes][][]; >+ missingTypeOffset += 2; >+ for (int j = 0; j < numberOfMissingTypes; j++) { >+ utf8Offset = constantPoolOffsets[u2At(constantPoolOffsets[u2At(missingTypeOffset)] + 1)]; >+ char[] missingTypeConstantPoolName = utf8At(utf8Offset + 3, u2At(utf8Offset + 1)); >+ missingTypeNames[j] = CharOperation.splitOn('/', missingTypeConstantPoolName); >+ missingTypeOffset += 2; >+ } >+ } >+ } > } > readOffset += (6 + u4At(readOffset + 2)); > } >@@ -346,13 +373,14 @@ > } > > /** >- * Answer the receiver's access flags. The value of the access_flags >+ * Answer the receiver's access flags. The value of the access_flags > * item is a mask of modifiers used with class and interface declarations. > * @return int > */ > public int accessFlags() { > return this.accessFlags; > } >+ > private void decodeAnnotations(int offset, boolean runtimeVisible) { > int numberOfAnnotations = u2At(offset + 6); > if (numberOfAnnotations > 0) { >@@ -388,6 +416,14 @@ > } > } > } >+ >+/** >+ * @return the annotations or null if there is none. >+ */ >+public IBinaryAnnotation[] getAnnotations() { >+ return this.annotations; >+} >+ > /** > * Answer the char array that corresponds to the class name of the constant class. > * constantPoolIndex is the index in the constant pool that is a constant class entry. >@@ -399,6 +435,7 @@ > int utf8Offset = this.constantPoolOffsets[u2At(this.constantPoolOffsets[constantPoolIndex] + 1)]; > return utf8At(utf8Offset + 3, u2At(utf8Offset + 1)); > } >+ > /** > * Answer the int array that corresponds to all the offsets of each entry in the constant pool > * >@@ -407,6 +444,7 @@ > public int[] getConstantPoolOffsets() { > return this.constantPoolOffsets; > } >+ > /* > * Answer the resolved compoundName of the enclosing type > * or null if the receiver is a top level type. >@@ -414,6 +452,7 @@ > public char[] getEnclosingTypeName() { > return this.enclosingTypeName; > } >+ > /** > * Answer the receiver's this.fields or null if the array is empty. > * @return org.eclipse.jdt.internal.compiler.api.IBinaryField[] >@@ -421,15 +460,18 @@ > public IBinaryField[] getFields() { > return this.fields; > } >+ > /** > * @see org.eclipse.jdt.internal.compiler.env.IDependent#getFileName() > */ > public char[] getFileName() { > return this.classFileName; > } >+ > public char[] getGenericSignature() { > return this.signature; > } >+ > /** > * Answer the source name if the receiver is a inner type. Return null if it is an anonymous class or if the receiver is a top-level class. > * e.g. >@@ -456,6 +498,7 @@ > return this.innerInfo.getSourceName(); > return null; > } >+ > /** > * Answer the resolved names of the receiver's interfaces in the > * class file format as specified in section 4.2 of the Java 2 VM spec >@@ -525,6 +568,7 @@ > } > return null; > } >+ > /** > * Answer the receiver's this.methods or null if the array is empty. > * @return org.eclipse.jdt.internal.compiler.api.env.IBinaryMethod[] >@@ -532,12 +576,58 @@ > public IBinaryMethod[] getMethods() { > return this.methods; > } >-/** >- * @return the annotations or null if there is none. >- */ >-public IBinaryAnnotation[] getAnnotations() { >- return this.annotations; >+ >+/* >+public static void main(String[] args) throws ClassFormatException, IOException { >+ if (args == null || args.length != 1) { >+ System.err.println("ClassFileReader <filename>"); //$NON-NLS-1$ >+ System.exit(1); >+ } >+ File file = new File(args[0]); >+ ClassFileReader reader = read(file, true); >+ if (reader.annotations != null) { >+ System.err.println(); >+ for (int i = 0; i < reader.annotations.length; i++) >+ System.err.println(reader.annotations[i]); >+ } >+ System.err.print("class "); //$NON-NLS-1$ >+ System.err.print(reader.getName()); >+ char[] superclass = reader.getSuperclassName(); >+ if (superclass != null) { >+ System.err.print(" extends "); //$NON-NLS-1$ >+ System.err.print(superclass); >+ } >+ System.err.println(); >+ char[][] interfaces = reader.getInterfaceNames(); >+ if (interfaces != null && interfaces.length > 0) { >+ System.err.print(" implements "); //$NON-NLS-1$ >+ for (int i = 0; i < interfaces.length; i++) { >+ if (i != 0) System.err.print(", "); //$NON-NLS-1$ >+ System.err.println(interfaces[i]); >+ } >+ } >+ System.err.println(); >+ System.err.println('{'); >+ if (reader.fields != null) { >+ for (int i = 0; i < reader.fields.length; i++) { >+ System.err.println(reader.fields[i]); >+ System.err.println(); >+ } >+ } >+ if (reader.methods != null) { >+ for (int i = 0; i < reader.methods.length; i++) { >+ System.err.println(reader.methods[i]); >+ System.err.println(); >+ } >+ } >+ System.err.println(); >+ System.err.println('}'); > } >+*/ >+public char[][][] getMissingTypeNames() { >+ return this.missingTypeNames; >+} >+ > /** > * Answer an int whose bits are set according the access constants > * defined by the VM spec. >@@ -550,6 +640,7 @@ > } > return this.accessFlags; > } >+ > /** > * Answer the resolved name of the type in the > * class file format as specified in section 4.2 of the Java 2 VM spec. >@@ -560,6 +651,7 @@ > public char[] getName() { > return this.className; > } >+ > public char[] getSourceName() { > if (this.sourceName != null) > return this.sourceName; >@@ -581,6 +673,7 @@ > } > return this.sourceName = name; > } >+ > /** > * Answer the resolved name of the receiver's superclass in the > * class file format as specified in section 4.2 of the Java 2 VM spec >@@ -592,9 +685,11 @@ > public char[] getSuperclassName() { > return this.superclassName; > } >+ > public long getTagBits() { > return this.tagBits; > } >+ > /** > * Answer the major/minor version defined in this class file according to the VM spec. > * as a long: (major<<16)+minor >@@ -603,6 +698,7 @@ > public long getVersion() { > return this.version; > } >+ > private boolean hasNonSyntheticFieldChanges(FieldInfo[] currentFieldInfos, FieldInfo[] otherFieldInfos) { > int length1 = currentFieldInfos == null ? 0 : currentFieldInfos.length; > int length2 = otherFieldInfos == null ? 0 : otherFieldInfos.length; >@@ -628,6 +724,7 @@ > } > return false; > } >+ > private boolean hasNonSyntheticMethodChanges(MethodInfo[] currentMethodInfos, MethodInfo[] otherMethodInfos) { > int length1 = currentMethodInfos == null ? 0 : currentMethodInfos.length; > int length2 = otherMethodInfos == null ? 0 : otherMethodInfos.length; >@@ -654,6 +751,7 @@ > } > return false; > } >+ > /** > * Check if the receiver has structural changes compare to the byte array in argument. > * Structural changes are: >@@ -672,6 +770,7 @@ > public boolean hasStructuralChanges(byte[] newBytes) { > return hasStructuralChanges(newBytes, true, true); > } >+ > /** > * Check if the receiver has structural changes compare to the byte array in argument. > * Structural changes are: >@@ -702,7 +801,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)) >@@ -798,12 +897,14 @@ > return true; > } > } >- >+ >+ // missing types > return false; > } catch (ClassFormatException e) { > return true; > } > } >+ > private boolean hasStructuralFieldChanges(FieldInfo currentFieldInfo, FieldInfo otherFieldInfo) { > // generic signature > if (!CharOperation.equals(currentFieldInfo.getGenericSignature(), otherFieldInfo.getGenericSignature())) >@@ -848,6 +949,7 @@ > } > return false; > } >+ > private boolean hasStructuralMethodChanges(MethodInfo currentMethodInfo, MethodInfo otherMethodInfo) { > // generic signature > if (!CharOperation.equals(currentMethodInfo.getGenericSignature(), otherMethodInfo.getGenericSignature())) >@@ -876,6 +978,7 @@ > } > return false; > } >+ > /** > * This method is used to fully initialize the contents of the receiver. All methodinfos, fields infos > * will be therefore fully initialized and we can get rid of the bytes. >@@ -904,6 +1007,7 @@ > throw exception; > } > } >+ > /** > * Answer true if the receiver is an anonymous type, false otherwise > * >@@ -914,6 +1018,7 @@ > char[] innerSourceName = this.innerInfo.getSourceName(); > return (innerSourceName == null || innerSourceName.length == 0); > } >+ > /** > * Answer whether the receiver contains the resolved binary form > * or the unresolved source form of the type. >@@ -934,6 +1039,7 @@ > char[] innerSourceName = this.innerInfo.getSourceName(); > return (innerSourceName != null && innerSourceName.length > 0); > } >+ > /** > * Answer true if the receiver is a member type, false otherwise > * >@@ -945,6 +1051,7 @@ > char[] innerSourceName = this.innerInfo.getSourceName(); > return (innerSourceName != null && innerSourceName.length > 0); // protection against ill-formed attributes (67600) > } >+ > /** > * Answer true if the receiver is a nested type, false otherwise > * >@@ -953,6 +1060,7 @@ > public boolean isNestedType() { > return this.innerInfo != null; > } >+ > /** > * Answer the source file name attribute. Return null if there is no source file attribute for the receiver. > * >@@ -961,6 +1069,7 @@ > public char[] sourceFileName() { > return this.sourceFileName; > } >+ > public String toString() { > java.io.ByteArrayOutputStream out = new java.io.ByteArrayOutputStream(); > java.io.PrintWriter print = new java.io.PrintWriter(out); >@@ -971,52 +1080,4 @@ > print.flush(); > return out.toString(); > } >- >-/* >-public static void main(String[] args) throws ClassFormatException, IOException { >- if (args == null || args.length != 1) { >- System.err.println("ClassFileReader <filename>"); //$NON-NLS-1$ >- System.exit(1); >- } >- File file = new File(args[0]); >- ClassFileReader reader = read(file, true); >- if (reader.annotations != null) { >- System.err.println(); >- for (int i = 0; i < reader.annotations.length; i++) >- System.err.println(reader.annotations[i]); >- } >- System.err.print("class "); //$NON-NLS-1$ >- System.err.print(reader.getName()); >- char[] superclass = reader.getSuperclassName(); >- if (superclass != null) { >- System.err.print(" extends "); //$NON-NLS-1$ >- System.err.print(superclass); >- } >- System.err.println(); >- char[][] interfaces = reader.getInterfaceNames(); >- if (interfaces != null && interfaces.length > 0) { >- System.err.print(" implements "); //$NON-NLS-1$ >- for (int i = 0; i < interfaces.length; i++) { >- if (i != 0) System.err.print(", "); //$NON-NLS-1$ >- System.err.println(interfaces[i]); >- } >- } >- System.err.println(); >- System.err.println('{'); >- if (reader.fields != null) { >- for (int i = 0; i < reader.fields.length; i++) { >- System.err.println(reader.fields[i]); >- System.err.println(); >- } >- } >- if (reader.methods != null) { >- for (int i = 0; i < reader.methods.length; i++) { >- System.err.println(reader.methods[i]); >- System.err.println(); >- } >- } >- System.err.println(); >- System.err.println('}'); >-} >-*/ > } >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 20 Feb 2008 07:01:15 -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.350 >diff -u -r1.350 CompletionEngine.java >--- codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 7 Jan 2008 09:56:46 -0000 1.350 >+++ codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 20 Feb 2008 07:01:13 -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); > } > >@@ -9400,7 +9422,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); > } >@@ -9421,7 +9443,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: compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties,v >retrieving revision 1.231 >diff -u -r1.231 messages.properties >--- compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties 31 Jan 2008 09:41:15 -0000 1.231 >+++ compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties 20 Feb 2008 07:03:57 -0000 >@@ -99,7 +99,9 @@ > 117 = The static method {1}({2}) from the type {0} should be accessed in a static way > 118 = The method {1}({2}) from the type {0} is never used locally > 119 = The static method {1}({2}) from the type {0} should be accessed directly >+120 = The method {1}({2}) from the type {0} refers to the missing type {3} > >+129 = The constructor {0}({1}) refers to the missing type {2} > 130 = The constructor {0}({1}) is undefined > 131 = The constructor {0}({1}) is not visible > 132 = The constructor {0}({1}) is ambiguous >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.366 >diff -u -r1.366 ProblemReporter.java >--- compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java 7 Jan 2008 14:16:26 -0000 1.366 >+++ compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java 20 Feb 2008 07:03:55 -0000 >@@ -13,6 +13,7 @@ > import java.io.CharConversionException; > import java.io.PrintWriter; > import java.io.StringWriter; >+import java.util.List; > > import org.eclipse.jdt.core.compiler.CategorizedProblem; > import org.eclipse.jdt.core.compiler.CharOperation; >@@ -1797,6 +1798,29 @@ > // reference context. Otherwise, use the other API taking a problem and a compilation result > // as arguments > private void handle( >+ int problemId, >+ String[] problemArguments, >+ int elaborationId, >+ String[] messageArguments, >+ int severity, >+ int problemStartPosition, >+ int problemEndPosition){ >+ this.handle( >+ problemId, >+ problemArguments, >+ elaborationId, >+ messageArguments, >+ severity, >+ problemStartPosition, >+ problemEndPosition, >+ this.referenceContext, >+ this.referenceContext == null ? null : this.referenceContext.compilationResult()); >+ this.referenceContext = null; >+} >+// use this private API when the compilation unit result can be found through the >+// reference context. Otherwise, use the other API taking a problem and a compilation result >+// as arguments >+private void handle( > int problemId, > String[] problemArguments, > String[] messageArguments, >@@ -1853,29 +1877,6 @@ > problemStartPosition, > problemEndPosition); > } >-// use this private API when the compilation unit result can be found through the >-// reference context. Otherwise, use the other API taking a problem and a compilation result >-// as arguments >-private void handle( >- int problemId, >- String[] problemArguments, >- int elaborationId, >- String[] messageArguments, >- int severity, >- int problemStartPosition, >- int problemEndPosition){ >- this.handle( >- problemId, >- problemArguments, >- elaborationId, >- messageArguments, >- severity, >- problemStartPosition, >- problemEndPosition, >- this.referenceContext, >- this.referenceContext == null ? null : this.referenceContext.compilationResult()); >- this.referenceContext = null; >-} > > public void hiddenCatchBlock(ReferenceBinding exceptionType, ASTNode location) { > this.handle( >@@ -2284,6 +2285,14 @@ > qualifiedTypeReference.sourceStart, > qualifiedTypeReference.sourceEnd); > } >+public void illegalUsageOfWildcard(TypeReference wildcard) { >+ this.handle( >+ IProblem.InvalidUsageOfWildcard, >+ NoArgument, >+ NoArgument, >+ wildcard.sourceStart, >+ wildcard.sourceEnd); >+} > public void illegalVararg(Argument argType, AbstractMethodDeclaration methodDecl) { > String[] arguments = new String[] {CharOperation.toString(argType.type.getTypeName()), new String(methodDecl.selector)}; > this.handle( >@@ -2719,7 +2728,7 @@ > methodDecl.returnType.sourceStart, > methodDecl.returnType.sourceEnd); > >-} >+} > public void invalidBreak(ASTNode location) { > this.handle( > IProblem.InvalidBreak, >@@ -2727,7 +2736,7 @@ > NoArgument, > location.sourceStart, > location.sourceEnd); >-} >+} > public void invalidConstructor(Statement statement, MethodBinding targetConstructor) { > boolean insideDefaultConstructor = > (this.referenceContext instanceof ConstructorDeclaration) >@@ -2750,6 +2759,14 @@ > MethodBinding shownConstructor = targetConstructor; > switch (targetConstructor.problemId()) { > case ProblemReasons.NotFound : >+ ProblemMethodBinding problemConstructor = (ProblemMethodBinding) targetConstructor; >+ if (problemConstructor.closestMatch != null) { >+ if ((problemConstructor.closestMatch.tagBits & TagBits.HasMissingType) != 0) { >+ this.missingTypeInConstructor(statement, problemConstructor.closestMatch); >+ return; >+ } >+ } >+ > if (insideDefaultConstructor){ > id = IProblem.UndefinedConstructorInDefaultConstructor; > } else if (insideImplicitConstructorCall){ >@@ -2766,7 +2783,7 @@ > } else { > id = IProblem.NotVisibleConstructor; > } >- ProblemMethodBinding problemConstructor = (ProblemMethodBinding) targetConstructor; >+ problemConstructor = (ProblemMethodBinding) targetConstructor; > if (problemConstructor.closestMatch != null) { > shownConstructor = problemConstructor.closestMatch.original(); > } >@@ -2963,6 +2980,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()) >@@ -3023,6 +3049,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 : >@@ -3050,8 +3085,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; >@@ -3098,7 +3133,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; >@@ -3131,7 +3175,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 : >@@ -3146,6 +3190,7 @@ > nameRef.sourceStart, > (int) nameRef.sourcePositions[index]); > } >+ > public void invalidFileNameForPackageAnnotations(Annotation annotation) { > this.handle( > IProblem.InvalidFileNameForPackageAnnotations, >@@ -3162,10 +3207,23 @@ > 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) { > shownMethod = problemMethod.closestMatch; >+ if ((shownMethod.tagBits & TagBits.HasMissingType) != 0) { >+ this.missingTypeInMethod(messageSend, shownMethod); >+ return; >+ } > String closestParameterTypeNames = typesAsString(shownMethod.isVarargs(), shownMethod.parameters, false); > String parameterTypeNames = typesAsString(false, problemMethod.parameters, false); > String closestParameterTypeShortNames = typesAsString(shownMethod.isVarargs(), shownMethod.parameters, true); >@@ -3211,8 +3269,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; >@@ -3326,7 +3384,6 @@ > needImplementation(messageSend); // want to fail to see why we were here... > break; > } >- > this.handle( > id, > new String[] { >@@ -3338,7 +3395,6 @@ > (int) (messageSend.nameSourcePosition >>> 32), > (int) messageSend.nameSourcePosition); > } >- > public void invalidNullToSynchronize(Expression expression) { > this.handle( > IProblem.InvalidNullToSynchronized, >@@ -3468,8 +3524,14 @@ > } else if (location instanceof ArrayQualifiedTypeReference) { > ArrayQualifiedTypeReference arrayQualifiedTypeReference = (ArrayQualifiedTypeReference) location; > if (isRecoveredName(arrayQualifiedTypeReference.tokens)) return; >- long[] positions = arrayQualifiedTypeReference.sourcePositions; >- end = (int) positions[positions.length - 1]; >+ TypeBinding leafType = type.leafComponentType(); >+ if (leafType instanceof ReferenceBinding) { >+ char[][] name = ((ReferenceBinding) leafType).compoundName; // problem type will tell how much got resolved >+ end = (int) arrayQualifiedTypeReference.sourcePositions[name.length-1]; >+ } else { >+ long[] positions = arrayQualifiedTypeReference.sourcePositions; >+ end = (int) positions[positions.length - 1]; >+ } > } else if (location instanceof QualifiedTypeReference) { > QualifiedTypeReference ref = (QualifiedTypeReference) location; > if (isRecoveredName(ref.tokens)) return; >@@ -3621,14 +3683,6 @@ > argument.type.sourceStart, > argument.sourceEnd); > } >-public void illegalUsageOfWildcard(TypeReference wildcard) { >- this.handle( >- IProblem.InvalidUsageOfWildcard, >- NoArgument, >- NoArgument, >- wildcard.sourceStart, >- wildcard.sourceEnd); >-} > public void isClassPathCorrect(char[][] wellKnownTypeName, CompilationUnitDeclaration compUnitDecl, Object location) { > this.referenceContext = compUnitDecl; > String[] arguments = new String[] {CharOperation.toString(wellKnownTypeName)}; >@@ -3724,18 +3778,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; >@@ -4503,15 +4558,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) { >@@ -4526,6 +4585,7 @@ > } > return true; > } >+ > private String javadocVisibilityArgument(int visibility, int modifiers) { > String argument = null; > switch (modifiers & ExtraCompilerModifiers.AccVisibilityMASK) { >@@ -4550,6 +4610,7 @@ > } > return argument; > } >+ > public void localVariableHiding(LocalDeclaration local, Binding hiddenVariable, boolean isSpecialArgHidingField) { > if (hiddenVariable instanceof LocalVariableBinding) { > int id = (local instanceof Argument) >@@ -4584,6 +4645,7 @@ > local.sourceEnd); > } > } >+ > public void localVariableNonNullComparedToNull(LocalVariableBinding local, ASTNode location) { > int severity = computeSeverity(IProblem.NonNullLocalVariableComparisonYieldsFalse); > if (severity == ProblemSeverities.Ignore) return; >@@ -4596,6 +4658,7 @@ > nodeSourceStart(local, location), > nodeSourceEnd(local, location)); > } >+ > public void localVariableNullComparedToNonNull(LocalVariableBinding local, ASTNode location) { > int severity = computeSeverity(IProblem.NullLocalVariableComparisonYieldsFalse); > if (severity == ProblemSeverities.Ignore) return; >@@ -4608,6 +4671,7 @@ > nodeSourceStart(local, location), > nodeSourceEnd(local, location)); > } >+ > public void localVariableNullInstanceof(LocalVariableBinding local, ASTNode location) { > int severity = computeSeverity(IProblem.NullLocalVariableInstanceofYieldsFalse); > if (severity == ProblemSeverities.Ignore) return; >@@ -4620,6 +4684,7 @@ > nodeSourceStart(local, location), > nodeSourceEnd(local, location)); > } >+ > public void localVariableNullReference(LocalVariableBinding local, ASTNode location) { > int severity = computeSeverity(IProblem.NullLocalVariableReference); > if (severity == ProblemSeverities.Ignore) return; >@@ -4632,6 +4697,7 @@ > nodeSourceStart(local, location), > nodeSourceEnd(local, location)); > } >+ > public void localVariablePotentialNullReference(LocalVariableBinding local, ASTNode location) { > int severity = computeSeverity(IProblem.PotentialNullLocalVariableReference); > if (severity == ProblemSeverities.Ignore) return; >@@ -4644,6 +4710,7 @@ > nodeSourceStart(local, location), > nodeSourceEnd(local, location)); > } >+ > public void localVariableRedundantCheckOnNonNull(LocalVariableBinding local, ASTNode location) { > int severity = computeSeverity(IProblem.RedundantNullCheckOnNonNullLocalVariable); > if (severity == ProblemSeverities.Ignore) return; >@@ -4656,6 +4723,7 @@ > nodeSourceStart(local, location), > nodeSourceEnd(local, location)); > } >+ > public void localVariableRedundantCheckOnNull(LocalVariableBinding local, ASTNode location) { > int severity = computeSeverity(IProblem.RedundantNullCheckOnNullLocalVariable); > if (severity == ProblemSeverities.Ignore) return; >@@ -4668,6 +4736,7 @@ > nodeSourceStart(local, location), > nodeSourceEnd(local, location)); > } >+ > public void localVariableRedundantNullAssignment(LocalVariableBinding local, ASTNode location) { > int severity = computeSeverity(IProblem.RedundantLocalVariableNullAssignment); > if (severity == ProblemSeverities.Ignore) return; >@@ -4680,6 +4749,7 @@ > nodeSourceStart(local, location), > nodeSourceEnd(local, location)); > } >+ > public void methodMustOverride(AbstractMethodDeclaration method) { > MethodBinding binding = method.binding; > this.handle( >@@ -4689,6 +4759,7 @@ > method.sourceStart, > method.sourceEnd); > } >+ > public void methodNameClash(MethodBinding currentMethod, MethodBinding inheritedMethod) { > this.handle( > IProblem.MethodNameClash, >@@ -4709,6 +4780,7 @@ > currentMethod.sourceStart(), > currentMethod.sourceEnd()); > } >+ > public void methodNeedBody(AbstractMethodDeclaration methodDecl) { > this.handle( > IProblem.MethodRequiresBody, >@@ -4717,6 +4789,7 @@ > methodDecl.sourceStart, > methodDecl.sourceEnd); > } >+ > public void methodNeedingNoBody(MethodDeclaration methodDecl) { > this.handle( > ((methodDecl.modifiers & ClassFileConstants.AccNative) != 0) ? IProblem.BodyForNativeMethod : IProblem.BodyForAbstractMethod, >@@ -4724,7 +4797,7 @@ > NoArgument, > methodDecl.sourceStart, > methodDecl.sourceEnd); >-} >+} > > public void methodWithConstructorName(MethodDeclaration methodDecl) { > this.handle( >@@ -4734,6 +4807,7 @@ > methodDecl.sourceStart, > methodDecl.sourceEnd); > } >+ > public void missingDeprecatedAnnotationForField(FieldDeclaration field) { > int severity = computeSeverity(IProblem.FieldMissingDeprecatedAnnotation); > if (severity == ProblemSeverities.Ignore) return; >@@ -4745,7 +4819,8 @@ > severity, > nodeSourceStart(binding, field), > nodeSourceEnd(binding, field)); >-} >+} >+ > public void missingDeprecatedAnnotationForMethod(AbstractMethodDeclaration method) { > int severity = computeSeverity(IProblem.MethodMissingDeprecatedAnnotation); > if (severity == ProblemSeverities.Ignore) return; >@@ -4758,6 +4833,7 @@ > method.sourceStart, > method.sourceEnd); > } >+ > public void missingDeprecatedAnnotationForType(TypeDeclaration type) { > int severity = computeSeverity(IProblem.TypeMissingDeprecatedAnnotation); > if (severity == ProblemSeverities.Ignore) return; >@@ -4806,7 +4882,6 @@ > expression.sourceStart, > expression.sourceEnd); > } >- > public void missingSerialVersion(TypeDeclaration typeDecl) { > String[] arguments = new String[] {new String(typeDecl.name)}; > this.handle( >@@ -4816,6 +4891,45 @@ > typeDecl.sourceStart, > typeDecl.sourceEnd); > } >+public void missingTypeInConstructor(ASTNode location, MethodBinding constructor) { >+ List missingTypes = constructor.collectMissingTypes(null); >+ TypeBinding missingType = (TypeBinding) missingTypes.get(0); >+ this.handle( >+ IProblem.MissingTypeInConstructor, >+ new String[] { >+ new String(constructor.declaringClass.readableName()), >+ typesAsString(constructor.isVarargs(), constructor.parameters, false), >+ new String(missingType.readableName()), >+ }, >+ new String[] { >+ new String(constructor.declaringClass.shortReadableName()), >+ typesAsString(constructor.isVarargs(), constructor.parameters, true), >+ new String(missingType.shortReadableName()), >+ }, >+ location.sourceStart, >+ location.sourceEnd); >+} >+ >+public void missingTypeInMethod(MessageSend messageSend, MethodBinding method) { >+ List missingTypes = method.collectMissingTypes(null); >+ TypeBinding missingType = (TypeBinding) missingTypes.get(0); >+ this.handle( >+ IProblem.MissingTypeInMethod, >+ new String[] { >+ new String(method.declaringClass.readableName()), >+ new String(method.selector), >+ typesAsString(method.isVarargs(), method.parameters, false), >+ new String(missingType.readableName()), >+ }, >+ new String[] { >+ new String(method.declaringClass.shortReadableName()), >+ new String(method.selector), >+ typesAsString(method.isVarargs(), method.parameters, true), >+ new String(missingType.shortReadableName()), >+ }, >+ (int) (messageSend.nameSourcePosition >>> 32), >+ (int) messageSend.nameSourcePosition); >+} > public void missingValueForAnnotationMember(Annotation annotation, char[] memberName) { > String memberString = new String(memberName); > this.handle( >@@ -4964,12 +5078,15 @@ > return (int) reference.sourcePositions[index]; > } > } else if (node instanceof ArrayQualifiedTypeReference) { >- ArrayQualifiedTypeReference arrayQualifiedTypeReference = (ArrayQualifiedTypeReference) node; >- int length = arrayQualifiedTypeReference.sourcePositions.length; >- return (int) arrayQualifiedTypeReference.sourcePositions[length - 1]; >+ ArrayQualifiedTypeReference reference = (ArrayQualifiedTypeReference) node; >+ int length = reference.sourcePositions.length; >+ return (int) reference.sourcePositions[length - 1]; > } > return node.sourceEnd; > } >+private int nodeSourceStart(Binding field, ASTNode node) { >+ return nodeSourceStart(field, node, 0); >+} > private int nodeSourceStart(Binding field, ASTNode node, int index) { > if (node instanceof FieldReference) { > FieldReference fieldReference = (FieldReference) node; >@@ -5006,9 +5123,6 @@ > } > return node.sourceStart; > } >-private int nodeSourceStart(Binding field, ASTNode node) { >- return nodeSourceStart(field, node, 0); >-} > public void noMoreAvailableSpaceForArgument(LocalVariableBinding local, ASTNode location) { > String[] arguments = new String[]{ new String(local.name) }; > this.handle( >@@ -5059,9 +5173,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( >@@ -5080,6 +5192,9 @@ > nodeSourceStart(null, location), > nodeSourceEnd(null, location, index)); > } >+public void nonStaticAccessToStaticField(ASTNode location, FieldBinding field) { >+ nonStaticAccessToStaticField(location, field, -1); >+} > public void nonStaticAccessToStaticField(ASTNode location, FieldBinding field, int index) { > int severity = computeSeverity(IProblem.NonStaticAccessToStaticField); > if (severity == ProblemSeverities.Ignore) return; >@@ -5091,9 +5206,6 @@ > nodeSourceStart(field, location, index), > nodeSourceEnd(field, location, index)); > } >-public void nonStaticAccessToStaticField(ASTNode location, FieldBinding field) { >- nonStaticAccessToStaticField(location, field, -1); >-} > public void nonStaticAccessToStaticMethod(ASTNode location, MethodBinding method) { > this.handle( > IProblem.NonStaticAccessToStaticMethod, >@@ -6155,6 +6267,17 @@ > typeDecl.sourceEnd, > compUnitDecl.compilationResult); > } >+public void typeHiding(TypeDeclaration typeDecl, TypeBinding hiddenType) { >+ int severity = computeSeverity(IProblem.TypeHidingType); >+ if (severity == ProblemSeverities.Ignore) return; >+ this.handle( >+ IProblem.TypeHidingType, >+ new String[] { new String(typeDecl.name) , new String(hiddenType.shortReadableName()) }, >+ new String[] { new String(typeDecl.name) , new String(hiddenType.readableName()) }, >+ severity, >+ typeDecl.sourceStart, >+ typeDecl.sourceEnd); >+} > public void typeHiding(TypeDeclaration typeDecl, TypeVariableBinding hiddenTypeParameter) { > int severity = computeSeverity(IProblem.TypeHidingTypeParameterFromType); > if (severity == ProblemSeverities.Ignore) return; >@@ -6191,17 +6314,6 @@ > typeDecl.sourceEnd); > } > } >-public void typeHiding(TypeDeclaration typeDecl, TypeBinding hiddenType) { >- int severity = computeSeverity(IProblem.TypeHidingType); >- if (severity == ProblemSeverities.Ignore) return; >- this.handle( >- IProblem.TypeHidingType, >- new String[] { new String(typeDecl.name) , new String(hiddenType.shortReadableName()) }, >- new String[] { new String(typeDecl.name) , new String(hiddenType.readableName()) }, >- severity, >- typeDecl.sourceStart, >- typeDecl.sourceEnd); >-} > public void typeHiding(TypeParameter typeParam, Binding hidden) { > int severity = computeSeverity(IProblem.TypeParameterHidingType); > if (severity == ProblemSeverities.Ignore) return; >@@ -6214,7 +6326,25 @@ > typeParam.sourceStart, > typeParam.sourceEnd); > } >-public void typeMismatchError(TypeBinding actualType, TypeBinding expectedType, ASTNode location) { >+public void typeMismatchError(TypeBinding actualType, TypeBinding expectedType, ASTNode location, ASTNode expectingLocation) { >+ if (actualType != null && (actualType.tagBits & TagBits.HasMissingType) != 0) { // improve secondary error >+ this.handle( >+ IProblem.UndefinedType, >+ new String[] {new String(actualType.leafComponentType().readableName())}, >+ new String[] {new String(actualType.leafComponentType().shortReadableName())}, >+ location.sourceStart, >+ location.sourceEnd); >+ return; >+ } >+ if (expectingLocation != null && (expectedType.tagBits & TagBits.HasMissingType) != 0) { // improve secondary error >+ this.handle( >+ IProblem.UndefinedType, >+ new String[] {new String(expectedType.leafComponentType().readableName())}, >+ new String[] {new String(expectedType.leafComponentType().shortReadableName())}, >+ expectingLocation.sourceStart, >+ expectingLocation.sourceEnd); >+ return; >+ } > this.handle( > IProblem.TypeMismatch, > new String[] {new String(actualType.readableName()), new String(expectedType.readableName())}, >@@ -6329,15 +6459,6 @@ > location.sourceStart, > location.sourceEnd); > } >-public void unusedWarningToken(Expression token) { >- String[] arguments = new String[] { token.constant.stringValue() }; >- this.handle( >- IProblem.UnusedWarningToken, >- arguments, >- arguments, >- token.sourceStart, >- token.sourceEnd); >-} > public void unhandledWarningToken(Expression token) { > String[] arguments = new String[] { token.constant.stringValue() }; > this.handle( >@@ -6907,6 +7028,15 @@ > typeDecl.sourceStart, > typeDecl.sourceEnd); > } >+public void unusedWarningToken(Expression token) { >+ String[] arguments = new String[] { token.constant.stringValue() }; >+ this.handle( >+ IProblem.UnusedWarningToken, >+ arguments, >+ arguments, >+ token.sourceStart, >+ token.sourceEnd); >+} > public void useAssertAsAnIdentifier(int sourceStart, int sourceEnd) { > this.handle( > IProblem.UseAssertAsAnIdentifier, >Index: compiler/org/eclipse/jdt/core/compiler/IProblem.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java,v >retrieving revision 1.196 >diff -u -r1.196 IProblem.java >--- compiler/org/eclipse/jdt/core/compiler/IProblem.java 8 Nov 2007 16:27:58 -0000 1.196 >+++ compiler/org/eclipse/jdt/core/compiler/IProblem.java 20 Feb 2008 07:01:19 -0000 >@@ -348,12 +348,10 @@ > int IndirectAccessToStaticField = Internal + FieldRelated + 78; > /** @since 3.0 */ > int UnqualifiedFieldAccess = Internal + FieldRelated + 79; >- >- // blank final fields > int FinalFieldAssignment = FieldRelated + 80; > int UninitializedBlankFinalField = FieldRelated + 81; > int DuplicateBlankFinalFieldInitialization = FieldRelated + 82; >- >+ > // variable hiding > /** @since 3.0 */ > int LocalVariableHidingLocalVariable = Internal + 90; >@@ -393,8 +391,12 @@ > int UnusedPrivateMethod = Internal + MethodRelated + 118; > /** @since 3.0 */ > int IndirectAccessToStaticMethod = Internal + MethodRelated + 119; >- >+ /** @since 3.4 */ >+ int MissingTypeInMethod = MethodRelated + 120; >+ > // constructors >+ /** @since 3.4 */ >+ int MissingTypeInConstructor = ConstructorRelated + 129; > int UndefinedConstructor = ConstructorRelated + 130; > int NotVisibleConstructor = ConstructorRelated + 131; > int AmbiguousConstructor = ConstructorRelated + 132; >Index: compiler/org/eclipse/jdt/internal/compiler/env/IBinaryType.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IBinaryType.java,v >retrieving revision 1.28 >diff -u -r1.28 IBinaryType.java >--- compiler/org/eclipse/jdt/internal/compiler/env/IBinaryType.java 27 Apr 2007 15:51:39 -0000 1.28 >+++ compiler/org/eclipse/jdt/internal/compiler/env/IBinaryType.java 20 Feb 2008 07:02:56 -0000 >@@ -72,6 +72,12 @@ > IBinaryMethod[] getMethods(); > > /** >+ * Answer the list of missing type names which were referenced from >+ * the problem classfile. This list is encoded via an extra attribute. >+ */ >+char[][][] getMissingTypeNames(); >+ >+/** > * Answer the resolved name of the type in the > * class file format as specified in section 4.2 of the Java 2 VM spec. > * >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,77 @@ >+/******************************************************************************* >+ * 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 java.util.ArrayList; >+import java.util.List; >+ >+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; >+} >+ >+/** >+ * @see org.eclipse.jdt.internal.compiler.lookup.TypeBinding#collectMissingTypes(java.util.List) >+ */ >+public List collectMissingTypes(List missingTypes) { >+ if (missingTypes == null) { >+ missingTypes = new ArrayList(5); >+ } else if (missingTypes.contains(this)) { >+ return missingTypes; >+ } >+ missingTypes.add(this); >+ return missingTypes; >+} >+ >+/** >+ * 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$ >+ } >+} >#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 20 Feb 2008 07:09:29 -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/SnippetCompletionTests_1_5.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SnippetCompletionTests_1_5.java,v >retrieving revision 1.3 >diff -u -r1.3 SnippetCompletionTests_1_5.java >--- src/org/eclipse/jdt/core/tests/model/SnippetCompletionTests_1_5.java 6 Mar 2007 04:43:19 -0000 1.3 >+++ src/org/eclipse/jdt/core/tests/model/SnippetCompletionTests_1_5.java 20 Feb 2008 07:09:47 -0000 >@@ -61,6 +61,7 @@ > > assertResults( > "foo1[METHOD_REF]{foo1(), Lbug132665.Bug132665;, ()V, foo1, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n"+ >+ "foo2[METHOD_REF]{foo2(), Lbug132665.Bug132665;, ()Lbug132665.Bug132665<? extends java.lang.Object>;, foo2, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n"+ > "foo3[METHOD_REF]{foo3(), Lbug132665.Bug132665;, ()V, foo3, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", > requestor.getResults()); > } >Index: src/org/eclipse/jdt/core/tests/model/CodeCorrectionTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CodeCorrectionTests.java,v >retrieving revision 1.21 >diff -u -r1.21 CodeCorrectionTests.java >--- src/org/eclipse/jdt/core/tests/model/CodeCorrectionTests.java 3 Oct 2006 11:31:47 -0000 1.21 >+++ src/org/eclipse/jdt/core/tests/model/CodeCorrectionTests.java 20 Feb 2008 07:07:21 -0000 >@@ -193,10 +193,7 @@ > ICompilationUnit cu= getCompilationUnit("CodeCorrection", "src", "", "CorrectFieldType3.java"); > IMarker marker = getMarker(cu, "AClassz cannot be resolved to a type"); > assertTrue("Marker not found", marker != null); >- try { >- engine.computeCorrections(marker, null, 0, requestor); >- } catch(CoreException e) { >- } >+ engine.computeCorrections(marker, null, 0, requestor); > > String src = cu.getSource(); > String error = "AClassz"; >@@ -688,13 +685,13 @@ > ""+end, > requestor.getEnds()); > } >-public void testCorrectReturnType1() throws JavaModelException { >+public void testCorrectReturnType1() throws CoreException { > CorrectionEngine engine = new CorrectionEngine(JavaCore.getOptions()); > CodeCorrectionTestsRequestor requestor = new CodeCorrectionTestsRequestor(); > ICompilationUnit cu= getCompilationUnit("CodeCorrection", "src", "", "CorrectReturnType1.java"); >- IMarker[] markers = getMarkers(cu); >- assertTrue("should have one problem",markers.length == 1); >- engine.computeCorrections(markers[0], null, 0, requestor); >+ IMarker marker = getMarker(cu, "aaa.dddz cannot be resolved to a type"); >+ assertTrue("Marker not found", marker != null); >+ engine.computeCorrections(marker, null, 0, requestor); > > String src = cu.getSource(); > String error = "dddz"; >@@ -717,13 +714,14 @@ > end, > requestor.getEnds()); > } >-public void testCorrectReturnType2() throws JavaModelException { >+public void testCorrectReturnType2() throws CoreException { > CorrectionEngine engine = new CorrectionEngine(JavaCore.getOptions()); > CodeCorrectionTestsRequestor requestor = new CodeCorrectionTestsRequestor(); > ICompilationUnit cu= getCompilationUnit("CodeCorrection", "src", "", "CorrectReturnType2.java"); >- IMarker[] markers = getMarkers(cu); >- assertTrue("should have one problem",markers.length == 1); >- engine.computeCorrections(markers[0], null, 0, requestor); >+ IMarker marker = getMarker(cu, "aaa.ddd.AClassz cannot be resolved to a type"); >+ assertTrue("Marker not found", marker != null); >+ >+ engine.computeCorrections(marker, null, 0, requestor); > > String src = cu.getSource(); > String error = "AClassz"; >Index: src/org/eclipse/jdt/core/tests/model/CompletionTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests.java,v >retrieving revision 1.173 >diff -u -r1.173 CompletionTests.java >--- src/org/eclipse/jdt/core/tests/model/CompletionTests.java 7 Jan 2008 09:56:51 -0000 1.173 >+++ src/org/eclipse/jdt/core/tests/model/CompletionTests.java 20 Feb 2008 07:09:04 -0000 >@@ -17155,7 +17155,8 @@ > this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); > > assertResults( >- "bar1[METHOD_REF]{bar1(), Ltest.Test2;, ()Ljava.lang.Object;, bar1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED) + "}", >+ "bar1[METHOD_REF]{bar1(), Ltest.Test2;, ()Ljava.lang.Object;, bar1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED) + "}\n" + >+ "bar2[METHOD_REF]{bar2(), Ltest.Test2;, ()LZork;, bar2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED) + "}", > requestor.getResults()); > } > public void testMethod2() throws JavaModelException { >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.125 >diff -u -r1.125 ReconcilerTests.java >--- src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java 16 Jan 2008 16:59:49 -0000 1.125 >+++ src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java 20 Feb 2008 07:09:47 -0000 >@@ -2206,8 +2206,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"); >@@ -3943,19 +3947,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 20 Feb 2008 07:09:09 -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] EXACT_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] EXACT_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.136 >diff -u -r1.136 ASTConverterTestAST3_2.java >--- src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java 22 Jan 2008 20:07:27 -0000 1.136 >+++ src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java 20 Feb 2008 07:07:19 -0000 >@@ -528,7 +528,9 @@ > assertEquals("wrong size", 2, throwsException.size()); //$NON-NLS-1$ > Name name = (Name) throwsException.get(0); > IBinding binding = name.resolveBinding(); >- assertNull("Got a binding", binding); //$NON-NLS-1$ >+ assertNotNull("No binding", binding); //$NON-NLS-1$ >+ assertEquals("LIOException;", binding.getKey()); >+ assertTrue("Binding should be marked as recovered", binding.isRecovered()); > } > > /** >@@ -6572,7 +6574,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()); >@@ -6593,11 +6596,13 @@ > assertEquals("Wrong size", 1, arguments.size()); > Expression expression2 = (Expression) arguments.get(0); > ITypeBinding typeBinding = expression2.resolveTypeBinding(); >- assertNull("Got a binding", typeBinding); >+ assertNotNull("No binding", typeBinding); >+ assertEquals("LX;.foo(Z)V#z", binding.getKey()); > assertEquals("Not a simple name", ASTNode.SIMPLE_NAME, expression2.getNodeType()); > SimpleName simpleName = (SimpleName) expression2; > IBinding binding2 = simpleName.resolveBinding(); >- assertNull("Got a binding", binding2); >+ assertNotNull("Got a binding", binding2); >+ assertEquals("LX;.foo(Z)V#z", binding2.getKey()); > } finally { > if (workingCopy != null) > workingCopy.discardWorkingCopy(); >@@ -8303,7 +8308,8 @@ > Expression expression = returnStatement.getExpression(); > assertNotNull("No expression", expression); > ITypeBinding binding = expression.resolveTypeBinding(); >- assertNull("No binding", binding); >+ assertNotNull("No binding", binding); >+ assertEquals("LString;", binding.getKey()); > } finally { > deleteProject("P659"); > } >@@ -8727,8 +8733,11 @@ > 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" + >+ "List cannot be resolved to a type\n" + >+ "List cannot be resolved to a type"; >+ assertProblemsSize(unit, 3, expectedError); > node = getASTNode(unit, 0, 0, 0); > assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType()); > VariableDeclarationStatement statement = (VariableDeclarationStatement) node; >@@ -8736,7 +8745,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(); >@@ -8770,7 +8780,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(); >@@ -8816,8 +8827,11 @@ > 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" + >+ "List cannot be resolved to a type\n" + >+ "List cannot be resolved to a type"; >+ assertProblemsSize(unit, 3, expectedError); > node = getASTNode(unit, 0, 0, 0); > assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType()); > VariableDeclarationStatement statement = (VariableDeclarationStatement) node; >@@ -8826,7 +8840,7 @@ > VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0); > IVariableBinding variableBinding = fragment.resolveBinding(); > assertNotNull("No binding", variableBinding); >- assertTrue("Not a recovered binding", variableBinding.isRecovered()); >+ assertFalse("Not a recovered binding", variableBinding.isRecovered()); > ITypeBinding typeBinding = variableBinding.getType(); > assertNotNull("No binding", typeBinding); > assertTrue("Not a recovered binding", typeBinding.isRecovered()); >@@ -8858,8 +8872,11 @@ > 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" + >+ "Cannot invoke add(null) on the array type List[][]\n" + >+ "List cannot be resolved to a type" ; >+ assertProblemsSize(unit, 3, expectedError); > node = getASTNode(unit, 0, 0, 0); > assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType()); > VariableDeclarationStatement statement = (VariableDeclarationStatement) node; >@@ -8868,7 +8885,7 @@ > VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0); > IVariableBinding variableBinding = fragment.resolveBinding(); > assertNotNull("No binding", variableBinding); >- assertTrue("Not a recovered binding", variableBinding.isRecovered()); >+ assertFalse("Unexpected recovered binding", variableBinding.isRecovered()); > ITypeBinding typeBinding = variableBinding.getType(); > assertNotNull("No binding", typeBinding); > assertTrue("Not a recovered binding", typeBinding.isRecovered()); >@@ -8927,8 +8944,11 @@ > 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" + >+ "Cannot invoke add(null) on the array type List[][]\n" + >+ "List cannot be resolved to a type"; >+ assertProblemsSize(unit, 3, 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()); >@@ -8938,7 +8958,7 @@ > VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0); > IVariableBinding variableBinding = fragment.resolveBinding(); > assertNotNull("No binding", variableBinding); >- assertTrue("Not a recovered binding", variableBinding.isRecovered()); >+ assertFalse("Unexpected recovered binding", variableBinding.isRecovered()); > ITypeBinding typeBinding = variableBinding.getType(); > assertNotNull("No binding", typeBinding); > assertTrue("Not a recovered binding", typeBinding.isRecovered()); >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 20 Feb 2008 07:05:47 -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()); > } > > /** >@@ -6954,7 +6955,9 @@ > assertTrue("not a method invocation", expression instanceof MethodInvocation); //$NON-NLS-1$ > MethodInvocation methodInvocation = (MethodInvocation) expression; > ITypeBinding typeBinding = methodInvocation.resolveTypeBinding(); >- assertNull("type binding is not null", typeBinding); //$NON-NLS-1$ >+ assertNotNull("No binding", typeBinding); //$NON-NLS-1$ >+ assertEquals("LList;", typeBinding.getKey()); >+ assertEquals("Ltest0295/Test;.g()LList;", methodInvocation.resolveMethodBinding().getKey()); > } > > >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 20 Feb 2008 07:06:30 -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()); //$NON-NLS-1$ > } > > /** >@@ -7125,7 +7126,8 @@ > assertTrue("not a method invocation", expression instanceof MethodInvocation); //$NON-NLS-1$ > MethodInvocation methodInvocation = (MethodInvocation) expression; > ITypeBinding typeBinding = methodInvocation.resolveTypeBinding(); >- assertNull("type binding is not null", typeBinding); //$NON-NLS-1$ >+ assertNotNull("No binding", typeBinding); //$NON-NLS-1$ >+ assertEquals("LList;", typeBinding.getKey()); > } > > >Index: src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest.java,v >retrieving revision 1.76 >diff -u -r1.76 ASTConverterJavadocTest.java >--- src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest.java 7 Jan 2008 14:16:30 -0000 1.76 >+++ src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest.java 20 Feb 2008 07:05:55 -0000 >@@ -2061,12 +2061,8 @@ > public void testBug54424() throws JavaModelException { > stopOnFailure = false; > String [] unbound = { "tho", >- "from", > "A#getList(int,long,boolean)", > "#getList(Object,java.util.AbstractList)", >- "from", >- "#getList(int from,long tho)", >- "to" > }; > verifyComments("testBug54424"); > if (docCommentSupport.equals(JavaCore.ENABLED)) { >Index: src/org/eclipse/jdt/core/tests/dom/ASTConverterTest2.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTest2.java,v >retrieving revision 1.184 >diff -u -r1.184 ASTConverterTest2.java >--- src/org/eclipse/jdt/core/tests/dom/ASTConverterTest2.java 24 Sep 2007 11:39:33 -0000 1.184 >+++ src/org/eclipse/jdt/core/tests/dom/ASTConverterTest2.java 20 Feb 2008 07:06:48 -0000 >@@ -452,7 +452,8 @@ > assertEquals("wrong size", 2, throwsException.size()); //$NON-NLS-1$ > Name name = (Name) throwsException.get(0); > IBinding binding = name.resolveBinding(); >- assertNull("Got a binding", binding); //$NON-NLS-1$ >+ assertNotNull("No binding", binding); //$NON-NLS-1$ >+ assertEquals("LIOException;", binding.getKey()); > } > > /** >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 20 Feb 2008 07:05:12 -0000 >@@ -2901,10 +2901,11 @@ > "}", > this.workingCopy, > false); >- IBinding binding = ((MethodDeclaration) node).resolveBinding(); >- assertEquals( >- null, >- binding); >+ IMethodBinding methodBinding = ((MethodDeclaration) node).resolveBinding(); >+ assertNotNull("No binding", methodBinding); >+ assertEquals("LX;.foo<T:Ljava/lang/Object;>(LNonExisting;)V", methodBinding.getKey()); >+ assertFalse("Method should not be flagged as recovered", methodBinding.isRecovered()); >+ assertTrue("Method argument type should be flagged as recovered", methodBinding.getParameterTypes()[0].isRecovered()); > } > > /* >@@ -4164,11 +4165,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); >@@ -6914,7 +6916,10 @@ > IBinding binding2 = name.resolveBinding(); > assertNull("Got a binding", binding2); > IAnnotationBinding annotationBinding = annotation.resolveAnnotationBinding(); >- assertNull("Got a binding", annotationBinding); >+ assertNotNull("No binding", annotationBinding); >+ assertEquals("LX;.fXoo)I@LTest;", annotationBinding.getKey()); >+ assertFalse("Annotation should not be flagged as recovered", annotationBinding.isRecovered()); >+ assertTrue("Annotation type should be flagged as recovered", annotationBinding.getAnnotationType().isRecovered()); > } > /* > * https://bugs.eclipse.org/bugs/show_bug.cgi?id=140318 >@@ -7088,7 +7093,11 @@ > MethodDeclaration methodDeclaration = (MethodDeclaration) node; > IMethodBinding methodBinding = methodDeclaration.resolveBinding(); > IAnnotationBinding[] annotations = methodBinding.getAnnotations(); >- assertEquals("Wrong size", 0, annotations.length); >+ assertEquals("Wrong size", 1, annotations.length); >+ assertNotNull("No binding", annotations[0]); >+ assertEquals("LX;.foo()V@LZork;", annotations[0].getKey()); >+ assertFalse("Annotation should not be flagged as recovered", annotations[0].isRecovered()); >+ assertTrue("Annotation type should be flagged as recovered", annotations[0].getAnnotationType().isRecovered()); > } > /* > * https://bugs.eclipse.org/bugs/show_bug.cgi?id=153303 >@@ -7111,7 +7120,11 @@ > TypeDeclaration typeDeclaration = (TypeDeclaration) node; > ITypeBinding typeBinding = typeDeclaration.resolveBinding(); > IAnnotationBinding[] annotations = typeBinding.getAnnotations(); >- assertEquals("Wrong size", 0, annotations.length); >+ assertEquals("Wrong size", 1, annotations.length); >+ assertNotNull("No binding", annotations[0]); >+ assertEquals("LX;@LZork;", annotations[0].getKey()); >+ assertFalse("Annotation should not be flagged as recovered", annotations[0].isRecovered()); >+ assertTrue("Annotation type should be flagged as recovered", annotations[0].getAnnotationType().isRecovered()); > } > /* > * https://bugs.eclipse.org/bugs/show_bug.cgi?id=153303 >@@ -7138,7 +7151,11 @@ > SingleVariableDeclaration singleVariableDeclaration = (SingleVariableDeclaration) parameters.get(0); > IVariableBinding variableBinding = singleVariableDeclaration.resolveBinding(); > IAnnotationBinding[] bindings = variableBinding.getAnnotations(); >- assertEquals("Wrong size", 0, bindings.length); >+ assertEquals("Wrong size", 1, bindings.length); >+ assertNotNull("No binding", bindings[0]); >+ assertEquals("@LZork;", bindings[0].getKey()); >+ assertFalse("Annotation should not be flagged as recovered", bindings[0].isRecovered()); >+ assertTrue("Annotation type should be flagged as recovered", bindings[0].getAnnotationType().isRecovered()); > } > /* > * https://bugs.eclipse.org/bugs/show_bug.cgi?id=153303 >@@ -7551,7 +7568,11 @@ > ITypeBinding typeBinding2 = interfaces[0]; > interfaces = typeBinding2.getInterfaces(); > assertNotNull("No interfaces", interfaces); >- assertEquals("Wrong size", 0, interfaces.length); >+ assertEquals("Wrong size", 1, interfaces.length); >+ assertNotNull("No binding", interfaces[0]); >+ assertEquals("Ltest0235/Zork;", interfaces[0].getKey()); >+ assertFalse("I should not be flagged as recovered", typeBinding2.isRecovered()); >+ assertTrue("Zork should be flagged as recovered", interfaces[0].isRecovered()); > } > /* > * https://bugs.eclipse.org/bugs/show_bug.cgi?id=172633 >@@ -7577,8 +7598,11 @@ > assertNotNull("No binding", typeBinding); > ITypeBinding[] interfaces = typeBinding.getInterfaces(); > assertNotNull("No interfaces", interfaces); >- assertEquals("Wrong size", 1, interfaces.length); >- assertNotNull("Should not be null", interfaces[0]); >+ assertEquals("Wrong size", 2, interfaces.length); >+ assertEquals("Ljava/lang/Runnable;", interfaces[0].getKey()); >+ assertFalse("Runnable should not be flagged as recovered", interfaces[0].isRecovered()); >+ assertEquals("LZork;", interfaces[1].getKey()); >+ assertTrue("Zork should be flagged as recovered", interfaces[1].isRecovered()); > } > > /* >@@ -7606,9 +7630,11 @@ > 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()); >+ assertFalse("#foo() should not be flagged as recovered", methodBindings[1].isRecovered()); >+ assertTrue("Zork should be flagged as recovered", methodBindings[1].getReturnType().isRecovered()); > } > > /* >@@ -9344,7 +9370,11 @@ > TypeDeclaration typeDeclaration = (TypeDeclaration) node; > ITypeBinding typeBinding = typeDeclaration.resolveBinding(); > IAnnotationBinding[] annotations = typeBinding.getAnnotations(); >- assertEquals("wrong size", 1, annotations.length); >+ assertEquals("wrong size", 2, annotations.length); >+ assertEquals("LX;@LInvalid;", annotations[0].getKey()); >+ assertFalse("Annotation should not be flagged as recovered", annotations[0].isRecovered()); >+ assertTrue("Annotation type should be flagged as recovered", annotations[0].getAnnotationType().isRecovered()); >+ assertEquals("LX;@Ljava/lang/Deprecated;", annotations[1].getKey()); > } > > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=190622 >#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 20 Feb 2008 07:10:27 -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/ConformTest.java >=================================================================== >RCS file: /home/cvs/numbat/org.eclipse.jdt.core.tests/Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/ConformTest.java,v >retrieving revision 1.149 >diff -u -r1.149 ConformTest.java >--- Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/ConformTest.java 17 Jan 2008 12:14:14 -0000 1.149 >+++ Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/ConformTest.java 20 Feb 2008 07:10:22 -0000 >@@ -11,19 +11,17 @@ > package org.eclipse.jdt.tests.compiler.regression; > > import java.io.File; >-import java.io.IOException; > import java.util.Hashtable; > import java.util.Map; > > import junit.framework.Test; > > import org.eclipse.jdt.core.ToolFactory; >-import org.eclipse.jdt.core.tests.compiler.regression.*; >+import org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest; > import org.eclipse.jdt.core.tests.util.Util; > import org.eclipse.jdt.core.util.ClassFileBytesDisassembler; > import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; > import org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader; >-import org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException; > import org.eclipse.jdt.internal.compiler.env.IBinaryField; > import org.eclipse.jdt.internal.compiler.env.IBinaryMethod; > import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; >@@ -2214,7 +2212,7 @@ > /* > * PR http://dev.eclipse.org/bugs/show_bug.cgi?id=8697 > */ >-public void test145() { >+public void test145() throws Exception { > this.runConformTest( > new String[] { > "p1/X.java", >@@ -2237,23 +2235,17 @@ > "}\n" > }, > "SUCCESS"); >- try { >- ClassFileReader reader = ClassFileReader.read(OUTPUT_DIR + "/p1/X.class"); >- IBinaryMethod[] methods = reader.getMethods(); >- assertTrue("wrong size", methods.length == 3); >- assertEquals("wrong name", "cancel", new String(methods[1].getSelector())); >- assertEquals("wrong modifiers", 33, methods[1].getModifiers()); >- >- reader = ClassFileReader.read(OUTPUT_DIR + "/p1/X$1.class"); >- methods = reader.getMethods(); >- assertTrue("wrong size", methods.length == 2); >- assertEquals("wrong name", "dispose", new String(methods[1].getSelector())); >- assertEquals("wrong modifiers", 33, methods[1].getModifiers()); >- } catch(IOException e) { >- // ignore >- } catch(ClassFormatException e) { >- // ignore >- } >+ ClassFileReader reader = ClassFileReader.read(OUTPUT_DIR + "/p1/X.class"); >+ IBinaryMethod[] methods = reader.getMethods(); >+ assertTrue("wrong size", methods.length == 3); >+ assertEquals("wrong name", "cancel", new String(methods[1].getSelector())); >+ assertEquals("wrong modifiers", 33, methods[1].getModifiers()); >+ >+ reader = ClassFileReader.read(OUTPUT_DIR + "/p1/X$1.class"); >+ methods = reader.getMethods(); >+ assertTrue("wrong size", methods.length == 2); >+ assertEquals("wrong name", "dispose", new String(methods[1].getSelector())); >+ assertEquals("wrong modifiers", 33, methods[1].getModifiers()); > } > > >@@ -2712,7 +2704,7 @@ > /* > * http://bugs.eclipse.org/bugs/show_bug.cgi?id=15030 > */ >-public void test165() { >+public void test165() throws Exception { > byte[] tab = new byte[295]; > tab[0]=-54; > tab[1]=-2; >@@ -3009,17 +3001,11 @@ > tab[292]=2; > tab[293]=0; > tab[294]=20; >- try { >- ClassFileReader classFileReader = new ClassFileReader(tab, "A.java".toCharArray(), true); >- IBinaryField[] fields = classFileReader.getFields(); >- assertEquals("wrong size", 1, fields.length); >- IBinaryField binaryField = fields[0]; >- assertNotNull(binaryField.getConstant()); >- } catch (ClassFormatException e) { >- assertTrue(false); >- } catch(NullPointerException e) { >- assertTrue(false); >- } >+ ClassFileReader classFileReader = new ClassFileReader(tab, "A.java".toCharArray(), true); >+ IBinaryField[] fields = classFileReader.getFields(); >+ assertEquals("wrong size", 1, fields.length); >+ IBinaryField binaryField = fields[0]; >+ assertNotNull(binaryField.getConstant()); > } > > >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 20 Feb 2008 07:11:34 -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" + >+ "E 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 20 Feb 2008 07:12:49 -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"); > } > /* >Index: Eclipse Java Tests Model/src/org/eclipse/jdt/tests/core/EvaluationTests.java >=================================================================== >RCS file: /home/cvs/numbat/org.eclipse.jdt.core.tests/Eclipse Java Tests Model/src/org/eclipse/jdt/tests/core/EvaluationTests.java,v >retrieving revision 1.28 >diff -u -r1.28 EvaluationTests.java >--- Eclipse Java Tests Model/src/org/eclipse/jdt/tests/core/EvaluationTests.java 6 Mar 2007 04:29:56 -0000 1.28 >+++ Eclipse Java Tests Model/src/org/eclipse/jdt/tests/core/EvaluationTests.java 20 Feb 2008 07:12:49 -0000 >@@ -97,7 +97,7 @@ > } > } > } catch (ClassFormatException e) { >- // ignore >+ e.printStackTrace(); > } > } > } >#P org.eclipse.jdt.core.tests.builder >Index: src/org/eclipse/jdt/core/tests/builder/IncrementalTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/IncrementalTests.java,v >retrieving revision 1.35 >diff -u -r1.35 IncrementalTests.java >--- src/org/eclipse/jdt/core/tests/builder/IncrementalTests.java 20 Dec 2007 16:01:14 -0000 1.35 >+++ src/org/eclipse/jdt/core/tests/builder/IncrementalTests.java 20 Feb 2008 07:13:00 -0000 >@@ -106,8 +106,7 @@ > expectingNoProblems(); > } > >- // TODO excluded test >- public void _testNewJCL() { >+ public void testNewJCL() { > //---------------------------- > // Step 1 > //---------------------------- >@@ -128,7 +127,7 @@ > > > incrementalBuild(); >- expectingSpecificProblemFor(object, new Problem("java.lang", "This compilation unit indirectly references the missing type java.lang.Throwable (typically some required class file is referencing a type outside the classpath)", object, 1, 2, -1, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ >+ expectingNoProblems(); > > //---------------------------- > // Step 3 >@@ -141,8 +140,7 @@ > > > incrementalBuild(); >- expectingSpecificProblemFor(object, new Problem("java.lang", "This compilation unit indirectly references the missing type java.lang.RuntimeException (typically some required class file is referencing a type outside the classpath)", object, 1, 2, -1, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ >- expectingSpecificProblemFor(throwable, new Problem("java.lang", "This compilation unit indirectly references the missing type java.lang.RuntimeException (typically some required class file is referencing a type outside the classpath)", throwable, 1, 2, -1, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ >+ expectingNoProblems(); > } > > /* >@@ -815,4 +813,133 @@ > } > expectingNoProblems(); > } >+ >+ // http://dev.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+ public void testMissingType001() throws JavaModelException { >+ >+ IPath projectPath = env.addProject("Project"); //$NON-NLS-1$ >+ env.addExternalJars(projectPath, Util.getJavaClassLibs()); >+ fullBuild(projectPath); >+ >+ // remove old package fragment root so that names don't collide >+ env.removePackageFragmentRoot(projectPath, ""); //$NON-NLS-1$ >+ >+ IPath root = env.addPackageFragmentRoot(projectPath, "src"); //$NON-NLS-1$ >+ env.setOutputFolder(projectPath, "bin"); //$NON-NLS-1$ >+ >+ IPath xPath = env.addClass(root, "p1", "X", //$NON-NLS-1$ //$NON-NLS-2$ >+ "package p1;\n"+ //$NON-NLS-1$ >+ "public class X {\n"+ //$NON-NLS-1$ >+ " void foo(p2.Y y) { \n" + //$NON-NLS-1$ >+ " y.bar(null);" + //$NON-NLS-1$ >+ " }\n" + //$NON-NLS-1$ >+ " void X() {}\n" + //$NON-NLS-1$ >+ "}\n" //$NON-NLS-1$ >+ ); >+ IPath yPath = env.addClass(root, "p2", "Y", //$NON-NLS-1$ //$NON-NLS-2$ >+ "package p2;\n"+ //$NON-NLS-1$ >+ "public class Y {\n"+ //$NON-NLS-1$ >+ " public void bar(Z z) {}\n" + //$NON-NLS-1$ >+ "}\n" //$NON-NLS-1$ >+ ); >+ fullBuild(projectPath); >+ expectingSpecificProblemFor(xPath, new Problem("X", "This method has a constructor name", xPath, 73, 76, CategorizedProblem.CAT_CODE_STYLE, IMarker.SEVERITY_WARNING)); //$NON-NLS-1$ //$NON-NLS-2$ >+ expectingSpecificProblemFor(yPath, new Problem("Y", "Z cannot be resolved to a type", yPath, 46, 47, CategorizedProblem.CAT_TYPE, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ >+ >+ env.addClass(root, "p2", "Z", //$NON-NLS-1$ //$NON-NLS-2$ >+ "package p2;\n"+ //$NON-NLS-1$ >+ "public class Z {\n"+ //$NON-NLS-1$ >+ "}\n" //$NON-NLS-1$ >+ ); >+ incrementalBuild(projectPath); >+ expectingSpecificProblemFor(xPath, new Problem("X", "This method has a constructor name", xPath, 73, 76, CategorizedProblem.CAT_CODE_STYLE, IMarker.SEVERITY_WARNING)); //$NON-NLS-1$ //$NON-NLS-2$ >+ } >+ >+ // http://dev.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+ public void testMissingType002() throws JavaModelException { >+ >+ IPath projectPath = env.addProject("Project"); //$NON-NLS-1$ >+ env.addExternalJars(projectPath, Util.getJavaClassLibs()); >+ fullBuild(projectPath); >+ >+ // remove old package fragment root so that names don't collide >+ env.removePackageFragmentRoot(projectPath, ""); //$NON-NLS-1$ >+ >+ IPath root = env.addPackageFragmentRoot(projectPath, "src"); //$NON-NLS-1$ >+ env.setOutputFolder(projectPath, "bin"); //$NON-NLS-1$ >+ >+ IPath yPath = env.addClass(root, "p2", "Y", //$NON-NLS-1$ //$NON-NLS-2$ >+ "package p2;\n"+ //$NON-NLS-1$ >+ "public class Y {\n"+ //$NON-NLS-1$ >+ " public void bar(Z z) {}\n" + //$NON-NLS-1$ >+ "}\n" //$NON-NLS-1$ >+ ); >+ fullBuild(projectPath); >+ expectingSpecificProblemFor(yPath, new Problem("Y", "Z cannot be resolved to a type", yPath, 46, 47, CategorizedProblem.CAT_TYPE, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ >+ >+ IPath xPath = env.addClass(root, "p1", "X", //$NON-NLS-1$ //$NON-NLS-2$ >+ "package p1;\n"+ //$NON-NLS-1$ >+ "public class X {\n"+ //$NON-NLS-1$ >+ " void foo(p2.Y y) { \n" + //$NON-NLS-1$ >+ " y.bar(null);" + //$NON-NLS-1$ >+ " }\n" + //$NON-NLS-1$ >+ " void X() {}\n" + //$NON-NLS-1$ >+ "}\n" //$NON-NLS-1$ >+ ); >+ incrementalBuild(projectPath); >+ expectingSpecificProblemFor(xPath, new Problem("X", "This method has a constructor name", xPath, 73, 76, CategorizedProblem.CAT_CODE_STYLE, IMarker.SEVERITY_WARNING)); //$NON-NLS-1$ //$NON-NLS-2$ >+ expectingSpecificProblemFor(yPath, new Problem("Y", "Z cannot be resolved to a type", yPath, 46, 47, CategorizedProblem.CAT_TYPE, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ >+ >+ env.addClass(root, "p2", "Z", //$NON-NLS-1$ //$NON-NLS-2$ >+ "package p2;\n"+ //$NON-NLS-1$ >+ "public class Z {\n"+ //$NON-NLS-1$ >+ "}\n" //$NON-NLS-1$ >+ ); >+ incrementalBuild(projectPath); >+ expectingSpecificProblemFor(xPath, new Problem("X", "This method has a constructor name", xPath, 73, 76, CategorizedProblem.CAT_CODE_STYLE, IMarker.SEVERITY_WARNING)); //$NON-NLS-1$ //$NON-NLS-2$ >+ } >+ >+ // http://dev.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+ public void testMissingType003() throws JavaModelException { >+ >+ IPath projectPath = env.addProject("Project"); //$NON-NLS-1$ >+ env.addExternalJars(projectPath, Util.getJavaClassLibs()); >+ fullBuild(projectPath); >+ >+ // remove old package fragment root so that names don't collide >+ env.removePackageFragmentRoot(projectPath, ""); //$NON-NLS-1$ >+ >+ IPath root = env.addPackageFragmentRoot(projectPath, "src"); //$NON-NLS-1$ >+ env.setOutputFolder(projectPath, "bin"); //$NON-NLS-1$ >+ >+ IPath yPath = env.addClass(root, "p2", "Y", //$NON-NLS-1$ //$NON-NLS-2$ >+ "package p2;\n"+ //$NON-NLS-1$ >+ "public class Y {\n"+ //$NON-NLS-1$ >+ " public void bar(p1.Z z) {}\n" + //$NON-NLS-1$ >+ "}\n" //$NON-NLS-1$ >+ ); >+ fullBuild(projectPath); >+ expectingSpecificProblemFor(yPath, new Problem("Y", "p1 cannot be resolved to a type", yPath, 46, 48, CategorizedProblem.CAT_TYPE, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ >+ >+ IPath xPath = env.addClass(root, "p1", "X", //$NON-NLS-1$ //$NON-NLS-2$ >+ "package p1;\n"+ //$NON-NLS-1$ >+ "public class X {\n"+ //$NON-NLS-1$ >+ " void foo(p2.Y y) { \n" + //$NON-NLS-1$ >+ " y.bar(null);" + //$NON-NLS-1$ >+ " }\n" + //$NON-NLS-1$ >+ " void X() {}\n" + //$NON-NLS-1$ >+ "}\n" //$NON-NLS-1$ >+ ); >+ incrementalBuild(projectPath); >+ expectingSpecificProblemFor(xPath, new Problem("X", "This method has a constructor name", xPath, 73, 76, CategorizedProblem.CAT_CODE_STYLE, IMarker.SEVERITY_WARNING)); //$NON-NLS-1$ //$NON-NLS-2$ >+ expectingSpecificProblemFor(yPath, new Problem("Y", "p1.Z cannot be resolved to a type", yPath, 46, 50, CategorizedProblem.CAT_TYPE, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ >+ >+ env.addClass(root, "p1", "Z", //$NON-NLS-1$ //$NON-NLS-2$ >+ "package p1;\n"+ //$NON-NLS-1$ >+ "public class Z {\n"+ //$NON-NLS-1$ >+ "}\n" //$NON-NLS-1$ >+ ); >+ incrementalBuild(projectPath); >+ expectingSpecificProblemFor(xPath, new Problem("X", "This method has a constructor name", xPath, 73, 76, CategorizedProblem.CAT_CODE_STYLE, IMarker.SEVERITY_WARNING)); //$NON-NLS-1$ //$NON-NLS-2$ >+ } > } >Index: src/org/eclipse/jdt/core/tests/builder/EfficiencyTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/EfficiencyTests.java,v >retrieving revision 1.11 >diff -u -r1.11 EfficiencyTests.java >--- src/org/eclipse/jdt/core/tests/builder/EfficiencyTests.java 29 Mar 2006 03:16:23 -0000 1.11 >+++ src/org/eclipse/jdt/core/tests/builder/EfficiencyTests.java 20 Feb 2008 07:12:55 -0000 >@@ -337,4 +337,44 @@ > expectingCompiledClasses(new String[]{"p1.X", "p1.X$1"}); //$NON-NLS-1$ //$NON-NLS-2$ > expectingCompilingOrder(new String[]{"p1.X", "p1.X$1" }); //$NON-NLS-1$ //$NON-NLS-2$ > } >+ // http://dev.eclipse.org/bugs/show_bug.cgi?id=196200 - variation >+ public void testMissingType001() throws JavaModelException { >+ >+ IPath projectPath = env.addProject("Project"); //$NON-NLS-1$ >+ env.addExternalJars(projectPath, Util.getJavaClassLibs()); >+ fullBuild(projectPath); >+ >+ // remove old package fragment root so that names don't collide >+ env.removePackageFragmentRoot(projectPath, ""); //$NON-NLS-1$ >+ >+ IPath root = env.addPackageFragmentRoot(projectPath, "src"); //$NON-NLS-1$ >+ env.setOutputFolder(projectPath, "bin"); //$NON-NLS-1$ >+ >+ env.addClass(root, "p1", "X", //$NON-NLS-1$ //$NON-NLS-2$ >+ "package p1;\n"+ //$NON-NLS-1$ >+ "public class X {\n"+ //$NON-NLS-1$ >+ " void foo(p2.Y y) { \n" + //$NON-NLS-1$ >+ " y.bar(null);" + //$NON-NLS-1$ >+ " }\n" + //$NON-NLS-1$ >+ "}\n" //$NON-NLS-1$ >+ ); >+ env.addClass(root, "p2", "Y", //$NON-NLS-1$ //$NON-NLS-2$ >+ "package p2;\n"+ //$NON-NLS-1$ >+ "public class Y {\n"+ //$NON-NLS-1$ >+ " public void bar(Z z) {}\n" + //$NON-NLS-1$ >+ "}\n" //$NON-NLS-1$ >+ ); >+ fullBuild(projectPath); >+ >+ env.addClass(root, "p2", "Z", //$NON-NLS-1$ //$NON-NLS-2$ >+ "package p2;\n"+ //$NON-NLS-1$ >+ "public class Z {\n"+ //$NON-NLS-1$ >+ "}\n" //$NON-NLS-1$ >+ ); >+ >+ incrementalBuild(projectPath); >+ >+ expectingCompiledClasses(new String[]{"p1.X", "p2.Y","p2.Z"}); //$NON-NLS-1$ //$NON-NLS-2$ >+ expectingCompilingOrder(new String[]{"p2.Z", "p2.Y", "p1.X" }); //$NON-NLS-1$ //$NON-NLS-2$ >+ } > } >Index: src/org/eclipse/jdt/core/tests/builder/MultiProjectTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/MultiProjectTests.java,v >retrieving revision 1.52 >diff -u -r1.52 MultiProjectTests.java >--- src/org/eclipse/jdt/core/tests/builder/MultiProjectTests.java 28 Sep 2007 18:28:18 -0000 1.52 >+++ src/org/eclipse/jdt/core/tests/builder/MultiProjectTests.java 20 Feb 2008 07:13:18 -0000 >@@ -654,10 +654,11 @@ > expectingCompilingOrder(new String[]{"p2.Y", "p3.Z", "p2.Y"});//$NON-NLS-1$ //$NON-NLS-2$//$NON-NLS-3$ > expectingOnlySpecificProblemFor(p1,new Problem("p1", "A cycle was detected in the build path of project 'P1'", p1, -1, -1, CategorizedProblem.CAT_BUILDPATH, IMarker.SEVERITY_WARNING));//$NON-NLS-1$ //$NON-NLS-2$ > expectingOnlySpecificProblemsFor(p2,new Problem[]{ >+ new Problem("p2", "X cannot be resolved to a type", c2, 87, 88, CategorizedProblem.CAT_TYPE, IMarker.SEVERITY_ERROR),//$NON-NLS-1$ //$NON-NLS-2$ >+ new Problem("p2", "The method foo() from the type Z refers to the missing type X", c2, 93, 96, CategorizedProblem.CAT_MEMBER, IMarker.SEVERITY_ERROR),//$NON-NLS-1$ //$NON-NLS-2$ >+ new Problem("p2", "X cannot be resolved to a type", c2, 104, 105, CategorizedProblem.CAT_TYPE, IMarker.SEVERITY_ERROR),//$NON-NLS-1$ //$NON-NLS-2$ > new Problem("p2", "The import p1 cannot be resolved", c2, 19, 21, CategorizedProblem.CAT_IMPORT, IMarker.SEVERITY_ERROR),//$NON-NLS-1$ //$NON-NLS-2$ > new Problem("p2", "X cannot be resolved to a type", c2, 73, 74, CategorizedProblem.CAT_TYPE, IMarker.SEVERITY_ERROR),//$NON-NLS-1$ //$NON-NLS-2$ >- new Problem("p2", "X cannot be resolved to a type", c2, 87, 88, CategorizedProblem.CAT_TYPE, IMarker.SEVERITY_ERROR),//$NON-NLS-1$ //$NON-NLS-2$ >- new Problem("p2", "The method foo() is undefined for the type Y", c2, 93, 96, CategorizedProblem.CAT_MEMBER, IMarker.SEVERITY_ERROR),//$NON-NLS-1$ //$NON-NLS-2$ > new Problem("p2", "A cycle was detected in the build path of project 'P2'", p2, -1, -1, CategorizedProblem.CAT_BUILDPATH, IMarker.SEVERITY_WARNING)//$NON-NLS-1$ //$NON-NLS-2$ > }); > expectingOnlySpecificProblemsFor(p3,new Problem[]{
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