test/tools/javac/warnings/6594914/T6594914b.java

Thu, 03 Feb 2011 09:35:21 +0000

author
mcimadamore
date
Thu, 03 Feb 2011 09:35:21 +0000
changeset 852
899f7c3d9426
parent 0
959103a6100f
permissions
-rw-r--r--

6594914: @SuppressWarnings("deprecation") does not not work for the type of a variable
Summary: Lint warnings generated during MemberEnter might ignore @SuppressWarnings annotations
Reviewed-by: jjg

     1 /**
     2  * @test /nodynamiccopyright/
     3  * @bug 6594914
     4  * @summary \\@SuppressWarnings("deprecation") does not not work for the type of a variable
     5  * @compile/ref=T6594914b.out -XDenableSunApiLintControl -XDrawDiagnostics -Xlint:sunapi T6594914b.java
     6  */
     9 class T6747671b {
    11     sun.misc.Lock a1; //warn
    13     @SuppressWarnings("sunapi")
    14     sun.misc.Lock a2;
    16     <X extends sun.misc.Lock> sun.misc.Lock m1(sun.misc.Lock a)
    17             throws sun.misc.CEFormatException { return null; } //warn
    19     @SuppressWarnings("sunapi")
    20     <X extends sun.misc.Lock> sun.misc.Lock m2(sun.misc.Lock a)
    21             throws sun.misc.CEFormatException { return null; }
    23     void test() {
    24         sun.misc.Lock a1; //warn
    26         @SuppressWarnings("sunapi")
    27         sun.misc.Lock a2;
    28     }
    29 }

mercurial