-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable FallThrough on Java 14 for switch expressions #1442
Conversation
Generate changelog in
|
" };", | ||
" }", | ||
"}") | ||
.expectErrorMessage("X", input -> input.contains("Execution may fall through from the previous case")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to use Diagnostic matches
and expectErrorMessage
because otherwise the diagnostic message matches the magic comment that will suppress the check.
https://github.com/google/error-prone/blob/v2.4.0/core/src/main/java/com/google/errorprone/bugpatterns/FallThrough.java#L45-L46
👍 |
Released 3.33.0 |
Related to #1413
Before this PR
There is a false negative with
FallThrough
on Java 14 when using switch expressions where the case arms are statements (as opposed to expressions).See google/error-prone#1649.
After this PR
Disable
FallThrough
on Java 14.