Duplicate :
|
|
Duplicate :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
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.