SuppressWarnings does not work properly in package-info and module-info

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 19
    • Affects Version/s: 19
    • Component/s: tools
    • None
    • b11

      Consider:
      ===package-info.java
      @Ann
      @SuppressWarnings("deprecation")
      package test;
      ===Ann.java
      package test;

      @Deprecated @interface Ann {}
      ===

      After JDK-8280744, this will produce:
      ---
      $ javac -Xlint:deprecation *.java
      package-info.java:1: warning: [deprecation] Ann in test has been deprecated
      @Ann
       ^
      1 warning
      ---

      That appears to be clearly wrong, as the warning is suppressed.

      Something similar is visible in module-info.

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

              Created:
              Updated:
              Resolved: