Lines 11-16
Link Here
|
11 |
package org.eclipse.jdt.core.tests.compiler.regression; |
11 |
package org.eclipse.jdt.core.tests.compiler.regression; |
12 |
|
12 |
|
13 |
import java.io.File; |
13 |
import java.io.File; |
|
|
14 |
import java.util.Map; |
14 |
|
15 |
|
15 |
import junit.framework.Test; |
16 |
import junit.framework.Test; |
16 |
|
17 |
|
Lines 31-36
Link Here
|
31 |
public InnerEmulationTest(String name) { |
32 |
public InnerEmulationTest(String name) { |
32 |
super(name); |
33 |
super(name); |
33 |
} |
34 |
} |
|
|
35 |
protected Map getCompilerOptions() { |
36 |
Map options = super.getCompilerOptions(); |
37 |
options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE); |
38 |
options.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.IGNORE); |
39 |
options.put(CompilerOptions.OPTION_ReportUnusedParameter, CompilerOptions.IGNORE); |
40 |
options.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE); |
41 |
return options; |
42 |
} |
34 |
public static Test suite() { |
43 |
public static Test suite() { |
35 |
return buildAllCompliancesTestSuite(testClass()); |
44 |
return buildAllCompliancesTestSuite(testClass()); |
36 |
} |
45 |
} |
Lines 1460-1478
Link Here
|
1460 |
"1. WARNING in p1\\A2.java (at line 18)\n" + |
1469 |
"1. WARNING in p1\\A2.java (at line 18)\n" + |
1461 |
" private class C extends B { \n" + |
1470 |
" private class C extends B { \n" + |
1462 |
" ^\n" + |
1471 |
" ^\n" + |
1463 |
"The type A2.C is never used locally\n" + |
|
|
1464 |
"----------\n" + |
1465 |
"2. WARNING in p1\\A2.java (at line 18)\n" + |
1466 |
" private class C extends B { \n" + |
1467 |
" ^\n" + |
1468 |
"Access to enclosing constructor A2.B() is emulated by a synthetic accessor method\n" + |
1472 |
"Access to enclosing constructor A2.B() is emulated by a synthetic accessor method\n" + |
1469 |
"----------\n" + |
1473 |
"----------\n" + |
1470 |
"3. WARNING in p1\\A2.java (at line 19)\n" + |
1474 |
"2. ERROR in p1\\A2.java (at line 20)\n" + |
1471 |
" public void foo() { \n" + |
|
|
1472 |
" ^^^^^\n" + |
1473 |
"The method foo() from the type A2.C is never used locally\n" + |
1474 |
"----------\n" + |
1475 |
"4. ERROR in p1\\A2.java (at line 20)\n" + |
1476 |
" (new D.E(null, null, null, new F(get()) {}) {}).execute(); \n" + |
1475 |
" (new D.E(null, null, null, new F(get()) {}) {}).execute(); \n" + |
1477 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
1476 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
1478 |
"No enclosing instance of type D is accessible. Must qualify the allocation with an enclosing instance of type D (e.g. x.new A() where x is an instance of D).\n" + |
1477 |
"No enclosing instance of type D is accessible. Must qualify the allocation with an enclosing instance of type D (e.g. x.new A() where x is an instance of D).\n" + |
Lines 1553-1571
Link Here
|
1553 |
"1. WARNING in p1\\A2.java (at line 18)\n" + |
1552 |
"1. WARNING in p1\\A2.java (at line 18)\n" + |
1554 |
" private class C extends B { \n" + |
1553 |
" private class C extends B { \n" + |
1555 |
" ^\n" + |
1554 |
" ^\n" + |
1556 |
"The type A2.C is never used locally\n" + |
|
|
1557 |
"----------\n" + |
1558 |
"2. WARNING in p1\\A2.java (at line 18)\n" + |
1559 |
" private class C extends B { \n" + |
1560 |
" ^\n" + |
1561 |
"Access to enclosing constructor A2.B() is emulated by a synthetic accessor method\n" + |
1555 |
"Access to enclosing constructor A2.B() is emulated by a synthetic accessor method\n" + |
1562 |
"----------\n" + |
1556 |
"----------\n" + |
1563 |
"3. WARNING in p1\\A2.java (at line 19)\n" + |
1557 |
"2. ERROR in p1\\A2.java (at line 20)\n" + |
1564 |
" public void foo() { \n" + |
|
|
1565 |
" ^^^^^\n" + |
1566 |
"The method foo() from the type A2.C is never used locally\n" + |
1567 |
"----------\n" + |
1568 |
"4. ERROR in p1\\A2.java (at line 20)\n" + |
1569 |
" (new D.E(null, null, null, new F(get()) {})).execute(); \n" + |
1558 |
" (new D.E(null, null, null, new F(get()) {})).execute(); \n" + |
1570 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
1559 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
1571 |
"No enclosing instance of type D is accessible. Must qualify the allocation with an enclosing instance of type D (e.g. x.new A() where x is an instance of D).\n" + |
1560 |
"No enclosing instance of type D is accessible. Must qualify the allocation with an enclosing instance of type D (e.g. x.new A() where x is an instance of D).\n" + |
Lines 2990-3007
Link Here
|
2990 |
"} \n" |
2979 |
"} \n" |
2991 |
}, |
2980 |
}, |
2992 |
"----------\n" + |
2981 |
"----------\n" + |
2993 |
"1. WARNING in X.java (at line 7)\n" + |
2982 |
"1. ERROR in X.java (at line 9)\n" + |
2994 |
" class B extends X { \n" + |
|
|
2995 |
" ^\n" + |
2996 |
"The type B is never used locally\n" + |
2997 |
"----------\n" + |
2998 |
"2. ERROR in X.java (at line 9)\n" + |
2999 |
" super(new A(){ \n" + |
2983 |
" super(new A(){ \n" + |
3000 |
" }); \n" + |
2984 |
" }); \n" + |
3001 |
" ^^^^^^^^^^^^^^^\n" + |
2985 |
" ^^^^^^^^^^^^^^^\n" + |
3002 |
"No enclosing instance of type X is available due to some intermediate constructor invocation\n" + |
2986 |
"No enclosing instance of type X is available due to some intermediate constructor invocation\n" + |
3003 |
"----------\n" + |
2987 |
"----------\n" + |
3004 |
"3. WARNING in X.java (at line 9)\n" + |
2988 |
"2. WARNING in X.java (at line 9)\n" + |
3005 |
" super(new A(){ \n" + |
2989 |
" super(new A(){ \n" + |
3006 |
" ^^^\n" + |
2990 |
" ^^^\n" + |
3007 |
"Access to enclosing constructor A() is emulated by a synthetic accessor method\n" + |
2991 |
"Access to enclosing constructor A() is emulated by a synthetic accessor method\n" + |
Lines 3028-3039
Link Here
|
3028 |
"} \n" |
3012 |
"} \n" |
3029 |
}, |
3013 |
}, |
3030 |
"----------\n" + |
3014 |
"----------\n" + |
3031 |
"1. WARNING in X.java (at line 7)\n" + |
3015 |
"1. ERROR in X.java (at line 9)\n" + |
3032 |
" class B extends X { \n" + |
|
|
3033 |
" ^\n" + |
3034 |
"The type B is never used locally\n" + |
3035 |
"----------\n" + |
3036 |
"2. ERROR in X.java (at line 9)\n" + |
3037 |
" super(new A(){ \n" + |
3016 |
" super(new A(){ \n" + |
3038 |
" }); \n" + |
3017 |
" }); \n" + |
3039 |
" ^^^^^^^^^^^^^^^\n" + |
3018 |
" ^^^^^^^^^^^^^^^\n" + |
Lines 3120-3148
Link Here
|
3120 |
"} \n" |
3099 |
"} \n" |
3121 |
}, |
3100 |
}, |
3122 |
"----------\n" + |
3101 |
"----------\n" + |
3123 |
"1. WARNING in X.java (at line 7)\n" + |
3102 |
"1. ERROR in X.java (at line 9)\n" + |
3124 |
" class B extends X { \n" + |
|
|
3125 |
" ^\n" + |
3126 |
"The type B is never used locally\n" + |
3127 |
"----------\n" + |
3128 |
"2. ERROR in X.java (at line 9)\n" + |
3129 |
" super(new A(){ \n" + |
3103 |
" super(new A(){ \n" + |
3130 |
" void foo() { System.out.println(X.this); } \n" + |
3104 |
" void foo() { System.out.println(X.this); } \n" + |
3131 |
" }); \n" + |
3105 |
" }); \n" + |
3132 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
3106 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
3133 |
"No enclosing instance of type X is available due to some intermediate constructor invocation\n" + |
3107 |
"No enclosing instance of type X is available due to some intermediate constructor invocation\n" + |
3134 |
"----------\n" + |
3108 |
"----------\n" + |
3135 |
"3. WARNING in X.java (at line 9)\n" + |
3109 |
"2. WARNING in X.java (at line 9)\n" + |
3136 |
" super(new A(){ \n" + |
3110 |
" super(new A(){ \n" + |
3137 |
" ^^^\n" + |
3111 |
" ^^^\n" + |
3138 |
"Access to enclosing constructor A() is emulated by a synthetic accessor method\n" + |
3112 |
"Access to enclosing constructor A() is emulated by a synthetic accessor method\n" + |
3139 |
"----------\n" + |
3113 |
"----------\n" + |
3140 |
"4. WARNING in X.java (at line 10)\n" + |
3114 |
"3. ERROR in X.java (at line 10)\n" + |
3141 |
" void foo() { System.out.println(X.this); } \n" + |
|
|
3142 |
" ^^^^^\n" + |
3143 |
"The method foo() from the type new A(){} is never used locally\n" + |
3144 |
"----------\n" + |
3145 |
"5. ERROR in X.java (at line 10)\n" + |
3146 |
" void foo() { System.out.println(X.this); } \n" + |
3115 |
" void foo() { System.out.println(X.this); } \n" + |
3147 |
" ^^^^^^\n" + |
3116 |
" ^^^^^^\n" + |
3148 |
"No enclosing instance of the type X is accessible in scope\n" + |
3117 |
"No enclosing instance of the type X is accessible in scope\n" + |
Lines 3170-3193
Link Here
|
3170 |
"} \n" |
3139 |
"} \n" |
3171 |
}, |
3140 |
}, |
3172 |
"----------\n" + |
3141 |
"----------\n" + |
3173 |
"1. WARNING in X.java (at line 7)\n" + |
3142 |
"1. ERROR in X.java (at line 9)\n" + |
3174 |
" class B extends X { \n" + |
|
|
3175 |
" ^\n" + |
3176 |
"The type B is never used locally\n" + |
3177 |
"----------\n" + |
3178 |
"2. ERROR in X.java (at line 9)\n" + |
3179 |
" super(new A(){ \n" + |
3143 |
" super(new A(){ \n" + |
3180 |
" void foo() { System.out.println(X.this); } \n" + |
3144 |
" void foo() { System.out.println(X.this); } \n" + |
3181 |
" }); \n" + |
3145 |
" }); \n" + |
3182 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
3146 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
3183 |
"No enclosing instance of type X is available due to some intermediate constructor invocation\n" + |
3147 |
"No enclosing instance of type X is available due to some intermediate constructor invocation\n" + |
3184 |
"----------\n" + |
3148 |
"----------\n" + |
3185 |
"3. WARNING in X.java (at line 10)\n" + |
3149 |
"2. ERROR in X.java (at line 10)\n" + |
3186 |
" void foo() { System.out.println(X.this); } \n" + |
|
|
3187 |
" ^^^^^\n" + |
3188 |
"The method foo() from the type new A(){} is never used locally\n" + |
3189 |
"----------\n" + |
3190 |
"4. ERROR in X.java (at line 10)\n" + |
3191 |
" void foo() { System.out.println(X.this); } \n" + |
3150 |
" void foo() { System.out.println(X.this); } \n" + |
3192 |
" ^^^^^^\n" + |
3151 |
" ^^^^^^\n" + |
3193 |
"No enclosing instance of the type X is accessible in scope\n" + |
3152 |
"No enclosing instance of the type X is accessible in scope\n" + |
Lines 3385-3396
Link Here
|
3385 |
"} \n" |
3344 |
"} \n" |
3386 |
}, |
3345 |
}, |
3387 |
"----------\n" + |
3346 |
"----------\n" + |
3388 |
"1. WARNING in X.java (at line 10)\n" + |
3347 |
"1. ERROR in X.java (at line 10)\n" + |
3389 |
" X x = X.this; \n" + |
|
|
3390 |
" ^\n" + |
3391 |
"The field new B(){}.x is never read locally\n" + |
3392 |
"----------\n" + |
3393 |
"2. ERROR in X.java (at line 10)\n" + |
3394 |
" X x = X.this; \n" + |
3348 |
" X x = X.this; \n" + |
3395 |
" ^^^^^^\n" + |
3349 |
" ^^^^^^\n" + |
3396 |
"No enclosing instance of the type X is accessible in scope\n" + |
3350 |
"No enclosing instance of the type X is accessible in scope\n" + |
Lines 3938-3949
Link Here
|
3938 |
"} ", |
3892 |
"} ", |
3939 |
}, |
3893 |
}, |
3940 |
"----------\n" + |
3894 |
"----------\n" + |
3941 |
"1. WARNING in X.java (at line 9)\n" + |
3895 |
"1. ERROR in X.java (at line 11)\n" + |
3942 |
" private static class B extends X.Y implements X.Z { \n" + |
|
|
3943 |
" ^\n" + |
3944 |
"The type A.B is never used locally\n" + |
3945 |
"----------\n" + |
3946 |
"2. ERROR in X.java (at line 11)\n" + |
3947 |
" super(B.this); \n" + |
3896 |
" super(B.this); \n" + |
3948 |
" ^^^^^^\n" + |
3897 |
" ^^^^^^\n" + |
3949 |
"Cannot refer to \'this\' nor \'super\' while explicitly invoking a constructor\n" + |
3898 |
"Cannot refer to \'this\' nor \'super\' while explicitly invoking a constructor\n" + |
Lines 3967-3978
Link Here
|
3967 |
"}", |
3916 |
"}", |
3968 |
}, |
3917 |
}, |
3969 |
"----------\n" + |
3918 |
"----------\n" + |
3970 |
"1. WARNING in X.java (at line 5)\n" + |
3919 |
"1. ERROR in X.java (at line 5)\n" + |
3971 |
" class Local2 extends Local1 {\n" + |
|
|
3972 |
" ^^^^^^\n" + |
3973 |
"The type Local2 is never used locally\n" + |
3974 |
"----------\n" + |
3975 |
"2. ERROR in X.java (at line 5)\n" + |
3976 |
" class Local2 extends Local1 {\n" + |
3920 |
" class Local2 extends Local1 {\n" + |
3977 |
" ^^^^^^\n" + |
3921 |
" ^^^^^^\n" + |
3978 |
"No enclosing instance of type X is available due to some intermediate constructor invocation\n" + |
3922 |
"No enclosing instance of type X is available due to some intermediate constructor invocation\n" + |
Lines 4020-4041
Link Here
|
4020 |
"}" |
3964 |
"}" |
4021 |
}, |
3965 |
}, |
4022 |
"----------\n" + |
3966 |
"----------\n" + |
4023 |
"1. WARNING in X.java (at line 4)\n" + |
3967 |
"1. ERROR in X.java (at line 13)\n" + |
4024 |
" public void foo() {\n" + |
|
|
4025 |
" ^^^^^\n" + |
4026 |
"The method foo() from the type C is never used locally\n" + |
4027 |
"----------\n" + |
4028 |
"2. WARNING in X.java (at line 9)\n" + |
4029 |
" public void foo() {\n" + |
4030 |
" ^^^^^\n" + |
4031 |
"The method foo() from the type new X(){} is never used locally\n" + |
4032 |
"----------\n" + |
4033 |
"3. WARNING in X.java (at line 13)\n" + |
4034 |
" class D extends C {\n" + |
4035 |
" ^\n" + |
4036 |
"The type D is never used locally\n" + |
4037 |
"----------\n" + |
4038 |
"4. ERROR in X.java (at line 13)\n" + |
4039 |
" class D extends C {\n" + |
3968 |
" class D extends C {\n" + |
4040 |
" ^\n" + |
3969 |
" ^\n" + |
4041 |
"No enclosing instance of type X is available due to some intermediate constructor invocation\n" + |
3970 |
"No enclosing instance of type X is available due to some intermediate constructor invocation\n" + |
Lines 4319-4329
Link Here
|
4319 |
" bar();\n" + |
4248 |
" bar();\n" + |
4320 |
" ^^^\n" + |
4249 |
" ^^^\n" + |
4321 |
"Cannot refer to an instance method while explicitly invoking a constructor\n" + |
4250 |
"Cannot refer to an instance method while explicitly invoking a constructor\n" + |
4322 |
"----------\n" + |
|
|
4323 |
"2. WARNING in X.java (at line 22)\n" + |
4324 |
" void baz() {\n" + |
4325 |
" ^^^^^\n" + |
4326 |
"The method baz() from the type new Object(){} is never used locally\n" + |
4327 |
"----------\n"); |
4251 |
"----------\n"); |
4328 |
} |
4252 |
} |
4329 |
public void test119() { |
4253 |
public void test119() { |
Lines 4380-4400
Link Here
|
4380 |
" foo(\"0\");\n" + |
4304 |
" foo(\"0\");\n" + |
4381 |
" ^^^^^^^^\n" + |
4305 |
" ^^^^^^^^\n" + |
4382 |
"No enclosing instance of the type X is accessible in scope\n" + |
4306 |
"No enclosing instance of the type X is accessible in scope\n" + |
4383 |
"----------\n" + |
|
|
4384 |
"2. WARNING in X.java (at line 13)\n" + |
4385 |
" void baz() {\n" + |
4386 |
" ^^^^^\n" + |
4387 |
"The method baz() from the type new Object(){} is never used locally\n" + |
4388 |
"----------\n" + |
4389 |
"3. WARNING in X.java (at line 18)\n" + |
4390 |
" void baz() {\n" + |
4391 |
" ^^^^^\n" + |
4392 |
"The method baz() from the type Local is never used locally\n" + |
4393 |
"----------\n" + |
4394 |
"4. WARNING in X.java (at line 35)\n" + |
4395 |
" void baz() {\n" + |
4396 |
" ^^^^^\n" + |
4397 |
"The method baz() from the type new Object(){} is never used locally\n" + |
4398 |
"----------\n"); |
4307 |
"----------\n"); |
4399 |
return; |
4308 |
return; |
4400 |
} |
4309 |
} |
Lines 4493-4537
Link Here
|
4493 |
"}\n", |
4402 |
"}\n", |
4494 |
}, |
4403 |
}, |
4495 |
"----------\n" + |
4404 |
"----------\n" + |
4496 |
"1. WARNING in X.java (at line 7)\n" + |
4405 |
"1. ERROR in X.java (at line 10)\n" + |
4497 |
" void baz() {\n" + |
|
|
4498 |
" ^^^^^\n" + |
4499 |
"The method baz() from the type new Object(){} is never used locally\n" + |
4500 |
"----------\n" + |
4501 |
"2. WARNING in X.java (at line 9)\n" + |
4502 |
" void baz() {\n" + |
4503 |
" ^^^^^\n" + |
4504 |
"The method baz() from the type new Object(){} is never used locally\n" + |
4505 |
"----------\n" + |
4506 |
"3. ERROR in X.java (at line 10)\n" + |
4507 |
" foo(); //0\n" + |
4406 |
" foo(); //0\n" + |
4508 |
" ^^^^^\n" + |
4407 |
" ^^^^^\n" + |
4509 |
"No enclosing instance of the type X is accessible in scope\n" + |
4408 |
"No enclosing instance of the type X is accessible in scope\n" + |
4510 |
"----------\n" + |
4409 |
"----------\n" + |
4511 |
"4. WARNING in X.java (at line 14)\n" + |
4410 |
"2. ERROR in X.java (at line 15)\n" + |
4512 |
" void baz() {\n" + |
|
|
4513 |
" ^^^^^\n" + |
4514 |
"The method baz() from the type Local is never used locally\n" + |
4515 |
"----------\n" + |
4516 |
"5. ERROR in X.java (at line 15)\n" + |
4517 |
" foo(); //1\n" + |
4411 |
" foo(); //1\n" + |
4518 |
" ^^^^^\n" + |
4412 |
" ^^^^^\n" + |
4519 |
"No enclosing instance of the type X is accessible in scope\n" + |
4413 |
"No enclosing instance of the type X is accessible in scope\n" + |
4520 |
"----------\n" + |
4414 |
"----------\n" + |
4521 |
"6. ERROR in X.java (at line 19)\n" + |
4415 |
"3. ERROR in X.java (at line 19)\n" + |
4522 |
" foo();//2\n" + |
4416 |
" foo();//2\n" + |
4523 |
" ^^^^^\n" + |
4417 |
" ^^^^^\n" + |
4524 |
"No enclosing instance of the type X is accessible in scope\n" + |
4418 |
"No enclosing instance of the type X is accessible in scope\n" + |
4525 |
"----------\n" + |
|
|
4526 |
"7. WARNING in X.java (at line 23)\n" + |
4527 |
" void baz() {\n" + |
4528 |
" ^^^^^\n" + |
4529 |
"The method baz() from the type new Object(){} is never used locally\n" + |
4530 |
"----------\n" + |
4531 |
"8. WARNING in X.java (at line 32)\n" + |
4532 |
" void baz() {\n" + |
4533 |
" ^^^^^\n" + |
4534 |
"The method baz() from the type new Object(){} is never used locally\n" + |
4535 |
"----------\n"); |
4419 |
"----------\n"); |
4536 |
return; |
4420 |
return; |
4537 |
} |
4421 |
} |
Lines 4574-4603
Link Here
|
4574 |
"}\n", |
4458 |
"}\n", |
4575 |
}, |
4459 |
}, |
4576 |
"----------\n" + |
4460 |
"----------\n" + |
4577 |
"1. WARNING in X.java (at line 7)\n" + |
4461 |
"1. ERROR in X.java (at line 10)\n" + |
4578 |
" void baz() {\n" + |
|
|
4579 |
" ^^^^^\n" + |
4580 |
"The method baz() from the type new Object(){} is never used locally\n" + |
4581 |
"----------\n" + |
4582 |
"2. WARNING in X.java (at line 9)\n" + |
4583 |
" void baz() {\n" + |
4584 |
" ^^^^^\n" + |
4585 |
"The method baz() from the type Local is never used locally\n" + |
4586 |
"----------\n" + |
4587 |
"3. ERROR in X.java (at line 10)\n" + |
4588 |
" foo(); //1\n" + |
4462 |
" foo(); //1\n" + |
4589 |
" ^^^^^\n" + |
4463 |
" ^^^^^\n" + |
4590 |
"No enclosing instance of the type X is accessible in scope\n" + |
4464 |
"No enclosing instance of the type X is accessible in scope\n" + |
4591 |
"----------\n" + |
|
|
4592 |
"4. WARNING in X.java (at line 18)\n" + |
4593 |
" void baz() {\n" + |
4594 |
" ^^^^^\n" + |
4595 |
"The method baz() from the type new Object(){} is never used locally\n" + |
4596 |
"----------\n" + |
4597 |
"5. WARNING in X.java (at line 27)\n" + |
4598 |
" void baz() {\n" + |
4599 |
" ^^^^^\n" + |
4600 |
"The method baz() from the type new Object(){} is never used locally\n" + |
4601 |
"----------\n"); |
4465 |
"----------\n"); |
4602 |
} |
4466 |
} |
4603 |
public void test121() { |
4467 |
public void test121() { |
Lines 5338-5367
Link Here
|
5338 |
"}", // ================= |
5202 |
"}", // ================= |
5339 |
}, |
5203 |
}, |
5340 |
"----------\n" + |
5204 |
"----------\n" + |
5341 |
"1. WARNING in X.java (at line 3)\n" + |
5205 |
"1. WARNING in X.java (at line 6)\n" + |
5342 |
" class Local {}\n" + |
|
|
5343 |
" ^^^^^\n" + |
5344 |
"The type Local is never used locally\n" + |
5345 |
"----------\n" + |
5346 |
"2. WARNING in X.java (at line 4)\n" + |
5347 |
" class Foo {\n" + |
5348 |
" ^^^\n" + |
5349 |
"The type Foo is never used locally\n" + |
5350 |
"----------\n" + |
5351 |
"3. WARNING in X.java (at line 5)\n" + |
5352 |
" void foo() {\n" + |
5353 |
" ^^^^^\n" + |
5354 |
"The method foo() from the type Foo is never used locally\n" + |
5355 |
"----------\n" + |
5356 |
"4. WARNING in X.java (at line 6)\n" + |
5357 |
" class Local {}\n" + |
5206 |
" class Local {}\n" + |
5358 |
" ^^^^^\n" + |
5207 |
" ^^^^^\n" + |
5359 |
"The type Local is hiding the type Local\n" + |
5208 |
"The type Local is hiding the type Local\n" + |
5360 |
"----------\n" + |
|
|
5361 |
"5. WARNING in X.java (at line 6)\n" + |
5362 |
" class Local {}\n" + |
5363 |
" ^^^^^\n" + |
5364 |
"The type Local is never used locally\n" + |
5365 |
"----------\n", |
5209 |
"----------\n", |
5366 |
"", |
5210 |
"", |
5367 |
"", |
5211 |
"", |
Lines 5568-5579
Link Here
|
5568 |
"}", // =================, |
5412 |
"}", // =================, |
5569 |
}, |
5413 |
}, |
5570 |
"----------\n" + |
5414 |
"----------\n" + |
5571 |
"1. WARNING in p\\X.java (at line 5)\n" + |
5415 |
"1. ERROR in p\\X.java (at line 11)\n" + |
5572 |
" String variable = \"my testing\";\n" + |
|
|
5573 |
" ^^^^^^^^\n" + |
5574 |
"The field X.Outer.Inner.variable is never read locally\n" + |
5575 |
"----------\n" + |
5576 |
"2. ERROR in p\\X.java (at line 11)\n" + |
5577 |
" Zork z;\n" + |
5416 |
" Zork z;\n" + |
5578 |
" ^^^^\n" + |
5417 |
" ^^^^\n" + |
5579 |
"Zork cannot be resolved to a type\n" + |
5418 |
"Zork cannot be resolved to a type\n" + |
Lines 5627-5638
Link Here
|
5627 |
"}", // =================, |
5466 |
"}", // =================, |
5628 |
}, |
5467 |
}, |
5629 |
"----------\n" + |
5468 |
"----------\n" + |
5630 |
"1. WARNING in p\\X.java (at line 4)\n" + |
5469 |
"1. ERROR in p\\X.java (at line 12)\n" + |
5631 |
" String variable = \"my testing\";\n" + |
|
|
5632 |
" ^^^^^^^^\n" + |
5633 |
"The field X.Outer.Inner.variable is never read locally\n" + |
5634 |
"----------\n" + |
5635 |
"2. ERROR in p\\X.java (at line 12)\n" + |
5636 |
" Zork z;\n" + |
5470 |
" Zork z;\n" + |
5637 |
" ^^^^\n" + |
5471 |
" ^^^^\n" + |
5638 |
"Zork cannot be resolved to a type\n" + |
5472 |
"Zork cannot be resolved to a type\n" + |
Lines 6077-6118
Link Here
|
6077 |
"}", // ================= |
5911 |
"}", // ================= |
6078 |
}, |
5912 |
}, |
6079 |
"----------\n" + |
5913 |
"----------\n" + |
6080 |
"1. WARNING in X.java (at line 6)\n" + |
5914 |
"1. ERROR in X.java (at line 15)\n" + |
6081 |
" private static class B2F extends X { }\n" + |
|
|
6082 |
" ^^^\n" + |
6083 |
"The type X.B2F is never used locally\n" + |
6084 |
"----------\n" + |
6085 |
"2. WARNING in X.java (at line 7)\n" + |
6086 |
" private static class F2B extends X { }\n" + |
6087 |
" ^^^\n" + |
6088 |
"The type X.F2B is never used locally\n" + |
6089 |
"----------\n" + |
6090 |
"3. WARNING in X.java (at line 13)\n" + |
6091 |
" private static class B2F extends Key {\n" + |
6092 |
" ^^^\n" + |
6093 |
"The type X.Key.B2F is never used locally\n" + |
6094 |
"----------\n" + |
6095 |
"4. WARNING in X.java (at line 14)\n" + |
6096 |
" private static B2F create() { return new B2F(); }\n" + |
6097 |
" ^^^^^^^^\n" + |
6098 |
"The method create() from the type X.Key.B2F is never used locally\n" + |
6099 |
"----------\n" + |
6100 |
"5. ERROR in X.java (at line 15)\n" + |
6101 |
" public Key flip() { return F2B.create(); }\n" + |
5915 |
" public Key flip() { return F2B.create(); }\n" + |
6102 |
" ^^^\n" + |
5916 |
" ^^^\n" + |
6103 |
"The type F2B is defined in an inherited type and an enclosing scope\n" + |
5917 |
"The type F2B is defined in an inherited type and an enclosing scope\n" + |
6104 |
"----------\n" + |
5918 |
"----------\n" + |
6105 |
"6. WARNING in X.java (at line 18)\n" + |
5919 |
"2. ERROR in X.java (at line 20)\n" + |
6106 |
" private static class F2B extends Key {\n" + |
|
|
6107 |
" ^^^\n" + |
6108 |
"The type X.Key.F2B is never used locally\n" + |
6109 |
"----------\n" + |
6110 |
"7. WARNING in X.java (at line 19)\n" + |
6111 |
" private static F2B create() { return new F2B(); }\n" + |
6112 |
" ^^^^^^^^\n" + |
6113 |
"The method create() from the type X.Key.F2B is never used locally\n" + |
6114 |
"----------\n" + |
6115 |
"8. ERROR in X.java (at line 20)\n" + |
6116 |
" public Key flip() { return B2F.create(); }\n" + |
5920 |
" public Key flip() { return B2F.create(); }\n" + |
6117 |
" ^^^\n" + |
5921 |
" ^^^\n" + |
6118 |
"The type B2F is defined in an inherited type and an enclosing scope\n" + |
5922 |
"The type B2F is defined in an inherited type and an enclosing scope\n" + |
Lines 6211-6232
Link Here
|
6211 |
"}", // ================= |
6015 |
"}", // ================= |
6212 |
}, |
6016 |
}, |
6213 |
"----------\n" + |
6017 |
"----------\n" + |
6214 |
"1. WARNING in X.java (at line 14)\n" + |
6018 |
"1. ERROR in X.java (at line 15)\n" + |
6215 |
" private static B2F create() { return new B2F(); }\n" + |
|
|
6216 |
" ^^^^^^^^\n" + |
6217 |
"The method create() from the type X.Key.B2F is never used locally\n" + |
6218 |
"----------\n" + |
6219 |
"2. ERROR in X.java (at line 15)\n" + |
6220 |
" public Key flip() { return F2B.create(); }\n" + |
6019 |
" public Key flip() { return F2B.create(); }\n" + |
6221 |
" ^^^\n" + |
6020 |
" ^^^\n" + |
6222 |
"The type F2B is defined in an inherited type and an enclosing scope\n" + |
6021 |
"The type F2B is defined in an inherited type and an enclosing scope\n" + |
6223 |
"----------\n" + |
6022 |
"----------\n" + |
6224 |
"3. WARNING in X.java (at line 19)\n" + |
6023 |
"2. ERROR in X.java (at line 20)\n" + |
6225 |
" private static F2B create() { return new F2B(); }\n" + |
|
|
6226 |
" ^^^^^^^^\n" + |
6227 |
"The method create() from the type X.Key.F2B is never used locally\n" + |
6228 |
"----------\n" + |
6229 |
"4. ERROR in X.java (at line 20)\n" + |
6230 |
" public Key flip() { return B2F.create(); }\n" + |
6024 |
" public Key flip() { return B2F.create(); }\n" + |
6231 |
" ^^^\n" + |
6025 |
" ^^^\n" + |
6232 |
"The type B2F is defined in an inherited type and an enclosing scope\n" + |
6026 |
"The type B2F is defined in an inherited type and an enclosing scope\n" + |
Lines 6324-6355
Link Here
|
6324 |
"}", // ================= |
6118 |
"}", // ================= |
6325 |
}, |
6119 |
}, |
6326 |
"----------\n" + |
6120 |
"----------\n" + |
6327 |
"1. WARNING in X.java (at line 11)\n" + |
6121 |
"1. ERROR in X.java (at line 16)\n" + |
6328 |
" private class Test5 {\n" + |
|
|
6329 |
" ^^^^^\n" + |
6330 |
"The type X.Test5 is never used locally\n" + |
6331 |
"----------\n" + |
6332 |
"2. WARNING in X.java (at line 12)\n" + |
6333 |
" private class Test4 extends Test2 {\n" + |
6334 |
" ^^^^^\n" + |
6335 |
"The type X.Test5.Test4 is never used locally\n" + |
6336 |
"----------\n" + |
6337 |
"3. ERROR in X.java (at line 16)\n" + |
6338 |
" System.out.println(X.this.var1.trim());\n" + |
6122 |
" System.out.println(X.this.var1.trim());\n" + |
6339 |
" ^^^^^^\n" + |
6123 |
" ^^^^^^\n" + |
6340 |
"No enclosing instance of the type X is accessible in scope\n" + |
6124 |
"No enclosing instance of the type X is accessible in scope\n" + |
6341 |
"----------\n" + |
6125 |
"----------\n" + |
6342 |
"4. WARNING in X.java (at line 16)\n" + |
6126 |
"2. WARNING in X.java (at line 16)\n" + |
6343 |
" System.out.println(X.this.var1.trim());\n" + |
6127 |
" System.out.println(X.this.var1.trim());\n" + |
6344 |
" ^^^^\n" + |
6128 |
" ^^^^\n" + |
6345 |
"Read access to enclosing field X.var1 is emulated by a synthetic accessor method\n" + |
6129 |
"Read access to enclosing field X.var1 is emulated by a synthetic accessor method\n" + |
6346 |
"----------\n" + |
6130 |
"----------\n" + |
6347 |
"5. WARNING in X.java (at line 17)\n" + |
6131 |
"3. WARNING in X.java (at line 17)\n" + |
6348 |
" System.out.println(var1.trim());\n" + |
6132 |
" System.out.println(var1.trim());\n" + |
6349 |
" ^^^^\n" + |
6133 |
" ^^^^\n" + |
6350 |
"Read access to enclosing field X.var1 is emulated by a synthetic accessor method\n" + |
6134 |
"Read access to enclosing field X.var1 is emulated by a synthetic accessor method\n" + |
6351 |
"----------\n" + |
6135 |
"----------\n" + |
6352 |
"6. ERROR in X.java (at line 17)\n" + |
6136 |
"4. ERROR in X.java (at line 17)\n" + |
6353 |
" System.out.println(var1.trim());\n" + |
6137 |
" System.out.println(var1.trim());\n" + |
6354 |
" ^^^^\n" + |
6138 |
" ^^^^\n" + |
6355 |
"No enclosing instance of the type X is accessible in scope\n" + |
6139 |
"No enclosing instance of the type X is accessible in scope\n" + |
Lines 6417-6443
Link Here
|
6417 |
"}", // ================= |
6201 |
"}", // ================= |
6418 |
}, |
6202 |
}, |
6419 |
"----------\n" + |
6203 |
"----------\n" + |
6420 |
"1. WARNING in X.java (at line 12)\n" + |
6204 |
"1. ERROR in X.java (at line 16)\n" + |
6421 |
" private class Test4 extends Test2 {\n" + |
|
|
6422 |
" ^^^^^\n" + |
6423 |
"The type X.Test4 is never used locally\n" + |
6424 |
"----------\n" + |
6425 |
"2. ERROR in X.java (at line 16)\n" + |
6426 |
" System.out.println(X.this.var1.trim());\n" + |
6205 |
" System.out.println(X.this.var1.trim());\n" + |
6427 |
" ^^^^^^\n" + |
6206 |
" ^^^^^^\n" + |
6428 |
"No enclosing instance of the type X is accessible in scope\n" + |
6207 |
"No enclosing instance of the type X is accessible in scope\n" + |
6429 |
"----------\n" + |
6208 |
"----------\n" + |
6430 |
"3. WARNING in X.java (at line 16)\n" + |
6209 |
"2. WARNING in X.java (at line 16)\n" + |
6431 |
" System.out.println(X.this.var1.trim());\n" + |
6210 |
" System.out.println(X.this.var1.trim());\n" + |
6432 |
" ^^^^\n" + |
6211 |
" ^^^^\n" + |
6433 |
"Read access to enclosing field X.var1 is emulated by a synthetic accessor method\n" + |
6212 |
"Read access to enclosing field X.var1 is emulated by a synthetic accessor method\n" + |
6434 |
"----------\n" + |
6213 |
"----------\n" + |
6435 |
"4. WARNING in X.java (at line 17)\n" + |
6214 |
"3. WARNING in X.java (at line 17)\n" + |
6436 |
" System.out.println(var1.trim());\n" + |
6215 |
" System.out.println(var1.trim());\n" + |
6437 |
" ^^^^\n" + |
6216 |
" ^^^^\n" + |
6438 |
"Read access to enclosing field X.var1 is emulated by a synthetic accessor method\n" + |
6217 |
"Read access to enclosing field X.var1 is emulated by a synthetic accessor method\n" + |
6439 |
"----------\n" + |
6218 |
"----------\n" + |
6440 |
"5. ERROR in X.java (at line 17)\n" + |
6219 |
"4. ERROR in X.java (at line 17)\n" + |
6441 |
" System.out.println(var1.trim());\n" + |
6220 |
" System.out.println(var1.trim());\n" + |
6442 |
" ^^^^\n" + |
6221 |
" ^^^^\n" + |
6443 |
"No enclosing instance of the type X is accessible in scope\n" + |
6222 |
"No enclosing instance of the type X is accessible in scope\n" + |
Lines 7036-7062
Link Here
|
7036 |
"}\n", |
6815 |
"}\n", |
7037 |
}, |
6816 |
}, |
7038 |
"----------\n" + |
6817 |
"----------\n" + |
7039 |
"1. WARNING in X.java (at line 4)\n" + |
6818 |
"1. WARNING in X.java (at line 8)\n" + |
7040 |
" private void c() {}\n" + |
|
|
7041 |
" ^^^\n" + |
7042 |
"The method c() from the type X is never used locally\n" + |
7043 |
"----------\n" + |
7044 |
"2. WARNING in X.java (at line 8)\n" + |
7045 |
" a(null);\n" + |
6819 |
" a(null);\n" + |
7046 |
" ^^^^^^^\n" + |
6820 |
" ^^^^^^^\n" + |
7047 |
"Access to enclosing method a(String) from the type X is emulated by a synthetic accessor method\n" + |
6821 |
"Access to enclosing method a(String) from the type X is emulated by a synthetic accessor method\n" + |
7048 |
"----------\n" + |
6822 |
"----------\n" + |
7049 |
"3. WARNING in X.java (at line 9)\n" + |
6823 |
"2. WARNING in X.java (at line 9)\n" + |
7050 |
" c(null);\n" + |
6824 |
" c(null);\n" + |
7051 |
" ^^^^^^^\n" + |
6825 |
" ^^^^^^^\n" + |
7052 |
"Access to enclosing method c(String) from the type X is emulated by a synthetic accessor method\n" + |
6826 |
"Access to enclosing method c(String) from the type X is emulated by a synthetic accessor method\n" + |
7053 |
"----------\n" + |
6827 |
"----------\n" + |
7054 |
"4. WARNING in X.java (at line 14)\n" + |
6828 |
"3. WARNING in X.java (at line 14)\n" + |
7055 |
" a(null);\n" + |
6829 |
" a(null);\n" + |
7056 |
" ^^^^^^^\n" + |
6830 |
" ^^^^^^^\n" + |
7057 |
"Access to enclosing method a(String) from the type X is emulated by a synthetic accessor method\n" + |
6831 |
"Access to enclosing method a(String) from the type X is emulated by a synthetic accessor method\n" + |
7058 |
"----------\n" + |
6832 |
"----------\n" + |
7059 |
"5. WARNING in X.java (at line 15)\n" + |
6833 |
"4. WARNING in X.java (at line 15)\n" + |
7060 |
" c(null);\n" + |
6834 |
" c(null);\n" + |
7061 |
" ^^^^^^^\n" + |
6835 |
" ^^^^^^^\n" + |
7062 |
"Access to enclosing method c(String) from the type X is emulated by a synthetic accessor method\n" + |
6836 |
"Access to enclosing method c(String) from the type X is emulated by a synthetic accessor method\n" + |