Integrated: 8354071: Add LintCategory property indicating whether @SuppressWarnings is supported

Archie Cobbs acobbs at openjdk.org
Thu Apr 10 17:10:44 UTC 2025


On Tue, 8 Apr 2025 20:52:09 GMT, Archie Cobbs <acobbs at openjdk.org> wrote:

> 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()`.

This pull request has now been integrated.

Changeset: 799e5b33
Author:    Archie Cobbs <acobbs at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/799e5b33a11d252109636dd15d22ed3b6280aad4
Stats:     35 lines in 1 file changed: 25 ins; 0 del; 10 mod

8354071: Add LintCategory property indicating whether @SuppressWarnings is supported

Reviewed-by: mcimadamore

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

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


More information about the compiler-dev mailing list