RFR: 8354071: Add LintCategory property indicating whether @SuppressWarnings is supported [v2]

Archie Cobbs acobbs at openjdk.org
Wed Apr 9 15:15:10 UTC 2025


> This is split off as a sub-task of [JDK-8224228](https://bugs.openjdk.org/browse/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` is not, so an occurrence of `@SuppressWarnings("options")` is meaningless and would be ignored.
> 
> This information is needed in the upcoming refactoring. We can facilitate that very simply by adding a boolean property to the `LintCategory` enum.
> 
> In addition, this permits a small optimization to be added to `Lint.suppressionsFrom()`.

Archie Cobbs has updated the pull request incrementally with one additional commit since the last revision:

  Add "not yet" comment to TEXT_BLOCKS.

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/24529/files
  - new: https://git.openjdk.org/jdk/pull/24529/files/f831a108..5bb0b114

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=24529&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24529&range=00-01

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/24529.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/24529/head:pull/24529

PR: https://git.openjdk.org/jdk/pull/24529


More information about the compiler-dev mailing list