Mon, 17 Oct 2011 12:54:33 +0100
7097436: Project Coin: duplicate varargs warnings on method annotated with @SafeVarargs
Summary: Duplicate aliasing check during subtyping leads to spurious varargs diagnostic
Reviewed-by: jjg
1 /*
2 * @test (important: no SCCS keywords to affect offsets in golden file.) /nodynamiccopyright/
3 * @bug 6304921
4 * @compile/fail/ref=T6304921.out -XDcompilePolicy=bytodo -XDrawDiagnostics -Xjcov -Xlint:all,-path -Werror T6304921.java
5 */
7 import java.util.ArrayList;
8 import java.util.List;
10 class T6304921 {
11 void m1(int i) {
12 switch (i) {
13 case 1:
14 i++;
15 // fallthrough
16 default:
17 }
19 try {
20 i++;
21 }
22 finally {
23 throw new Error();
24 // finally does not complete normally
25 }
26 }
28 void m2() {
29 List<Integer> list = new ArrayList();
30 }
31 }
33 class X {
34 void m1() {
35 System.orr.println("abc"); // name not found
36 }
37 boolean m2() {
38 return 123 + true; // bad binary expression
39 }
40 }