jdk/langtools/test/tools/javac/warnings/6594914/T6594914a.java
Maurizio Cimadamore 79d1b7b1e1 6594914: @SuppressWarnings("deprecation") does not not work for the type of a variable
Lint warnings generated during MemberEnter might ignore @SuppressWarnings annotations

Reviewed-by: jjg
2011-02-03 09:35:21 +00:00

29 lines
764 B
Java

/**
* @test /nodynamiccopyright/
* @bug 6594914
* @summary \\@SuppressWarnings("deprecation") does not not work for the type of a variable
* @compile/ref=T6594914a.out -XDrawDiagnostics -Xlint:deprecation T6594914a.java
*/
class T6747671a {
DeprecatedClass a1; //warn
@SuppressWarnings("deprecation")
DeprecatedClass a2;
<X extends DeprecatedClass> DeprecatedClass m1(DeprecatedClass a)
throws DeprecatedClass { return null; } //warn
@SuppressWarnings("deprecation")
<X extends DeprecatedClass> DeprecatedClass m2(DeprecatedClass a)
throws DeprecatedClass { return null; }
void test() {
DeprecatedClass a1; //warn
@SuppressWarnings("deprecation")
DeprecatedClass a2;
}
}