Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6480588

No way to suppress deprecation warnings when implementing deprecated interface

XMLWordPrintable

    • b108
    • generic, x86
    • generic, windows_xp

      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.

            jlahoda Jan Lahoda
            emcmanus Eamonn McManus
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: