JDK-8069094 : SuppressWarnings("deprecation") not respected on default clause on annotation declarations
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 9
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2015-01-15
  • Updated: 2015-06-04
  • Resolved: 2015-01-20
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b48Fixed
Related Reports
Relates :  
Description
javac doesn't respect the @SuppressWarnings("deprecation") on the enclosing class when it is processing the default clause of the annotation method declaration, i.e.

@Deprecated
enum Foo {
    Bar
}

@interface Baz {
    @SuppressWarnings("deprecation") 
    Foo foo() default Foo.Bar;
}


javac -Xlint:deprecation Repro.java 

produces

Repro.java:9: warning: [deprecation] Foo in unnamed package has been deprecated
    Foo foo() default Foo.Bar;
                      ^
1 warning

which seems to contradict the @Deprecated section of JLS