langtools/test/tools/javac/varargs/6993978/T6993978neg.java
author mcimadamore
Mon, 13 Dec 2010 15:11:00 -0800
changeset 7643 a067a0cda531
permissions -rw-r--r--
6993978: Project Coin: Compiler support of annotation to reduce varargs warnings Reviewed-by: jjg, darcy
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7643
a067a0cda531 6993978: Project Coin: Compiler support of annotation to reduce varargs warnings
mcimadamore
parents:
diff changeset
     1
/*
a067a0cda531 6993978: Project Coin: Compiler support of annotation to reduce varargs warnings
mcimadamore
parents:
diff changeset
     2
 * @test /nodynamiccopyright/
a067a0cda531 6993978: Project Coin: Compiler support of annotation to reduce varargs warnings
mcimadamore
parents:
diff changeset
     3
 * @bug     6993978
a067a0cda531 6993978: Project Coin: Compiler support of annotation to reduce varargs warnings
mcimadamore
parents:
diff changeset
     4
 * @author mcimadamore
a067a0cda531 6993978: Project Coin: Compiler support of annotation to reduce varargs warnings
mcimadamore
parents:
diff changeset
     5
 * @summary  ClassCastException occurs in assignment expressions without any heap pollutions
a067a0cda531 6993978: Project Coin: Compiler support of annotation to reduce varargs warnings
mcimadamore
parents:
diff changeset
     6
 * @compile/fail/ref=T6993978neg.out -Xlint:unchecked -Werror -XDrawDiagnostics T6993978neg.java
a067a0cda531 6993978: Project Coin: Compiler support of annotation to reduce varargs warnings
mcimadamore
parents:
diff changeset
     7
 */
a067a0cda531 6993978: Project Coin: Compiler support of annotation to reduce varargs warnings
mcimadamore
parents:
diff changeset
     8
a067a0cda531 6993978: Project Coin: Compiler support of annotation to reduce varargs warnings
mcimadamore
parents:
diff changeset
     9
import java.util.List;
a067a0cda531 6993978: Project Coin: Compiler support of annotation to reduce varargs warnings
mcimadamore
parents:
diff changeset
    10
a067a0cda531 6993978: Project Coin: Compiler support of annotation to reduce varargs warnings
mcimadamore
parents:
diff changeset
    11
class T6993978neg {
a067a0cda531 6993978: Project Coin: Compiler support of annotation to reduce varargs warnings
mcimadamore
parents:
diff changeset
    12
   @SuppressWarnings({"varargs","unchecked"})
a067a0cda531 6993978: Project Coin: Compiler support of annotation to reduce varargs warnings
mcimadamore
parents:
diff changeset
    13
   static <X> void m(X... x) {  }
a067a0cda531 6993978: Project Coin: Compiler support of annotation to reduce varargs warnings
mcimadamore
parents:
diff changeset
    14
   static void test(List<String> ls) {
a067a0cda531 6993978: Project Coin: Compiler support of annotation to reduce varargs warnings
mcimadamore
parents:
diff changeset
    15
       m(ls); //compiler should still give unchecked here
a067a0cda531 6993978: Project Coin: Compiler support of annotation to reduce varargs warnings
mcimadamore
parents:
diff changeset
    16
   }
a067a0cda531 6993978: Project Coin: Compiler support of annotation to reduce varargs warnings
mcimadamore
parents:
diff changeset
    17
}