test/tools/javac/warnings/suppress/T6480588.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 6470588
     4  * @summary Verify that \\@SuppressWarnings("deprecation") works OK for all parts
     5  *          of class/method/field "header", including (declaration) annotations
     6  * @build VerifySuppressWarnings
     7  * @compile/ref=T6480588.out -XDrawDiagnostics -Xlint:unchecked,deprecation,cast T6480588.java
     8  * @run main VerifySuppressWarnings T6480588.java
     9  */
    11 @DeprecatedAnnotation
    12 class T6480588 extends DeprecatedClass implements DeprecatedInterface {
    13     @DeprecatedAnnotation
    14     public DeprecatedClass method(DeprecatedClass param) throws DeprecatedClass {
    15         DeprecatedClass lv = new DeprecatedClass();
    16         @Deprecated
    17         DeprecatedClass lvd = new DeprecatedClass();
    18         return null;
    19     }
    21     @Deprecated
    22     public void methodD() {
    23     }
    25     @DeprecatedAnnotation
    26     DeprecatedClass field = new DeprecatedClass();
    28     @DeprecatedAnnotation
    29     class Inner extends DeprecatedClass implements DeprecatedInterface {
    30     }
    32 }
    34 @Deprecated class DeprecatedClass extends Throwable { }
    35 @Deprecated interface DeprecatedInterface { }
    36 @Deprecated @interface DeprecatedAnnotation { }

mercurial