-
Bug
-
Resolution: Fixed
-
P3
-
9
-
b48
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8085329 | emb-9 | Jan Lahoda | P3 | Resolved | Fixed | team |
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
@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
- backported by
-
JDK-8085329 SuppressWarnings("deprecation") not respected on default clause on annotation declarations
- Resolved
- relates to
-
JDK-8067094 Suppress deprecation warnings in Java Flight Recorder
- Closed