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

@SuppressWarnings("deprecation") does not work when overriding deprecated method

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 8
    • Fix Version/s: 9
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b04
    • Verification:
      Verified

      Backports

        Description

        Consider this example:
        -----
        public class Depr implements Intf {
            @SuppressWarnings("deprecation")
            public void test() { }
        }

        interface Intf {
            @Deprecated void test();
        }
        -----

        Running with -Xlint:deprecation produces this:
        -----
        $ javac -Xlint:deprecation Depr.java
        Depr.java:3: warning: [deprecation] test() in Intf has been deprecated
            public void test() { }
                        ^
        1 warning
        -----

        While the warning should probably be suppressed by the @SuppessWarnings annotation.

        This can be reproduced with:
        -----
        $ javac -fullversion
        javac full version "1.8.0-ea-b121"
        -----

        See original bugreport:
        https://netbeans.org/bugzilla/show_bug.cgi?id=241275

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  Created:
                  Updated:
                  Resolved: