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

9.6.4.5: Clarify that @SuppressWarnings requires unknown strings to be ignored

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 13
    • Fix Version/s: 14
    • Component/s: specification
    • Labels:

      Description

      The API specification for java.lang.SuppressWarnings states:

      "The presence of unrecognized warning names is not an error: Compilers must ignore any warning names they do not recognize. They are, however, free to emit a warning if an annotation contains an unrecognized warning name."
      https://docs.oracle.com/en/java/javase/13/docs/api/java.base/java/lang/SuppressWarnings.html#value()

      This requirement to ignore unknown strings is not included in JLS 9.6.4.5. @SuppressWarnings. The JLS and API spec should be consistent in the requirements on compilers in handling the annotation.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                abuckley Alex Buckley
                Reporter:
                darcy Joe Darcy
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: