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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 14
    • 13
    • specification

      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.

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

              Created:
              Updated:
              Resolved: