test/tools/javac/varargs/7097436/T7097436.java

Mon, 16 Sep 2013 14:13:44 +0200

author
jlahoda
date
Mon, 16 Sep 2013 14:13:44 +0200
changeset 2028
4ce8148ffc4f
parent 0
959103a6100f
permissions
-rw-r--r--

8021112: Spurious unchecked warning reported by javac
6480588: No way to suppress deprecation warnings when implementing deprecated interface
Summary: Fixing DeferredLintHandler configuration, so lint warnings are reported with correct @SuppressWarnings settings
Reviewed-by: jjg, vromero

     1 /*
     2  * @test /nodynamiccopyright/
     3  * @bug     7097436
     4  * @summary  ClassCastException occurs in assignment expressions without any heap pollutions
     5  * @compile/fail/ref=T7097436.out -Xlint:varargs -Werror -XDrawDiagnostics T7097436.java
     6  */
     8 import java.util.List;
    10 class T7097436 {
    11     @SafeVarargs
    12     static void m(List<String>... ls) {
    13         Object o = ls; //warning
    14         Object[] oArr = ls; //warning
    15         String s = ls; // no warning
    16         Integer[] iArr = ls; // no warning
    17     }
    18 }

mercurial