Lines 3223-3228
Link Here
|
3223 |
|
3223 |
|
3224 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=85900 |
3224 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=85900 |
3225 |
public void test048() { |
3225 |
public void test048() { |
|
|
3226 |
if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; // see test187() |
3226 |
this.runConformTest( |
3227 |
this.runConformTest( |
3227 |
new String[] { |
3228 |
new String[] { |
3228 |
"X1.java", |
3229 |
"X1.java", |
Lines 3236-3241
Link Here
|
3236 |
} |
3237 |
} |
3237 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=85900 |
3238 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=85900 |
3238 |
public void test048a() { |
3239 |
public void test048a() { |
|
|
3240 |
if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; // see test187() |
3239 |
this.runConformTest( |
3241 |
this.runConformTest( |
3240 |
new String[] { |
3242 |
new String[] { |
3241 |
"X2.java", |
3243 |
"X2.java", |
Lines 3278-3283
Link Here
|
3278 |
} |
3280 |
} |
3279 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=85900 |
3281 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=85900 |
3280 |
public void test048c() { |
3282 |
public void test048c() { |
|
|
3283 |
if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; // see test187() |
3281 |
this.runConformTest( |
3284 |
this.runConformTest( |
3282 |
new String[] { |
3285 |
new String[] { |
3283 |
"X4.java", |
3286 |
"X4.java", |
Lines 3296-3301
Link Here
|
3296 |
} |
3299 |
} |
3297 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=85900 |
3300 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=85900 |
3298 |
public void test048d() { |
3301 |
public void test048d() { |
|
|
3302 |
if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; // see test187() |
3299 |
this.runConformTest( |
3303 |
this.runConformTest( |
3300 |
new String[] { |
3304 |
new String[] { |
3301 |
"X5.java", |
3305 |
"X5.java", |
Lines 3314-3319
Link Here
|
3314 |
} |
3318 |
} |
3315 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=85900 |
3319 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=85900 |
3316 |
public void test048e() { |
3320 |
public void test048e() { |
|
|
3321 |
if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; // see test187() |
3317 |
this.runConformTest( |
3322 |
this.runConformTest( |
3318 |
new String[] { |
3323 |
new String[] { |
3319 |
"X6.java", |
3324 |
"X6.java", |
Lines 3332-3337
Link Here
|
3332 |
} |
3337 |
} |
3333 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=85900 |
3338 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=85900 |
3334 |
public void test048f() { |
3339 |
public void test048f() { |
|
|
3340 |
if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; // see test187() |
3335 |
this.runConformTest( |
3341 |
this.runConformTest( |
3336 |
new String[] { |
3342 |
new String[] { |
3337 |
"X7.java", |
3343 |
"X7.java", |
Lines 3433-3438
Link Here
|
3433 |
|
3439 |
|
3434 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=94754 |
3440 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=94754 |
3435 |
public void test050() { |
3441 |
public void test050() { |
|
|
3442 |
if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; // see test187() |
3436 |
this.runConformTest( |
3443 |
this.runConformTest( |
3437 |
new String[] { |
3444 |
new String[] { |
3438 |
"X.java", |
3445 |
"X.java", |
Lines 3453-3458
Link Here
|
3453 |
} |
3460 |
} |
3454 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=94754 |
3461 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=94754 |
3455 |
public void test050a() { |
3462 |
public void test050a() { |
|
|
3463 |
if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; // see test187() |
3456 |
this.runNegativeTest( |
3464 |
this.runNegativeTest( |
3457 |
new String[] { |
3465 |
new String[] { |
3458 |
"X.java", |
3466 |
"X.java", |
Lines 3484-3489
Link Here
|
3484 |
|
3492 |
|
3485 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=90423 - variation |
3493 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=90423 - variation |
3486 |
public void test050b() { |
3494 |
public void test050b() { |
|
|
3495 |
if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; // see test187() |
3487 |
this.runNegativeTest( |
3496 |
this.runNegativeTest( |
3488 |
new String[] { |
3497 |
new String[] { |
3489 |
"X.java", |
3498 |
"X.java", |
Lines 3547-3552
Link Here
|
3547 |
} |
3556 |
} |
3548 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=90423 - variation |
3557 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=90423 - variation |
3549 |
public void test050c() { |
3558 |
public void test050c() { |
|
|
3559 |
if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; // see test187() |
3550 |
this.runNegativeTest( |
3560 |
this.runNegativeTest( |
3551 |
new String[] { |
3561 |
new String[] { |
3552 |
"X.java", |
3562 |
"X.java", |
Lines 3580-3585
Link Here
|
3580 |
} |
3590 |
} |
3581 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=90423 - variation |
3591 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=90423 - variation |
3582 |
public void test050d() { |
3592 |
public void test050d() { |
|
|
3593 |
if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; // see test187() |
3583 |
this.runConformTest( |
3594 |
this.runConformTest( |
3584 |
new String[] { |
3595 |
new String[] { |
3585 |
"X.java", |
3596 |
"X.java", |
Lines 3599-3604
Link Here
|
3599 |
|
3610 |
|
3600 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=90423 |
3611 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=90423 |
3601 |
public void test050e() { |
3612 |
public void test050e() { |
|
|
3613 |
if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; // see test187() |
3602 |
this.runConformTest( |
3614 |
this.runConformTest( |
3603 |
new String[] { |
3615 |
new String[] { |
3604 |
"X.java", |
3616 |
"X.java", |
Lines 3697-3702
Link Here
|
3697 |
|
3709 |
|
3698 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=90423 |
3710 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=90423 |
3699 |
public void test050i() { |
3711 |
public void test050i() { |
|
|
3712 |
if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; // see test187() |
3700 |
this.runConformTest( |
3713 |
this.runConformTest( |
3701 |
new String[] { |
3714 |
new String[] { |
3702 |
"X.java", |
3715 |
"X.java", |
Lines 3878-3883
Link Here
|
3878 |
} |
3891 |
} |
3879 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=89470 |
3892 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=89470 |
3880 |
public void test051b() { |
3893 |
public void test051b() { |
|
|
3894 |
if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; // see test187() |
3881 |
this.runConformTest( |
3895 |
this.runConformTest( |
3882 |
new String[] { |
3896 |
new String[] { |
3883 |
"X.java", |
3897 |
"X.java", |
Lines 4028-4033
Link Here
|
4028 |
} |
4042 |
} |
4029 |
// more duplicate tests, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=94897 |
4043 |
// more duplicate tests, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=94897 |
4030 |
public void test054a() { |
4044 |
public void test054a() { |
|
|
4045 |
if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; // see test187() |
4031 |
this.runNegativeTest( |
4046 |
this.runNegativeTest( |
4032 |
new String[] { |
4047 |
new String[] { |
4033 |
"X.java", |
4048 |
"X.java", |
Lines 4059-4064
Link Here
|
4059 |
} |
4074 |
} |
4060 |
// more duplicate tests, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=94897 |
4075 |
// more duplicate tests, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=94897 |
4061 |
public void test054b() { |
4076 |
public void test054b() { |
|
|
4077 |
if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; // see test187() |
4062 |
this.runConformTest( |
4078 |
this.runConformTest( |
4063 |
new String[] { |
4079 |
new String[] { |
4064 |
"X.java", |
4080 |
"X.java", |
Lines 4096-4101
Link Here
|
4096 |
} |
4112 |
} |
4097 |
// more duplicate tests, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=94897 |
4113 |
// more duplicate tests, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=94897 |
4098 |
public void test054d() { |
4114 |
public void test054d() { |
|
|
4115 |
if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; // see test187() |
4099 |
this.runConformTest( |
4116 |
this.runConformTest( |
4100 |
new String[] { |
4117 |
new String[] { |
4101 |
"X.java", |
4118 |
"X.java", |
Lines 4216-4221
Link Here
|
4216 |
} |
4233 |
} |
4217 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=94898 |
4234 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=94898 |
4218 |
public void test058a() { |
4235 |
public void test058a() { |
|
|
4236 |
if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; // see test187() |
4219 |
this.runNegativeTest( |
4237 |
this.runNegativeTest( |
4220 |
new String[] { |
4238 |
new String[] { |
4221 |
"X.java", |
4239 |
"X.java", |
Lines 4246-4251
Link Here
|
4246 |
} |
4264 |
} |
4247 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=94898 |
4265 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=94898 |
4248 |
public void test058b() { |
4266 |
public void test058b() { |
|
|
4267 |
if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; // see test187() |
4249 |
this.runNegativeTest( |
4268 |
this.runNegativeTest( |
4250 |
new String[] { |
4269 |
new String[] { |
4251 |
"X.java", |
4270 |
"X.java", |
Lines 6209-6214
Link Here
|
6209 |
|
6228 |
|
6210 |
// name conflict |
6229 |
// name conflict |
6211 |
public void test101() { |
6230 |
public void test101() { |
|
|
6231 |
if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; // see test187() |
6212 |
this.runNegativeTest( |
6232 |
this.runNegativeTest( |
6213 |
new String[] { |
6233 |
new String[] { |
6214 |
"X.java", |
6234 |
"X.java", |
Lines 7293-7298
Link Here
|
7293 |
} |
7313 |
} |
7294 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=202830 |
7314 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=202830 |
7295 |
public void test120a() { |
7315 |
public void test120a() { |
|
|
7316 |
if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) return; // see test187() |
7296 |
this.runConformTest( |
7317 |
this.runConformTest( |
7297 |
new String[] { |
7318 |
new String[] { |
7298 |
"Bar.java", |
7319 |
"Bar.java", |
Lines 8992-8998
Link Here
|
8992 |
|
9013 |
|
8993 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=251091 |
9014 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=251091 |
8994 |
public void test177() { |
9015 |
public void test177() { |
8995 |
if (new CompilerOptions(getCompilerOptions()).sourceLevel >= ClassFileConstants.JDK1_6) { |
9016 |
if (new CompilerOptions(getCompilerOptions()).complianceLevel >= ClassFileConstants.JDK1_7) { // see test187() |
|
|
9017 |
this.runNegativeTest( |
9018 |
new String[] { |
9019 |
"X.java", |
9020 |
"import java.util.*;\n" + |
9021 |
"interface I { I foo(Collection<?> c); }\n" + |
9022 |
"class A extends LinkedHashMap {\n" + |
9023 |
" public A foo(Collection c) { return this; }\n" + |
9024 |
"}\n" + |
9025 |
"class X extends A implements I {\n" + |
9026 |
" @Override public X foo(Collection<?> c) { return this; }\n" + |
9027 |
"}" |
9028 |
}, |
9029 |
"----------\n" + |
9030 |
"1. WARNING in X.java (at line 3)\n" + |
9031 |
" class A extends LinkedHashMap {\n" + |
9032 |
" ^\n" + |
9033 |
"The serializable class A does not declare a static final serialVersionUID field of type long\n" + |
9034 |
"----------\n" + |
9035 |
"2. WARNING in X.java (at line 3)\n" + |
9036 |
" class A extends LinkedHashMap {\n" + |
9037 |
" ^^^^^^^^^^^^^\n" + |
9038 |
"LinkedHashMap is a raw type. References to generic type LinkedHashMap<K,V> should be parameterized\n" + |
9039 |
"----------\n" + |
9040 |
"3. WARNING in X.java (at line 4)\n" + |
9041 |
" public A foo(Collection c) { return this; }\n" + |
9042 |
" ^^^^^^^^^^\n" + |
9043 |
"Collection is a raw type. References to generic type Collection<E> should be parameterized\n" + |
9044 |
"----------\n" + |
9045 |
"4. ERROR in X.java (at line 6)\n" + |
9046 |
" class X extends A implements I {\n" + |
9047 |
" ^\n" + |
9048 |
"Name clash: The method foo(Collection<?>) of type I has the same erasure as foo(Collection) of type A but does not override it\n" + |
9049 |
"----------\n" + |
9050 |
"5. WARNING in X.java (at line 6)\n" + |
9051 |
" class X extends A implements I {\n" + |
9052 |
" ^\n" + |
9053 |
"The serializable class X does not declare a static final serialVersionUID field of type long\n" + |
9054 |
"----------\n" + |
9055 |
"6. ERROR in X.java (at line 7)\n" + |
9056 |
" @Override public X foo(Collection<?> c) { return this; }\n" + |
9057 |
" ^^^^^^^^^^^^^^^^^^^^\n" + |
9058 |
"Name clash: The method foo(Collection<?>) of type X has the same erasure as foo(Collection) of type A but does not override it\n" + |
9059 |
"----------\n" |
9060 |
); |
9061 |
} else if (new CompilerOptions(getCompilerOptions()).sourceLevel == ClassFileConstants.JDK1_6) { |
8996 |
this.runConformTest( |
9062 |
this.runConformTest( |
8997 |
new String[] { |
9063 |
new String[] { |
8998 |
"X.java", |
9064 |
"X.java", |
Lines 9506-9509
Link Here
|
9506 |
"----------\n" |
9572 |
"----------\n" |
9507 |
); |
9573 |
); |
9508 |
} |
9574 |
} |
|
|
9575 |
// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6182950 |
9576 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=? |
9577 |
public void test187() { |
9578 |
this.runNegativeTest( |
9579 |
new String[] { |
9580 |
"X.java", |
9581 |
"import java.util.*;\n" + |
9582 |
"class X {\n" + |
9583 |
" int f(List<String> l) {return 0;}\n" + |
9584 |
"}\n" + |
9585 |
"class Y extends X {\n" + |
9586 |
" double f(List<Integer> l) {return 0;}\n" + |
9587 |
"}\n" + |
9588 |
"interface I {\n" + |
9589 |
" double f(List<Integer> l);\n" + |
9590 |
"}\n" + |
9591 |
"abstract class Z extends X implements I {}\n" + |
9592 |
"class XX {\n" + |
9593 |
" int f(List<String> l) {return 0;}\n" + |
9594 |
"double f(List<Integer> l) {return 0;}\n" + |
9595 |
"}" |
9596 |
}, |
9597 |
new CompilerOptions(getCompilerOptions()).complianceLevel < ClassFileConstants.JDK1_7 |
9598 |
? "" |
9599 |
: "----------\n" + |
9600 |
"1. ERROR in X.java (at line 6)\n" + |
9601 |
" double f(List<Integer> l) {return 0;}\n" + |
9602 |
" ^^^^^^^^^^^^^^^^^^\n" + |
9603 |
"Name clash: The method f(List<Integer>) of type Y has the same erasure as f(List<String>) of type X but does not override it\n" + |
9604 |
"----------\n" + |
9605 |
"2. ERROR in X.java (at line 11)\n" + |
9606 |
" abstract class Z extends X implements I {}\n" + |
9607 |
" ^\n" + |
9608 |
"Name clash: The method f(List<String>) of type X has the same erasure as f(List<Integer>) of type I but does not override it\n" + |
9609 |
"----------\n" + |
9610 |
"3. ERROR in X.java (at line 13)\n" + |
9611 |
" int f(List<String> l) {return 0;}\n" + |
9612 |
" ^^^^^^^^^^^^^^^^^\n" + |
9613 |
"Method f(List<String>) has the same erasure f(List<E>) as another method in type XX\n" + |
9614 |
"----------\n" + |
9615 |
"4. ERROR in X.java (at line 14)\n" + |
9616 |
" double f(List<Integer> l) {return 0;}\n" + |
9617 |
" ^^^^^^^^^^^^^^^^^^\n" + |
9618 |
"Method f(List<Integer>) has the same erasure f(List<E>) as another method in type XX\n" + |
9619 |
"----------\n" |
9620 |
); |
9621 |
} |
9509 |
} |
9622 |
} |