test/tools/javac/warnings/6594914/T6594914a.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 6594914
     4  * @summary \\@SuppressWarnings("deprecation") does not not work for the type of a variable
     5  * @compile/ref=T6594914a.out -XDrawDiagnostics -Xlint:deprecation T6594914a.java
     6  */
     9 class T6747671a {
    11     DeprecatedClass a1; //warn
    13     @SuppressWarnings("deprecation")
    14     DeprecatedClass a2;
    16     <X extends DeprecatedClass> DeprecatedClass m1(DeprecatedClass a)
    17             throws DeprecatedClass { return null; } //warn
    19     @SuppressWarnings("deprecation")
    20     <X extends DeprecatedClass> DeprecatedClass m2(DeprecatedClass a)
    21             throws DeprecatedClass { return null; }
    23     void test() {
    24         DeprecatedClass a1; //warn
    26         @SuppressWarnings("deprecation")
    27         DeprecatedClass a2;
    28     }
    29 }

mercurial