Skip to content
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

[8.0] Use Java 14 switch expressions (#82178) #82355

Merged
merged 2 commits into from
Jan 10, 2022

Conversation

arteam
Copy link
Contributor

@arteam arteam commented Jan 10, 2022

Backports to 8.0:

JEP 361[https://openjdk.java.net/jeps/361] added support for switch expressions
which can be much more terse and less error-prone than switch statements.

Another useful feature of switch expressions is exhaustiveness: we can make
sure that an enum switch expression covers all the cases at compile time.

(cherry picked from commit 0699c93)
It was updated to Java 8 compatibility in elastic#82274

(cherry picked from commit 78509f4)
@arteam arteam merged commit 358484b into elastic:8.0 Jan 10, 2022
@arteam arteam deleted the backport-switch-expressions branch January 10, 2022 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants