JDK-7117383 : SuppressWarnings("deprecation") does not suppress warnings when it should
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 8
  • Priority: P4
  • Status: Resolved
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2011-12-02
  • Updated: 2013-09-03
  • Resolved: 2013-09-03
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.
Other
tbd_majorResolved
Related Reports
Duplicate :  
Relates :  
Description
Here's an example of using @SuppressWarnings to suppress a deprecation warning:

class Test {

    @Deprecated
    interface Foo { }

    @SuppressWarnings("deprecation")
    interface Bar extends Foo { }
}

Now consider the case where Foo and Bar are in separate source files:

Foo.java:

  @Deprecated
  interface Foo { }

Bar.java

  @SuppressWarnings("deprecation")
  interface Bar extends Foo { }

In that case it doesn't seem to be possible to suppress the warning:

$ javac -Xlint:all Foo.java Bar.java
Bar.java:2: warning: [deprecation] Foo in unnamed package has been deprecated
interface Bar extends Foo { }
                      ^
1 warning

Comments
The same usecase is described in JDK-6480588.
03-09-2013

This bug is a nice to have one but can wait till 9.
07-06-2013