RFR: 8343477: Remove unnecessary @SuppressWarnings annotations (compiler) [v6]
Maurizio Cimadamore
mcimadamore at openjdk.org
Mon Dec 16 10:50:46 UTC 2024
On Mon, 9 Dec 2024 19:20:35 GMT, Archie Cobbs <acobbs at openjdk.org> wrote:
>> Please review this patch which removes unnecessary `@SuppressWarnings` annotations.
>
> Archie Cobbs has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 10 additional commits since the last revision:
>
> - Merge branch 'master' into SuppressWarningsCleanup-compiler
> - Merge branch 'master' into SuppressWarningsCleanup-compiler
> - Merge branch 'master' into SuppressWarningsCleanup-compiler
> - Merge branch 'master' into SuppressWarningsCleanup-compiler
> - Update copyright years.
> - Merge branch 'master' into SuppressWarningsCleanup-compiler
> - Merge branch 'master' into SuppressWarningsCleanup-compiler
> - Apply change that was missed somehow.
> - Undo change that will be moved to the core-libs branch.
> - Remove unnecessary @SuppressWarnings annotations.
Looks good - nice cleanup!
src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java line 2894:
> 2892: /**This method parses a statement appearing inside a block.
> 2893: */
> 2894: @SuppressWarnings("fallthrough")
This is a bit tricky. Yes, as things stand the suppression is redundant. But the switch does contain a case with fallthrough - only it's the last `case`, so the fallthrough does nothing. If a `default` is added (or some other `case` after the last) the fallthrough will become more apparent. (but then a warnings should be issued as well). Considering we have already a comment to indicate the fallthrough, this change is ok.
-------------
Marked as reviewed by mcimadamore (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/21851#pullrequestreview-2505813958
PR Review Comment: https://git.openjdk.org/jdk/pull/21851#discussion_r1886590561
More information about the compiler-dev
mailing list