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

Overriding deprecated method with @deprecated method should not give warning

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 1.3.0, 1.4.0, 1.4.1
    • Fix Version/s: 1.4.2
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      mantis
    • CPU:
      generic, x86
    • OS:
      generic, linux, windows_2000
    • Verification:
      Verified

      Description

      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();
           }
       
        }

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: