java-topology/test/langtools/tools/javac/warnings/6594914/T6594914a.java
russell@unturf.com 0a580b313d undefect. CWE-407 — 63 sites patched across 27 ecosystems
Authors: russell@unturf.com · brackishbert@gmail.com · foxhop.net · TimeHexOn.com

Patches, unit tests, benchmarks, whitepaper, and outreach briefs.
Public domain — no copyright claimed. Use freely.
2026-03-26 17:11:57 -04:00

29 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;
}
}