RFR: 8354071: Add LintCategory property indicating whether @SuppressWarnings is supported [v2]
Archie Cobbs
acobbs at openjdk.org
Wed Apr 9 15:15:11 UTC 2025
On Wed, 9 Apr 2025 14:52:25 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>>> The intent was for this field to represent what's actually (currently) true in the compiler - which is that `@SuppressWarnings("text-blocks")` is not supported - and then revert this part of the change when [JDK-8224228](https://bugs.openjdk.org/browse/JDK-8224228) gets fixed. But we could also do that preemptively if you prefer - just let me know.
>>
>> I'm fine with either -- I just wonder if this might suggest that we will start e.g. refusing/warn `@SuppressWarnings("XYZ")` where XYZ is declared as unsuppressible. But as long as we sequence things correctly, we should be ok either way.
>
> Maybe just add a comment saying "for now" :-)
> I just wonder if this might suggest that we will start e.g. refusing/warn `@SuppressWarnings("XYZ")` where XYZ is declared as unsuppressible.
Surely that would violate the spirit (if not the letter) of [§9.6.4.5](https://docs.oracle.com/javase/specs/jls/se24/html/jls-9.html#jls-9.6.4.5) which states "A Java compiler must ignore any such string that it does not recognize".
> Maybe just add a comment saying "for now" :-)
Good compromise idea :) Added in 5bb0b11431e.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24529#discussion_r2035591411
More information about the compiler-dev
mailing list