RFR: 8344079: Minor fixes and cleanups to compiler lint-related code [v3]
Maurizio Cimadamore
mcimadamore at openjdk.org
Fri Nov 29 17:36:40 UTC 2024
On Fri, 29 Nov 2024 16:33:56 GMT, Archie Cobbs <acobbs at openjdk.org> wrote:
>> Please review these changes with some minor lint-related fixes and cleanups.
>>
>> See [JDK-8344079](https://bugs.openjdk.org/browse/JDK-8344079) for a more detailed description.
>
> Archie Cobbs has updated the pull request incrementally with one additional commit since the last revision:
>
> Fold LintSuppression methods back into existing Lint class.
Looks good, I've left some additional style-related comment
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.
-------------
Marked as reviewed by mcimadamore (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/22056#pullrequestreview-2470355955
PR Review Comment: https://git.openjdk.org/jdk/pull/22056#discussion_r1863808158
More information about the compiler-dev
mailing list