Lines 1499-1510
Link Here
|
1499 |
" public abstract void foo();\n" + |
1499 |
" public abstract void foo();\n" + |
1500 |
"}\n" |
1500 |
"}\n" |
1501 |
}, |
1501 |
}, |
1502 |
"----------\n" + |
1502 |
"----------\n" + |
1503 |
"1. ERROR in X.java (at line 5)\n" + |
1503 |
"1. ERROR in X.java (at line 2)\n" + |
1504 |
" public abstract void foo();\n" + |
1504 |
" A\n" + |
1505 |
" ^^^^^\n" + |
1505 |
" ^\n" + |
1506 |
"The enum X can only define the abstract method foo() if it also defines enum constants with corresponding implementations\n" + |
1506 |
"The enum constant A must define the abstract method foo()\n" + |
1507 |
"----------\n" |
1507 |
"----------\n" |
1508 |
); |
1508 |
); |
1509 |
} |
1509 |
} |
1510 |
|
1510 |
|
Lines 1540-1551
Link Here
|
1540 |
" public abstract void foo();\n" + |
1540 |
" public abstract void foo();\n" + |
1541 |
"}\n" |
1541 |
"}\n" |
1542 |
}, |
1542 |
}, |
1543 |
"----------\n" + |
1543 |
"----------\n" + |
1544 |
"1. ERROR in X.java (at line 2)\n" + |
1544 |
"1. ERROR in X.java (at line 2)\n" + |
1545 |
" A() {}\n" + |
1545 |
" A() {}\n" + |
1546 |
" ^\n" + |
1546 |
" ^\n" + |
1547 |
"The type new X(){} must implement the inherited abstract method X.foo()\n" + |
1547 |
"The enum constant A must define the abstract method foo()\n" + |
1548 |
"----------\n" |
1548 |
"----------\n" |
1549 |
); |
1549 |
); |
1550 |
} |
1550 |
} |
1551 |
|
1551 |
|
Lines 2165-2174
Link Here
|
2165 |
"interface I { void test(); }\n" |
2165 |
"interface I { void test(); }\n" |
2166 |
}, |
2166 |
}, |
2167 |
"----------\n" + |
2167 |
"----------\n" + |
2168 |
"1. ERROR in X3a.java (at line 3)\n" + |
2168 |
"1. ERROR in X3a.java (at line 2)\n" + |
2169 |
" public abstract void test();\n" + |
2169 |
" A;\n" + |
2170 |
" ^^^^^^\n" + |
2170 |
" ^\n" + |
2171 |
"The enum X3a can only define the abstract method test() if it also defines enum constants with corresponding implementations\n" + |
2171 |
"The enum constant A must define the abstract method test()\n" + |
2172 |
"----------\n" |
2172 |
"----------\n" |
2173 |
// X3a is not abstract and does not override abstract method test() in X3a |
2173 |
// X3a is not abstract and does not override abstract method test() in X3a |
2174 |
); |
2174 |
); |
Lines 2195-2202
Link Here
|
2195 |
"----------\n" + |
2195 |
"----------\n" + |
2196 |
"1. ERROR in X3c.java (at line 2)\n" + |
2196 |
"1. ERROR in X3c.java (at line 2)\n" + |
2197 |
" A() { void random() {} };\n" + |
2197 |
" A() { void random() {} };\n" + |
2198 |
" ^\n" + |
2198 |
" ^\n" + |
2199 |
"The type new X3c(){} must implement the inherited abstract method X3c.test()\n" + |
2199 |
"The enum constant A must define the abstract method test()\n" + |
2200 |
"----------\n" |
2200 |
"----------\n" |
2201 |
// <anonymous X3c$1> is not abstract and does not override abstract method test() in X3c |
2201 |
// <anonymous X3c$1> is not abstract and does not override abstract method test() in X3c |
2202 |
); |
2202 |
); |
Lines 2229-2238
Link Here
|
2229 |
"}\n" |
2229 |
"}\n" |
2230 |
}, |
2230 |
}, |
2231 |
"----------\n" + |
2231 |
"----------\n" + |
2232 |
"1. ERROR in X4a.java (at line 3)\n" + |
2232 |
"1. ERROR in X4a.java (at line 2)\n" + |
2233 |
" public abstract void test();\n" + |
2233 |
" A;\n" + |
2234 |
" ^^^^^^\n" + |
2234 |
" ^\n" + |
2235 |
"The enum X4a can only define the abstract method test() if it also defines enum constants with corresponding implementations\n" + |
2235 |
"The enum constant A must define the abstract method test()\n" + |
2236 |
"----------\n" |
2236 |
"----------\n" |
2237 |
// X4a is not abstract and does not override abstract method test() in X4a |
2237 |
// X4a is not abstract and does not override abstract method test() in X4a |
2238 |
); |
2238 |
); |
Lines 2257-2264
Link Here
|
2257 |
"----------\n" + |
2257 |
"----------\n" + |
2258 |
"1. ERROR in X4c.java (at line 2)\n" + |
2258 |
"1. ERROR in X4c.java (at line 2)\n" + |
2259 |
" A() { void random() {} };\n" + |
2259 |
" A() { void random() {} };\n" + |
2260 |
" ^\n" + |
2260 |
" ^\n" + |
2261 |
"The type new X4c(){} must implement the inherited abstract method X4c.test()\n" + |
2261 |
"The enum constant A must define the abstract method test()\n" + |
2262 |
"----------\n" |
2262 |
"----------\n" |
2263 |
// <anonymous X4c$1> is not abstract and does not override abstract method test() in X4c |
2263 |
// <anonymous X4c$1> is not abstract and does not override abstract method test() in X4c |
2264 |
); |
2264 |
); |
Lines 2322-2329
Link Here
|
2322 |
"----------\n" + |
2322 |
"----------\n" + |
2323 |
"1. ERROR in X5c.java (at line 2)\n" + |
2323 |
"1. ERROR in X5c.java (at line 2)\n" + |
2324 |
" A() { void random() {} };\n" + |
2324 |
" A() { void random() {} };\n" + |
2325 |
" ^\n" + |
2325 |
" ^\n" + |
2326 |
"The type new X5c(){} must implement the inherited abstract method I.test()\n" + |
2326 |
"The enum constant A must define the abstract method test()\n" + |
2327 |
"----------\n" |
2327 |
"----------\n" |
2328 |
// <anonymous X5c$1> is not abstract and does not override abstract method test() in I |
2328 |
// <anonymous X5c$1> is not abstract and does not override abstract method test() in I |
2329 |
); |
2329 |
); |
Lines 4909-4918
Link Here
|
4909 |
} |
4909 |
} |
4910 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=156591 - variation |
4910 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=156591 - variation |
4911 |
public void test139() { |
4911 |
public void test139() { |
4912 |
this.runNegativeTest( |
4912 |
this.runNegativeTest( |
4913 |
new String[] { |
4913 |
new String[] { |
4914 |
"X.java", |
4914 |
"X.java", |
4915 |
"public enum X {\n" + |
4915 |
"public enum X {\n" + |
4916 |
" PLUS {\n" + |
4916 |
" PLUS {\n" + |
4917 |
" double eval(double x, double y) {\n" + |
4917 |
" double eval(double x, double y) {\n" + |
4918 |
" return x + y;\n" + |
4918 |
" return x + y;\n" + |
Lines 4925-4947
Link Here
|
4925 |
" abstract double eval(double x, double y);\n" + |
4925 |
" abstract double eval(double x, double y);\n" + |
4926 |
"}\n" + |
4926 |
"}\n" + |
4927 |
"\n", // ================= |
4927 |
"\n", // ================= |
4928 |
}, |
4928 |
}, |
4929 |
"----------\n" + |
4929 |
"----------\n" + |
4930 |
"1. WARNING in X.java (at line 3)\n" + |
4930 |
"1. WARNING in X.java (at line 3)\n" + |
4931 |
" double eval(double x, double y) {\n" + |
4931 |
" double eval(double x, double y) {\n" + |
4932 |
" ^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
4932 |
" ^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
4933 |
"The method eval(double, double) of type new X(){} should be tagged with @Override since it actually overrides a superclass method\n" + |
4933 |
"The method eval(double, double) of type new X(){} should be tagged with @Override since it actually overrides a superclass method\n" + |
4934 |
"----------\n" + |
4934 |
"----------\n" + |
4935 |
"2. ERROR in X.java (at line 7)\n" + |
4935 |
"2. ERROR in X.java (at line 7)\n" + |
4936 |
" MINUS {\n" + |
4936 |
" MINUS {\n" + |
4937 |
" ^\n" + |
4937 |
" ^^^^^\n" + |
4938 |
"The type new X(){} must implement the inherited abstract method X.eval(double, double)\n" + |
4938 |
"The enum constant MINUS must define the abstract method eval(double, double)\n" + |
4939 |
"----------\n" + |
4939 |
"----------\n" + |
4940 |
"3. ERROR in X.java (at line 8)\n" + |
4940 |
"3. ERROR in X.java (at line 8)\n" + |
4941 |
" abstract double eval2(double x, double y);\n" + |
4941 |
" abstract double eval2(double x, double y);\n" + |
4942 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
4942 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
4943 |
"The abstract method eval2 in type new X(){} can only be defined by an abstract class\n" + |
4943 |
"The abstract method eval2 in type new X(){} can only be defined by an abstract class\n" + |
4944 |
"----------\n"); |
4944 |
"----------\n" |
|
|
4945 |
); |
4945 |
} |
4946 |
} |
4946 |
//check final modifier |
4947 |
//check final modifier |
4947 |
public void test140() { |
4948 |
public void test140() { |