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