RFR: 8344079: Minor fixes and cleanups to compiler lint-related code [v3]

Archie Cobbs acobbs at openjdk.org
Sat Nov 30 17:35:57 UTC 2024


On Fri, 29 Nov 2024 17:33:08 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> Archie Cobbs has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Fold LintSuppression methods back into existing Lint class.
>
> src/jdk.compiler/share/classes/com/sun/tools/javac/code/Lint.java line 437:
> 
>> 435:         return attributes
>> 436:           .filter(attribute -> attribute.type.tsym == syms.suppressWarningsType.tsym)
>> 437:           .map(attribute -> attribute.member(names.value))
> 
> IMHO this could be simplified - there's 5/6 stream calls just to get the suppression value out of the SuppressWarnings. I'd suggest to put that logic in its own helper method and just to a single `map` that points there. I'd also suggest to use imperative logic in that helper method.

Yeah, it ended up just being hard to read. See if af342035e0d looks better.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22056#discussion_r1864372293


More information about the compiler-dev mailing list