RFR: 8354071: Add LintCategory property indicating whether @SuppressWarnings is supported [v2]
Maurizio Cimadamore
mcimadamore at openjdk.org
Wed Apr 9 17:11:36 UTC 2025
On Wed, 9 Apr 2025 15:15:10 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()`.
>
> Archie Cobbs has updated the pull request incrementally with one additional commit since the last revision:
>
> Add "not yet" comment to TEXT_BLOCKS.
Looks good!
-------------
Marked as reviewed by mcimadamore (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/24529#pullrequestreview-2754179462
More information about the compiler-dev
mailing list