Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8224228 No way to locally suppress lint warnings in parser/tokenizer or preview features
  3. JDK-8354071

Add LintCategory property indicating whether @SuppressWarnings is supported

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: P4 P4
    • 25
    • 25
    • tools
    • jdk-25+9-73-gba28119642a

    • master
    • generic
    • generic

      This is split off as a sub-task of JDK-8224228, which seeks to add @SuppressWarnings support for lexical features.

      Lint warnings that are subject to suppression via @SuppressWarnings must be deferred until attribution, because until then we can't determine whether they are suppressed or not.

      Whether a lint warning is subject to suppression via @SuppressWarnings is a function of the associated LintCategory, not the warning itself. For example LintCategory.OPTIONS does not, and so an occurrence of @SuppressWarnings("options") is meaningless and would be ignored.

      The status of the LintCategory is needed to determine deferral status of warnings in the upcoming refactoring. We can facilitate that very simply by adding a boolean property to the LintCategory enum which indicates whether that category supports @SuppressWarnings.

      In addition, this permits a small optimization to be added to Lint.suppressionsFrom().

            acobbs Archie Cobbs
            acobbs Archie Cobbs
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: