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

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 9
    • Affects Version/s: 8
    • Component/s: tools
    • b04
    • Verified

        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

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

                Created:
                Updated:
                Resolved: