JDK-8022474 : @SuppressWarnings("deprecation") Doesn't Work As Expected
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 8
  • Priority: P4
  • Status: Resolved
  • Resolution: Duplicate
  • Submitted: 2013-08-06
  • Updated: 2013-09-03
  • Resolved: 2013-09-03
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
Try to add @SuppressWarnings("deprecation") to clean up deprecation javac warnings. But after adding it to the class scope, the deprecation warnings still show up in the compilation.
Comments
The same usecase is described by JDK-6480588.
03-09-2013

This will probably be solved with the patch you are working with now for JDK-8021112
27-08-2013

This may be a duplicate of JDK-7117383
09-08-2013

Here is a simple testcase to reproduce the issue. This is DepClass.java, which is deprecated. @Deprecated class DepClass { @Deprecated public static interface DepInterface { } } This is Main.java, which refers to the above. @SuppressWarnings( "deprecation" ) class Main implements DepClass.DepInterface { } After compilation, javac -Xlint:all Main.java, it still produces the following deprecation warnings. Main.java:4: warning: [deprecation] DepClass in unnamed package has been deprecated class Main implements DepClass.DepInterface { ^ Main.java:4: warning: [deprecation] DepInterface in DepClass has been deprecated class Main implements DepClass.DepInterface { ^ 2 warnings
06-08-2013