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

No way to suppress deprecation warnings when implementing deprecated interface

    Details

    • Subcomponent:
    • Resolved In Build:
      b108
    • CPU:
      generic, x86
    • OS:
      generic, windows_xp

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: