JDK-6480588 : No way to suppress deprecation warnings when implementing deprecated interface
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 6
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic,windows_xp
  • CPU: generic,x86
  • Submitted: 2006-10-11
  • Updated: 2013-09-19
  • Resolved: 2013-09-16
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 8
8 b108Fixed
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
When compiling with -Xlint, the JDK class com.sun.jmx.trace.TraceImplementation provokes deprecation warnings from javac that cannot be suppressed.  It looks like this:

@Deprecated
public class TraceImplementation implements TraceDestination {...}

The TraceDestination class is deprecated, but so is TraceImplementation so the warning is unreasonable.  Even adding @SuppressWarnings("deprecation") on the class will not shut it up.

A further problem with deprecation is that import statements that import a deprecated class generate warnings.  Since you cannot annotate an import, you cannot say that these warnings are unnecessary.  It seems that the warning should happen when the deprecated class is used within the compilation unit, not when it is imported.