jdk-24/test/langtools/tools/javac/warnings/6594914/T6594914a.java
Jaikiran Pai e10778acce 8297695: Fix typos in test/langtools files
Co-authored-by: Michael Ernst <mernst@openjdk.org>
Reviewed-by: prappo, jjg, iris
2022-11-30 00:42:40 +00:00

30 lines
760 B
Java

/**
* @test /nodynamiccopyright/
* @bug 6594914
* @summary \\@SuppressWarnings("deprecation") does 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;
}
}