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

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

mercurial