### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core.tests.compiler Index: src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java,v retrieving revision 1.113 diff -u -r1.113 EnumTest.java --- src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java 6 Dec 2006 03:08:38 -0000 1.113 +++ src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java 5 Feb 2007 15:56:33 -0000 @@ -1405,7 +1405,7 @@ "----------\n" + "1. ERROR in X.java (at line 4)\n" + " super();\n" + - " ^^^^^^^\n" + + " ^^^^^^^^\n" + "Cannot invoke super constructor from enum constructor X()\n" + "----------\n" ); @@ -1759,7 +1759,7 @@ "----------\n" + "3. ERROR in com\\flarion\\test\\b\\MyClass.java (at line 15)\n" + " throw new Exception();\n" + - " ^^^^^^^^^^^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^^^^^^^^^^^\n" + "Unhandled exception type Exception\n" + "----------\n"); } Index: src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_5.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_5.java,v retrieving revision 1.69 diff -u -r1.69 Compliance_1_5.java --- src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_5.java 15 Jan 2007 09:50:22 -0000 1.69 +++ src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_5.java 5 Feb 2007 15:56:33 -0000 @@ -117,7 +117,7 @@ "----------\n" + "2. ERROR in p1\\X.java (at line 5)\n" + " while (false) System.out.println(\"unreachable\"); \n" + - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "Unreachable code\n" + "----------\n" + "3. ERROR in p1\\X.java (at line 8)\n" + @@ -127,7 +127,7 @@ "----------\n" + "4. ERROR in p1\\X.java (at line 9)\n" + " for (;false;) System.out.println(\"unreachable\"); \n" + - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "Unreachable code\n" + "----------\n" ); @@ -2189,12 +2189,12 @@ "----------\n" + "1. ERROR in X.java (at line 11)\n" + " super(null); //1\n" + - " ^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^\n" + "No enclosing instance of type X is available due to some intermediate constructor invocation\n" + "----------\n" + "2. ERROR in X.java (at line 14)\n" + " super(new M());//2\n" + - " ^^^^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^^^^\n" + "No enclosing instance of type X is available due to some intermediate constructor invocation\n" + "----------\n" + "3. ERROR in X.java (at line 14)\n" + @@ -2229,7 +2229,7 @@ "----------\n" + "1. ERROR in X.java (at line 8)\n" + " super(); // ko\n" + - " ^^^^^^^\n" + + " ^^^^^^^^\n" + "No enclosing instance of type X is available due to some intermediate constructor invocation\n" + "----------\n"); } @@ -2262,7 +2262,7 @@ "----------\n" + "1. ERROR in X.java (at line 8)\n" + " super(new MX4()); // ko\n" + - " ^^^^^^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^^^^^^\n" + "No enclosing instance of type X is available due to some intermediate constructor invocation\n" + "----------\n" + "2. ERROR in X.java (at line 8)\n" + Index: src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java,v retrieving revision 1.593 diff -u -r1.593 GenericTypeTest.java --- src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java 2 Feb 2007 17:49:10 -0000 1.593 +++ src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java 5 Feb 2007 15:56:36 -0000 @@ -5880,7 +5880,7 @@ "----------\n" + "1. ERROR in X.java (at line 8)\n" + " super(\"FAILED\");\n" + - " ^^^^^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^^^^^\n" + "Incorrect number of type arguments for generic constructor X(T) of type X; it cannot be parameterized with arguments \n" + "----------\n"); } @@ -5906,7 +5906,7 @@ "----------\n" + "1. ERROR in X.java (at line 8)\n" + " super(\"FAILED\");\n" + - " ^^^^^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^^^^^\n" + "The constructor X(String) of type X is not generic; it cannot be parameterized with arguments \n" + "----------\n"); } @@ -5931,7 +5931,7 @@ "----------\n" + "1. ERROR in X.java (at line 8)\n" + " super(new X(null));\n" + - " ^^^^^^^^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^^^^^^^^\n" + "The parameterized constructor X(String) of type X is not applicable for the arguments (X)\n" + "----------\n"); } Index: src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_3.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_3.java,v retrieving revision 1.26 diff -u -r1.26 JavadocTest_1_3.java --- src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_3.java 17 Nov 2006 16:11:36 -0000 1.26 +++ src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_3.java 5 Feb 2007 15:56:37 -0000 @@ -1460,7 +1460,7 @@ "----------\n" + "5. ERROR in X.java (at line 6)\n" + " X(Exception exc) { super(exc);}\n" + - " ^^^^^^^^^^\n" + + " ^^^^^^^^^^^\n" + "The constructor Object(Exception) is undefined\n" + "----------\n" + "6. ERROR in X.java (at line 8)\n" + @@ -1628,7 +1628,7 @@ "----------\n" + "12. ERROR in Test.java (at line 19)\n" + " Sub (E e) {super(null);}\n" + - " ^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^\n" + "The constructor Object(null) is undefined\n" + "----------\n" + "13. ERROR in Test.java (at line 20)\n" + @@ -1717,7 +1717,7 @@ "----------\n" + "10. ERROR in Test.java (at line 19)\n" + " Sub (E e) {super(null);}\n" + - " ^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^\n" + "The constructor Object(null) is undefined\n" + "----------\n" + "11. ERROR in Test.java (at line 20)\n" + @@ -1803,7 +1803,7 @@ "----------\n" + "10. ERROR in Test.java (at line 16)\n" + " Sub (E e) {super(null);}\n" + - " ^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^\n" + "The constructor Object(null) is undefined\n" + "----------\n" + "11. ERROR in Test.java (at line 17)\n" + @@ -1910,7 +1910,7 @@ "----------\n" + "10. ERROR in Test.java (at line 16)\n" + " Sub (E e) {super(null);}\n" + - " ^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^\n" + "The constructor Object(null) is undefined\n" + "----------\n" + "11. ERROR in Test.java (at line 17)\n" + @@ -2017,7 +2017,7 @@ "----------\n" + "10. ERROR in Test.java (at line 16)\n" + " Sub (E e) {super(null);}\n" + - " ^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^\n" + "The constructor Object(null) is undefined\n" + "----------\n" + "11. ERROR in Test.java (at line 17)\n" + @@ -2123,7 +2123,7 @@ "----------\n" + "10. ERROR in Test.java (at line 15)\r\n" + " Sub (E e) {super(null);}\r\n" + - " ^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^\n" + "The constructor Object(null) is undefined\n" + "----------\n" + "11. ERROR in Test.java (at line 16)\r\n" + @@ -2231,7 +2231,7 @@ "----------\n" + "10. ERROR in Test.java (at line 17)\n" + " Sub (E e) {super(null);}\n" + - " ^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^\n" + "The constructor Object(null) is undefined\n" + "----------\n" + "11. ERROR in Test.java (at line 18)\n" + @@ -2329,7 +2329,7 @@ "----------\n" + "9. ERROR in Test.java (at line 18)\n" + " Sub (E e) {super(null);}\n" + - " ^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^\n" + "The constructor Object(null) is undefined\n" + "----------\n" + "10. ERROR in Test.java (at line 19)\n" + Index: src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_4.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_4.java,v retrieving revision 1.90 diff -u -r1.90 Compliance_1_4.java --- src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_4.java 15 Jan 2007 09:50:22 -0000 1.90 +++ src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_4.java 5 Feb 2007 15:56:33 -0000 @@ -115,7 +115,7 @@ "----------\n" + "2. ERROR in p1\\X.java (at line 5)\n" + " while (false) System.out.println(\"unreachable\"); \n" + - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "Unreachable code\n" + "----------\n" + "3. ERROR in p1\\X.java (at line 8)\n" + @@ -125,7 +125,7 @@ "----------\n" + "4. ERROR in p1\\X.java (at line 9)\n" + " for (;false;) System.out.println(\"unreachable\"); \n" + - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "Unreachable code\n" + "----------\n" ); @@ -2163,12 +2163,12 @@ "----------\n" + "1. ERROR in X.java (at line 11)\n" + " super(null); //1\n" + - " ^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^\n" + "No enclosing instance of type X is available due to some intermediate constructor invocation\n" + "----------\n" + "2. ERROR in X.java (at line 14)\n" + " super(new M());//2\n" + - " ^^^^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^^^^\n" + "No enclosing instance of type X is available due to some intermediate constructor invocation\n" + "----------\n" + "3. ERROR in X.java (at line 14)\n" + @@ -2203,7 +2203,7 @@ "----------\n" + "1. ERROR in X.java (at line 8)\n" + " super(); // ko\n" + - " ^^^^^^^\n" + + " ^^^^^^^^\n" + "No enclosing instance of type X is available due to some intermediate constructor invocation\n" + "----------\n"); } @@ -2236,7 +2236,7 @@ "----------\n" + "1. ERROR in X.java (at line 8)\n" + " super(new MX4()); // ko\n" + - " ^^^^^^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^^^^^^\n" + "No enclosing instance of type X is available due to some intermediate constructor invocation\n" + "----------\n" + "2. ERROR in X.java (at line 8)\n" + 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.29 diff -u -r1.29 JavadocTest_1_4.java --- src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_4.java 17 Nov 2006 16:11:36 -0000 1.29 +++ src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_4.java 5 Feb 2007 15:56:37 -0000 @@ -1461,7 +1461,7 @@ "----------\n" + "5. ERROR in X.java (at line 6)\n" + " X(Exception exc) { super(exc);}\n" + - " ^^^^^^^^^^\n" + + " ^^^^^^^^^^^\n" + "The constructor Object(Exception) is undefined\n" + "----------\n" + "6. ERROR in X.java (at line 8)\n" + @@ -1630,7 +1630,7 @@ "----------\n" + "12. ERROR in Test.java (at line 19)\n" + " Sub (E e) {super(null);}\n" + - " ^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^\n" + "The constructor Object(null) is undefined\n" + "----------\n" + "13. ERROR in Test.java (at line 20)\n" + @@ -1719,7 +1719,7 @@ "----------\n" + "10. ERROR in Test.java (at line 19)\n" + " Sub (E e) {super(null);}\n" + - " ^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^\n" + "The constructor Object(null) is undefined\n" + "----------\n" + "11. ERROR in Test.java (at line 20)\n" + @@ -1805,7 +1805,7 @@ "----------\n" + "10. ERROR in Test.java (at line 16)\n" + " Sub (E e) {super(null);}\n" + - " ^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^\n" + "The constructor Object(null) is undefined\n" + "----------\n" + "11. ERROR in Test.java (at line 17)\n" + @@ -1912,7 +1912,7 @@ "----------\n" + "10. ERROR in Test.java (at line 16)\n" + " Sub (E e) {super(null);}\n" + - " ^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^\n" + "The constructor Object(null) is undefined\n" + "----------\n" + "11. ERROR in Test.java (at line 17)\n" + @@ -2019,7 +2019,7 @@ "----------\n" + "10. ERROR in Test.java (at line 16)\n" + " Sub (E e) {super(null);}\n" + - " ^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^\n" + "The constructor Object(null) is undefined\n" + "----------\n" + "11. ERROR in Test.java (at line 17)\n" + @@ -2125,7 +2125,7 @@ "----------\n" + "10. ERROR in Test.java (at line 15)\r\n" + " Sub (E e) {super(null);}\r\n" + - " ^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^\n" + "The constructor Object(null) is undefined\n" + "----------\n" + "11. ERROR in Test.java (at line 16)\r\n" + @@ -2233,7 +2233,7 @@ "----------\n" + "10. ERROR in Test.java (at line 17)\n" + " Sub (E e) {super(null);}\n" + - " ^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^\n" + "The constructor Object(null) is undefined\n" + "----------\n" + "11. ERROR in Test.java (at line 18)\n" + @@ -2331,7 +2331,7 @@ "----------\n" + "9. ERROR in Test.java (at line 18)\n" + " Sub (E e) {super(null);}\n" + - " ^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^\n" + "The constructor Object(null) is undefined\n" + "----------\n" + "10. ERROR in Test.java (at line 19)\n" + Index: src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_3.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_3.java,v retrieving revision 1.88 diff -u -r1.88 Compliance_1_3.java --- src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_3.java 24 Nov 2006 17:17:53 -0000 1.88 +++ src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_3.java 5 Feb 2007 15:56:33 -0000 @@ -109,12 +109,12 @@ "----------\n" + "1. ERROR in p1\\X.java (at line 5)\n" + " while (false) System.out.println(\"unreachable\"); \n" + - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "Unreachable code\n" + "----------\n" + "2. ERROR in p1\\X.java (at line 9)\n" + " for (;false;) System.out.println(\"unreachable\"); \n" + - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "Unreachable code\n" + "----------\n" ); 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.29 diff -u -r1.29 ComplianceDiagnoseTest.java --- src/org/eclipse/jdt/core/tests/compiler/parser/ComplianceDiagnoseTest.java 25 Oct 2006 07:43:53 -0000 1.29 +++ src/org/eclipse/jdt/core/tests/compiler/parser/ComplianceDiagnoseTest.java 5 Feb 2007 15:56:32 -0000 @@ -2031,7 +2031,7 @@ "----------\n" + "6. ERROR in X.java (at line 9)\n" + " super(\"SUCCESS\");\n" + - " ^^^^^^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^^^^^^\n" + "The constructor X(String) is undefined\n" + "----------\n"; String expected14ProblemLog = #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.157 diff -u -r1.157 JavaSearchTests.java --- src/org/eclipse/jdt/core/tests/model/JavaSearchTests.java 20 Dec 2006 16:11:56 -0000 1.157 +++ src/org/eclipse/jdt/core/tests/model/JavaSearchTests.java 5 Feb 2007 15:56:41 -0000 @@ -147,7 +147,7 @@ getJavaSearchScope(), this.resultCollector); assertSearchResults( - "src/p/Z.java p.Z(int) [super(i)]", + "src/p/Z.java p.Z(int) [super(i);]", this.resultCollector); } /** @@ -162,8 +162,8 @@ getJavaSearchScope(), this.resultCollector); assertSearchResults( - "src/p/Y.java p.Y(int) [super(i)]\n" + - "src/p/Y.java p.Y(boolean) [super(1)]", + "src/p/Y.java p.Y(int) [super(i);]\n" + + "src/p/Y.java p.Y(boolean) [super(1);]", this.resultCollector); } /** @@ -226,7 +226,7 @@ getJavaSearchScope(), this.resultCollector); assertSearchResults( - "src/c10/X.java c10.B() [new X().super()]", + "src/c10/X.java c10.B() [new X().super();]", this.resultCollector); } /* @@ -260,7 +260,7 @@ assertSearchResults( "src/c11/A.java c11.A1 [A1] SYNTHETIC\n" + "src/c11/A.java c11.A2() [A2] SYNTHETIC\n" + - "src/c11/A.java c11.A3() [super()]", + "src/c11/A.java c11.A3() [super();]", this.resultCollector); } /** Index: src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java,v retrieving revision 1.100 diff -u -r1.100 JavaSearchBugsTests.java --- src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java 28 Jan 2007 09:46:49 -0000 1.100 +++ src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java 5 Feb 2007 15:56:41 -0000 @@ -618,7 +618,7 @@ // Search for constructor declarations and references search(method, ALL_OCCURRENCES); assertSearchResults( - "src/b77093/X.java b77093.X() [this(new Z[10][])] EXACT_MATCH\n"+ + "src/b77093/X.java b77093.X() [this(new Z[10][]);] EXACT_MATCH\n"+ "src/b77093/X.java b77093.X(Z[][]) [X] EXACT_MATCH" ); } @@ -3671,7 +3671,7 @@ search(method, REFERENCES, SearchPattern.R_ERASURE_MATCH); assertSearchResults( "src/b97087/Bug.java b97087.Foo() [Foo] EXACT_MATCH\n" + - "src/b97087/Bug.java b97087.Bar() [super()] ERASURE_MATCH" + "src/b97087/Bug.java b97087.Bar() [super();] ERASURE_MATCH" ); } Index: src/org/eclipse/jdt/core/tests/model/AccessRestrictionsTests.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AccessRestrictionsTests.java,v retrieving revision 1.7 diff -u -r1.7 AccessRestrictionsTests.java --- src/org/eclipse/jdt/core/tests/model/AccessRestrictionsTests.java 3 Oct 2006 15:18:21 -0000 1.7 +++ src/org/eclipse/jdt/core/tests/model/AccessRestrictionsTests.java 5 Feb 2007 15:56:40 -0000 @@ -331,7 +331,7 @@ "----------\n" + "2. ERROR in /P2/src/p/Y.java (at line 5)\n" + " super(0);\n" + - " ^^^^^^^^\n" + + " ^^^^^^^^^\n" + "Access restriction: The constructor X1.C1(int) is not accessible due to restriction on required project P1\n" + "----------\n" + "3. ERROR in /P2/src/p/Y.java (at line 6)\n" + @@ -998,7 +998,7 @@ "----------\n" + "2. ERROR in /P2/src/p/Y.java (at line 5)\n" + " super(0);\n" + - " ^^^^^^^^\n" + + " ^^^^^^^^^\n" + "Access restriction: The constructor X1.C1(int) is not accessible due to restriction on required project P1\n" + "----------\n" + "3. ERROR in /P2/src/p/Y.java (at line 6)\n" + 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.111 diff -u -r1.111 ReconcilerTests.java --- src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java 23 Jan 2007 07:42:23 -0000 1.111 +++ src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java 5 Feb 2007 15:56:41 -0000 @@ -2768,7 +2768,7 @@ "----------\n" + "1. ERROR in /Reconciler/src/p1/X.java (at line 4)\n" + " throw new Exception();\n" + - " ^^^^^^^^^^^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^^^^^^^^^^^\n" + "Unhandled exception type Exception\n" + "----------\n" ); #P org.eclipse.jdt.core.tests Index: Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/InitializationTest.java =================================================================== RCS file: /home/cvs/numbat/org.eclipse.jdt.core.tests/Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/InitializationTest.java,v retrieving revision 1.103 diff -u -r1.103 InitializationTest.java --- Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/InitializationTest.java 15 Jan 2007 09:38:55 -0000 1.103 +++ Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/InitializationTest.java 5 Feb 2007 15:44:40 -0000 @@ -82,7 +82,7 @@ "----------\n" + "1. ERROR in X.java (at line 10)\n" + " throw new InstantiationException(); \n" + - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "Unhandled exception type InstantiationException\n" + "----------\n" ); @@ -640,7 +640,7 @@ "----------\n" + "2. ERROR in X.java (at line 11)\n" + " System.out.println(\"unreachable\"); \n" + - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "Unreachable code\n" + "----------\n" ); @@ -698,12 +698,12 @@ "----------\n" + "1. ERROR in Flub.java (at line 4)\n" + " this(1); \n" + - " ^^^^^^^\n" + + " ^^^^^^^^\n" + "Recursive constructor invocation Flub(int)\n" + "----------\n" + "2. ERROR in Flub.java (at line 7)\n" + " this(); \n" + - " ^^^^^^\n" + + " ^^^^^^^\n" + "Recursive constructor invocation Flub()\n" + "----------\n" ); @@ -3243,7 +3243,7 @@ "----------\n" + "2. ERROR in X.java (at line 11)\n" + " System.out.println(i);//1 \n" + - " ^^^^^^^^^^^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^^^^^^^^^^^\n" + "Unreachable code\n" + "----------\n"); } @@ -3276,12 +3276,12 @@ "----------\n" + "2. ERROR in X.java (at line 11)\n" + " System.out.println(i);//1 \n" + - " ^^^^^^^^^^^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^^^^^^^^^^^\n" + "Unreachable code\n" + "----------\n" + "3. ERROR in X.java (at line 13)\n" + " System.out.println(i);//2 \n" + - " ^^^^^^^^^^^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^^^^^^^^^^^\n" + "Unreachable code\n" + "----------\n"); } @@ -3353,7 +3353,7 @@ "----------\n" + "1. ERROR in X.java (at line 6)\n" + " i = 0;\n" + - " ^^^^^\n" + + " ^^^^^^\n" + "Unreachable code\n" + "----------\n"); } @@ -3436,7 +3436,7 @@ "----------\n" + "3. ERROR in X.java (at line 12)\n" + " System.out.println(var); \n" + - " ^^^^^^^^^^^^^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^^^^^^^^^^^^^\n" + "Unreachable code\n" + "----------\n"); } @@ -3470,7 +3470,7 @@ "----------\n" + "2. ERROR in X.java (at line 12)\n" + " System.out.println(var); \n" + - " ^^^^^^^^^^^^^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^^^^^^^^^^^^^\n" + "Unreachable code\n" + "----------\n"); } @@ -3603,12 +3603,12 @@ "----------\n" + "2. ERROR in X.java (at line 12)\n" + " System.out.println(var);//1 \n" + - " ^^^^^^^^^^^^^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^^^^^^^^^^^^^\n" + "Unreachable code\n" + "----------\n" + "3. ERROR in X.java (at line 14)\n" + " System.out.println(var);//2 \n" + - " ^^^^^^^^^^^^^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^^^^^^^^^^^^^\n" + "Unreachable code\n" + "----------\n"); } @@ -3636,7 +3636,7 @@ "----------\n" + "1. ERROR in X.java (at line 11)\n" + " System.out.println(var);//1 \n" + - " ^^^^^^^^^^^^^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^^^^^^^^^^^^^\n" + "Unreachable code\n" + "----------\n"); } @@ -4435,7 +4435,7 @@ "----------\n" + "1. ERROR in X.java (at line 6)\n" + " if (false) throw new Exception(); // uncaught\n" + - " ^^^^^^^^^^^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^^^^^^^^^^^\n" + "Unhandled exception type Exception\n" + "----------\n"); } @@ -4761,7 +4761,7 @@ "----------\n" + "1. ERROR in X.java (at line 8)\n" + " System.out.println(\"unreachable\");\n" + - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "Unreachable code\n" + "----------\n"); } 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.300 diff -u -r1.300 NegativeTest.java --- Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/NegativeTest.java 15 Jan 2007 09:38:55 -0000 1.300 +++ Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/NegativeTest.java 5 Feb 2007 15:44:41 -0000 @@ -1258,7 +1258,7 @@ "----------\n" + "1. ERROR in p\\X.java (at line 5)\n" + " this();\n" + - " ^^^^^^\n" + + " ^^^^^^^\n" + "Recursive constructor invocation X.X1()\n" + "----------\n" ); @@ -1349,7 +1349,7 @@ "----------\n" + "2. ERROR in p\\X.java (at line 14)\n" + " return; // unreachable\n" + - " ^^^^^^\n" + + " ^^^^^^^\n" + "Unreachable code\n" + "----------\n" ); @@ -2453,7 +2453,7 @@ "----------\n" + "3. ERROR in p\\X.java (at line 5)\n" + " return; \n" + - " ^^^^^^\n" + + " ^^^^^^^\n" + "Cannot return from within an initializer\n" + "----------\n" ); @@ -2505,22 +2505,22 @@ "----------\n" + "1. ERROR in p\\X.java (at line 9)\n" + " this((double) i);//Y2\n" + - " ^^^^^^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^^^^^^\n" + "Recursive constructor invocation Y(double)\n" + "----------\n" + "2. ERROR in p\\X.java (at line 12)\n" + " this((byte) d);//Y3\n" + - " ^^^^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^^^^\n" + "Recursive constructor invocation Y(byte)\n" + "----------\n" + "3. ERROR in p\\X.java (at line 15)\n" + " this((float) b);//Y4\n" + - " ^^^^^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^^^^^\n" + "Recursive constructor invocation Y(float)\n" + "----------\n" + "4. ERROR in p\\X.java (at line 18)\n" + " this((int) f);//Y5\n" + - " ^^^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^^^\n" + "Recursive constructor invocation Y(int)\n" + "----------\n" + "5. ERROR in p\\X.java (at line 22)\n" + @@ -2535,7 +2535,7 @@ "----------\n" + "7. ERROR in p\\X.java (at line 25)\n" + " this((float) s.length());//Y1\n" + - " ^^^^^^^^^^^^^^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "Constructor call must be the first statement in a constructor\n" + "----------\n" + "8. ERROR in p\\X.java (at line 27)\n" + @@ -2545,7 +2545,7 @@ "----------\n" + "9. ERROR in p\\X.java (at line 28)\n" + " this((byte) i);//Y2\n" + - " ^^^^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^^^^\n" + "Constructor call must be the first statement in a constructor\n" + "----------\n" + "10. ERROR in p\\X.java (at line 30)\n" + @@ -2555,7 +2555,7 @@ "----------\n" + "11. ERROR in p\\X.java (at line 31)\n" + " this((float) d);//Y3\n" + - " ^^^^^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^^^^^\n" + "Constructor call must be the first statement in a constructor\n" + "----------\n" + "12. ERROR in p\\X.java (at line 33)\n" + @@ -2565,7 +2565,7 @@ "----------\n" + "13. ERROR in p\\X.java (at line 34)\n" + " this((float) b);//Y4\n" + - " ^^^^^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^^^^^\n" + "Constructor call must be the first statement in a constructor\n" + "----------\n" + "14. ERROR in p\\X.java (at line 36)\n" + @@ -2575,7 +2575,7 @@ "----------\n" + "15. ERROR in p\\X.java (at line 37)\n" + " this((int) f);//Y5\n" + - " ^^^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^^^\n" + "Constructor call must be the first statement in a constructor\n" + "----------\n" ); @@ -3275,7 +3275,7 @@ "----------\n" + "3. ERROR in p\\X.java (at line 6)\n" + " return; // Wrong.\n" + - " ^^^^^^\n" + + " ^^^^^^^\n" + "Cannot return from within an initializer\n" + "----------\n" + "4. ERROR in p\\X.java (at line 8)\n" + @@ -3497,12 +3497,12 @@ "----------\n" + "2. ERROR in p\\BytecodeA.java (at line 83)\n" + " continue L; // bad\n" + - " ^^^^^^^^^^\n" + + " ^^^^^^^^^^^\n" + "continue cannot be used outside of a loop\n" + "----------\n" + "3. ERROR in p\\BytecodeA.java (at line 91)\n" + " continue L; // bad\n" + - " ^^^^^^^^^^\n" + + " ^^^^^^^^^^^\n" + "continue cannot be used outside of a loop\n" + "----------\n" + "4. WARNING in p\\BytecodeA.java (at line 93)\n" + @@ -3519,7 +3519,7 @@ "----------\n" + "6. ERROR in p\\BytecodeA.java (at line 105)\n" + " continue L; // good\n" + - " ^^^^^^^^^^\n" + + " ^^^^^^^^^^^\n" + "continue cannot be used outside of a loop\n" + "----------\n" + "7. ERROR in p\\BytecodeA.java (at line 115)\n" + @@ -4198,7 +4198,7 @@ "----------\n" + "1. ERROR in p\\B.java (at line 16)\n" + " return 3;\n" + - " ^^^^^^^^\n" + + " ^^^^^^^^^\n" + "Unreachable code\n" + "----------\n" ); @@ -4729,7 +4729,7 @@ "----------\n" + "1. ERROR in p\\F.java (at line 7)\n" + " { if (true) break; }\n" + - " ^^^^^\n" + + " ^^^^^^\n" + "break cannot be used outside of a loop or a switch\n" + "----------\n" + "2. ERROR in p\\F.java (at line 13)\n" + @@ -4844,7 +4844,7 @@ "----------\n" + "2. ERROR in p\\New.java (at line 8)\n" + " super(t);\n" + - " ^^^^^^^^\n" + + " ^^^^^^^^^\n" + "The constructor Object(String) is undefined\n" + "----------\n" ); @@ -5526,7 +5526,7 @@ "----------\n" + "1. ERROR in p\\ADA.java (at line 8)\n" + " if (i > 10) return;\n" + - " ^^^^^^\n" + + " ^^^^^^^\n" + "Cannot return from within an initializer\n" + "----------\n" ); @@ -5597,7 +5597,7 @@ "----------\n" + "1. ERROR in p\\B.java (at line 16)\n" + " return 3;\n" + - " ^^^^^^^^\n" + + " ^^^^^^^^^\n" + "Unreachable code\n" + "----------\n" + "----------\n" + @@ -5710,7 +5710,7 @@ "----------\n" + "1. ERROR in p\\A5.java (at line 7)\n" + " return;\n" + - " ^^^^^^\n" + + " ^^^^^^^\n" + "This method must return a result of type int\n" + "----------\n" ); @@ -6876,7 +6876,7 @@ "----------\n" + "2. ERROR in p\\BC.java (at line 11)\n" + " this(arg1);\n" + - " ^^^^^^^^^^\n" + + " ^^^^^^^^^^^\n" + "Recursive constructor invocation BC_a(int)\n" + "----------\n" + "3. WARNING in p\\BC.java (at line 12)\n" + @@ -6886,7 +6886,7 @@ "----------\n" + "4. ERROR in p\\BC.java (at line 15)\n" + " this(arg1,2);\n" + - " ^^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^^\n" + "Recursive constructor invocation BC_a(int, int)\n" + "----------\n" ); @@ -7299,7 +7299,7 @@ "----------\n" + "3. ERROR in p\\I.java (at line 6)\n" + " return; // Wrong.\n" + - " ^^^^^^\n" + + " ^^^^^^^\n" + "Cannot return from within an initializer\n" + "----------\n" ); @@ -8692,7 +8692,7 @@ "----------\n" + "2. ERROR in p\\o\\clss21706_a.java (at line 8)\n" + " super(meth());\n" + - " ^^^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^^^\n" + "The constructor clss21706_b(int) is undefined\n" + "----------\n" + "3. ERROR in p\\o\\clss21706_a.java (at line 8)\n" + @@ -8707,7 +8707,7 @@ "----------\n" + "5. ERROR in p\\o\\clss21706_a.java (at line 14)\n" + " super(meth());\n" + - " ^^^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^^^\n" + "Constructor call must be the first statement in a constructor\n" + "----------\n" ); @@ -8959,7 +8959,7 @@ "----------\n" + "4. ERROR in p\\h\\X1.java (at line 6)\n" + " throw new Exception();\n" + - " ^^^^^^^^^^^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^^^^^^^^^^^\n" + "Unhandled exception type Exception\n" + "----------\n" + "5. ERROR in p\\h\\X1.java (at line 9)\n" + @@ -10532,7 +10532,7 @@ "----------\n" + "1. ERROR in p\\X.java (at line 8)\n" + " continue a; \n" + - " ^^^^^^^^^^\n" + + " ^^^^^^^^^^^\n" + "continue cannot be used outside of a loop\n" + "----------\n" ); @@ -11667,7 +11667,7 @@ "----------\n" + "2. ERROR in X.java (at line 4)\n" + " b: break; //ko \n" + - " ^^^^^\n" + + " ^^^^^^\n" + "break cannot be used outside of a loop or a switch\n" + "----------\n" + "3. WARNING in X.java (at line 5)\n" + @@ -11682,7 +11682,7 @@ "----------\n" + "5. ERROR in X.java (at line 6)\n" + " d: continue; //ko \n" + - " ^^^^^^^^\n" + + " ^^^^^^^^^\n" + "continue cannot be used outside of a loop\n" + "----------\n" + "6. WARNING in X.java (at line 7)\n" + @@ -11708,7 +11708,7 @@ "----------\n" + "1. ERROR in X.java (at line 4)\n" + " bar(); //1 \n" + - " ^^^^^\n" + + " ^^^^^^\n" + "Unreachable code\n" + "----------\n"); } @@ -11879,7 +11879,7 @@ "----------\n" + "3. ERROR in TestEclipseBug.java (at line 12)\n" + " this(objEntityName); // recursive constructor call \n" + - " ^^^^^^^^^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^^^^^^^^^\n" + "Recursive constructor invocation TestEclipseBug(String)\n" + "----------\n"); } @@ -13624,7 +13624,7 @@ "----------\n" + "1. ERROR in X.java (at line 4)\n" + " super();\n" + - " ^^^^^^^\n" + + " ^^^^^^^^\n" + "Constructor call must be the first statement in a constructor\n" + "----------\n"); } @@ -13641,7 +13641,7 @@ "----------\n" + "1. ERROR in X.java (at line 3)\n" + " super();\n" + - " ^^^^^^^\n" + + " ^^^^^^^^\n" + "Constructor call must be the first statement in a constructor\n" + "----------\n"); } @@ -13663,7 +13663,7 @@ "----------\n" + "2. ERROR in X.java (at line 3)\n" + " super();\n" + - " ^^^^^^^\n" + + " ^^^^^^^^\n" + "Constructor call must be the first statement in a constructor\n" + "----------\n"); } @@ -14500,12 +14500,12 @@ "----------\n" + "8. ERROR in X.java (at line 24)\n" + " super(b);\n" + - " ^^^^^^^^\n" + + " ^^^^^^^^^\n" + "The constructor Object(A.B) is undefined\n" + "----------\n" + "9. ERROR in X.java (at line 28)\n" + " super(b);\n" + - " ^^^^^^^^\n" + + " ^^^^^^^^^\n" + "The constructor Object(A.B) is undefined\n" + "----------\n", null, @@ -15267,7 +15267,7 @@ "----------\n" + "5. ERROR in X.java (at line 7)\n" + " return ; // semicolon5\n" + - " ^^^^^^^\n" + + " ^^^^^^^^\n" + "Unreachable code\n" + "----------\n" + "6. WARNING in X.java (at line 8)\n" + @@ -15335,7 +15335,7 @@ "----------\n" + "1. ERROR in X.java (at line 12)\n" + " } else return;\n" + - " ^^^^^^\n" + + " ^^^^^^^\n" + "Statement unnecessarily nested within else clause. The corresponding then clause does not complete normally\n" + "----------\n", null, @@ -16033,7 +16033,7 @@ "----------\n" + "1. ERROR in X.java (at line 7)\n" + " break label2;\n" + - " ^^^^^^^^^^^^\n" + + " ^^^^^^^^^^^^^\n" + "The label label2 is missing\n" + "----------\n"); } Index: Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/ObjectTest.java =================================================================== RCS file: /home/cvs/numbat/org.eclipse.jdt.core.tests/Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/ObjectTest.java,v retrieving revision 1.15 diff -u -r1.15 ObjectTest.java --- Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/ObjectTest.java 29 Mar 2006 05:07:13 -0000 1.15 +++ Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/ObjectTest.java 5 Feb 2007 15:44:41 -0000 @@ -37,7 +37,7 @@ "----------\n" + "1. ERROR in java\\lang\\Object.java (at line 7)\n" + " super();\n" + - " ^^^^^^^\n" + + " ^^^^^^^^\n" + "super cannot be used in java.lang.Object\n" + "----------\n" ); #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/internal/compiler/ast/ThrowStatement.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ThrowStatement.java,v retrieving revision 1.32 diff -u -r1.32 ThrowStatement.java --- compiler/org/eclipse/jdt/internal/compiler/ast/ThrowStatement.java 9 Jun 2006 10:20:47 -0000 1.32 +++ compiler/org/eclipse/jdt/internal/compiler/ast/ThrowStatement.java 5 Feb 2007 15:56:47 -0000 @@ -24,10 +24,10 @@ public Expression exception; public TypeBinding exceptionType; -public ThrowStatement(Expression exception, int startPosition) { +public ThrowStatement(Expression exception, int sourceStart, int sourceEnd) { this.exception = exception; - this.sourceStart = startPosition; - this.sourceEnd = exception.sourceEnd; + this.sourceStart = sourceStart; + this.sourceEnd = sourceEnd; } public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) { Index: compiler/org/eclipse/jdt/internal/compiler/ast/DoStatement.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/DoStatement.java,v retrieving revision 1.54 diff -u -r1.54 DoStatement.java --- compiler/org/eclipse/jdt/internal/compiler/ast/DoStatement.java 25 Sep 2006 10:28:06 -0000 1.54 +++ compiler/org/eclipse/jdt/internal/compiler/ast/DoStatement.java 5 Feb 2007 15:56:47 -0000 @@ -26,10 +26,10 @@ // for local variables table attributes int mergedInitStateIndex = -1; -public DoStatement(Expression condition, Statement action, int s, int e) { +public DoStatement(Expression condition, Statement action, int sourceStart, int sourceEnd) { - this.sourceStart = s; - this.sourceEnd = e; + this.sourceStart = sourceStart; + this.sourceEnd = sourceEnd; this.condition = condition; this.action = action; // remember useful empty statement Index: compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java,v retrieving revision 1.364 diff -u -r1.364 Parser.java --- compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java 11 Jan 2007 15:26:28 -0000 1.364 +++ compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java 5 Feb 2007 15:56:48 -0000 @@ -3411,7 +3411,7 @@ break; } pushOnAstStack(ecc); - ecc.sourceEnd = this.endPosition; + ecc.sourceEnd = this.endStatementPosition; } protected void consumeExplicitConstructorInvocationWithTypeArguments(int flag, int recFlag) { @@ -3452,7 +3452,7 @@ } pushOnAstStack(ecc); - ecc.sourceEnd = this.endPosition; + ecc.sourceEnd = this.endStatementPosition; } protected void consumeExpressionStatement() { // ExpressionStatement ::= StatementExpression ';' @@ -6662,7 +6662,7 @@ // BreakStatement ::= 'break' ';' // break pushs a position on this.intStack in case there is no label - pushOnAstStack(new BreakStatement(null, this.intStack[this.intPtr--], this.endPosition)); + pushOnAstStack(new BreakStatement(null, this.intStack[this.intPtr--], this.endStatementPosition)); if (this.pendingRecoveredType != null) { // Used only in statements recovery. @@ -6685,7 +6685,7 @@ new BreakStatement( this.identifierStack[this.identifierPtr--], this.intStack[this.intPtr--], - this.endPosition)); + this.endStatementPosition)); this.identifierLengthPtr--; } protected void consumeStatementCatch() { @@ -6708,7 +6708,7 @@ new ContinueStatement( null, this.intStack[this.intPtr--], - this.endPosition)); + this.endStatementPosition)); } protected void consumeStatementContinueWithLabel() { // ContinueStatement ::= 'continue' Identifier ';' @@ -6718,7 +6718,7 @@ new ContinueStatement( this.identifierStack[this.identifierPtr--], this.intStack[this.intPtr--], - this.endPosition)); + this.endStatementPosition)); this.identifierLengthPtr--; } protected void consumeStatementDo() { @@ -6734,7 +6734,7 @@ this.expressionStack[this.expressionPtr--], statement, this.intStack[this.intPtr--], - this.endPosition); + this.endStatementPosition); } protected void consumeStatementExpressionList() { // StatementExpressionList ::= StatementExpressionList ',' StatementExpression @@ -6858,10 +6858,10 @@ new ReturnStatement( this.expressionStack[this.expressionPtr--], this.intStack[this.intPtr--], - this.endPosition) + this.endStatementPosition) ); } else { - pushOnAstStack(new ReturnStatement(null, this.intStack[this.intPtr--], this.endPosition)); + pushOnAstStack(new ReturnStatement(null, this.intStack[this.intPtr--], this.endStatementPosition)); } } protected void consumeStatementSwitch() { @@ -6920,7 +6920,7 @@ protected void consumeStatementThrow() { // ThrowStatement ::= 'throw' Expression ';' this.expressionLengthPtr--; - pushOnAstStack(new ThrowStatement(this.expressionStack[this.expressionPtr--], this.intStack[this.intPtr--])); + pushOnAstStack(new ThrowStatement(this.expressionStack[this.expressionPtr--], this.intStack[this.intPtr--], this.endStatementPosition)); } protected void consumeStatementTry(boolean withFinally) { //TryStatement ::= 'try' Block Catches 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.338 diff -u -r1.338 ProblemReporter.java --- compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java 31 Jan 2007 19:31:44 -0000 1.338 +++ compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java 5 Feb 2007 15:56:48 -0000 @@ -6086,12 +6086,22 @@ location.sourceEnd); } public void unreachableCode(Statement statement) { + int sourceStart = statement.sourceStart; + int sourceEnd = statement.sourceEnd; + if (statement instanceof LocalDeclaration) { + LocalDeclaration declaration = (LocalDeclaration) statement; + sourceStart = declaration.declarationSourceStart; + sourceEnd = declaration.declarationSourceEnd; + } else if (statement instanceof Expression) { + int statemendEnd = ((Expression) statement).statementEnd; + if (statemendEnd != -1) sourceEnd = statemendEnd; + } this.handle( IProblem.CodeCannotBeReached, NoArgument, NoArgument, - statement.sourceStart, - statement.sourceEnd); + sourceStart, + sourceEnd); } public void unresolvableReference(NameReference nameRef, Binding binding) { /* also need to check that the searchedType is the receiver type Index: dom/org/eclipse/jdt/core/dom/ASTConverter.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTConverter.java,v retrieving revision 1.245 diff -u -r1.245 ASTConverter.java --- dom/org/eclipse/jdt/core/dom/ASTConverter.java 23 Oct 2006 16:38:06 -0000 1.245 +++ dom/org/eclipse/jdt/core/dom/ASTConverter.java 5 Feb 2007 15:56:49 -0000 @@ -1147,7 +1147,6 @@ retrieveIdentifierAndSetPositions(statement.sourceStart, statement.sourceEnd, name); breakStatement.setLabel(name); } - retrieveSemiColonPosition(breakStatement); return breakStatement; } @@ -1349,7 +1348,6 @@ retrieveIdentifierAndSetPositions(statement.sourceStart, statement.sourceEnd, name); continueStatement.setLabel(name); } - retrieveSemiColonPosition(continueStatement); return continueStatement; } @@ -1360,7 +1358,6 @@ final Statement action = convert(statement.action); if (action == null) return null; doStatement.setBody(action); - retrieveSemiColonPosition(doStatement); return doStatement; } @@ -1516,7 +1513,6 @@ newStatement = constructorInvocation; } newStatement.setSourceRange(sourceStart, statement.sourceEnd - sourceStart + 1); - retrieveSemiColonPosition(newStatement); if (this.resolveBindings) { recordNodes(newStatement, statement); } @@ -2343,7 +2339,6 @@ if (statement.expression != null) { returnStatement.setExpression(convert(statement.expression)); } - retrieveSemiColonPosition(returnStatement); return returnStatement; } @@ -2477,11 +2472,13 @@ return convert((org.eclipse.jdt.internal.compiler.ast.WhileStatement) statement); } if (statement instanceof org.eclipse.jdt.internal.compiler.ast.Expression) { - final Expression expr = convert((org.eclipse.jdt.internal.compiler.ast.Expression) statement); + org.eclipse.jdt.internal.compiler.ast.Expression statement2 = (org.eclipse.jdt.internal.compiler.ast.Expression) statement; + final Expression expr = convert(statement2); final ExpressionStatement stmt = new ExpressionStatement(this.ast); stmt.setExpression(expr); - stmt.setSourceRange(expr.getStartPosition(), expr.getLength()); - retrieveSemiColonPosition(stmt); + int sourceStart = expr.getStartPosition(); + int sourceEnd = statement2.statementEnd; + stmt.setSourceRange(sourceStart, sourceEnd - sourceStart + 1); return stmt; } return createFakeEmptyStatement(statement); @@ -2554,7 +2551,6 @@ final ThrowStatement throwStatement = new ThrowStatement(this.ast); throwStatement.setSourceRange(statement.sourceStart, statement.sourceEnd - statement.sourceStart + 1); throwStatement.setExpression(convert(statement.exception)); - retrieveSemiColonPosition(throwStatement); return throwStatement; } @@ -4254,31 +4250,7 @@ } return -1; } - - /* - * This method is used to set the right end position for expression - * statement. The actual AST nodes don't include the trailing semicolon. - * This method fixes the length of the corresponding node. - */ - protected void retrieveSemiColonPosition(ASTNode node) { - int start = node.getStartPosition(); - int length = node.getLength(); - int end = start + length; - this.scanner.resetTo(end, this.compilationUnitSourceLength); - try { - int token; - while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { - switch(token) { - case TerminalTokens.TokenNameSEMICOLON: - node.setSourceRange(start, this.scanner.currentPosition - start); - return; - } - } - } catch(InvalidInputException e) { - // ignore - } - } - + /** * This method is used to retrieve the start position of the block. * @return int the dimension found, -1 if none