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

Overriding deprecated method with @deprecated method should not give warning

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.2
    • 1.3.0, 1.4.0, 1.4.1
    • tools
    • mantis
    • generic, x86
    • generic, linux, windows_2000
    • Verified

      In JDK 1.1, using the JavaDoc @deprecated tag for a method
      overriding a deprecated method would block the compiler from
      reporting a warning. Currently, I'm getting deprecation warnings
      under JDK 1.3 which are not generated in JDK 1.1 (I would get a
      warning in JDK 1.1 if I removed the @deprecation tag).
       
        This is important, since we need to have clean, no-warnings
        compiles. Generating the warning might make a developer think there
        is a problem. In fact, we sometimes have to override a deprecated
        method since there is 3rd-party software we use which uses the
        deprecated methods rather than their replacements.

        Here's a quick example:

        private final class Sample extends Canvas {
       
           /**
            * @deprecated
            */
           public Dimension preferredSize() {
               return getMinimumSize();
           }
       
        }

            gafter Neal Gafter (Inactive)
            wmaddoxsunw William Maddox (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: