java-topology/test/langtools/tools/javac/annotations/DeprecationWarningTest.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

15 lines
502 B
Java

/*
* @test /nodynamiccopyright/
* @bug 8293519
* @summary deprecation warnings should be emitted for uses of annotation methods inside other annotations
* @compile/fail/ref=DeprecationWarningTest.out -deprecation -Werror -XDrawDiagnostics DeprecationWarningTest.java
*/
// both classes can't be inside the same outermost class or the compiler wont emit the warning as `9.6.4.6 @Deprecated` mandates
@interface Anno {
@Deprecated
boolean b() default false;
}
@Anno(b = true)
class Foo {}