google / google/error-prone

StatementSwitchToExpressionSwitch jdk17 doesn't work

Open
#3,780 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
7.2k
Forks
820
Avg merge
5h 9m
Merged PRs (30d)
50

Description

In this reproducer https://github.com/delanym/error-prone-reproducer

I took an example from https://errorprone.info/bugpattern/StatementSwitchToExpressionSwitch

``` java
enum Suit {HEARTS, CLUBS, SPADES, DIAMONDS};

private void foo(Suit suit) {
switch(suit) {
case HEARTS:
System.out.println("Red hearts");
case DIAMONDS:
System.out.println("Red diamonds");
case SPADES:
// Fall through
case DIAMONDS:
bar();
System.out.println("Black suit");
}
}
```

fixed the duplicate case (!), ran it through EP 2.18.0
with command `./mvnw`
and it didn't fail.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.