T6480588.java revision 2933:49d207bf704d
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 * @modules jdk.compiler/com.sun.tools.javac.api 7 * jdk.compiler/com.sun.tools.javac.code 8 * jdk.compiler/com.sun.tools.javac.file 9 * jdk.compiler/com.sun.tools.javac.tree 10 * @build VerifySuppressWarnings 11 * @compile/ref=T6480588.out -XDrawDiagnostics -Xlint:unchecked,deprecation,cast T6480588.java 12 * @run main VerifySuppressWarnings T6480588.java 13 */ 14// TODO: 8057683 improve ordering of errors with type annotations 15@DeprecatedAnnotation 16class T6480588 extends DeprecatedClass implements DeprecatedInterface { 17 @DeprecatedAnnotation 18 public DeprecatedClass method(DeprecatedClass param) throws DeprecatedClass { 19 DeprecatedClass lv = new DeprecatedClass(); 20 @Deprecated 21 DeprecatedClass lvd = new DeprecatedClass(); 22 return null; 23 } 24 25 @Deprecated 26 public void methodD() { 27 } 28 29 @DeprecatedAnnotation 30 DeprecatedClass field = new DeprecatedClass(); 31 32 @DeprecatedAnnotation 33 class Inner extends DeprecatedClass implements DeprecatedInterface { 34 } 35 36} 37 38@Deprecated class DeprecatedClass extends Throwable { } 39@Deprecated interface DeprecatedInterface { } 40@Deprecated @interface DeprecatedAnnotation { } 41