-
Notifications
You must be signed in to change notification settings - Fork 40.9k
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
Use switch expressions where appropriate #28180
Comments
I tried to use one today and got:
|
I think there needs some work to be done on the formatting end: Running
into this:
Arguably, the missing indentation makes it harder to read. Otherwise this is ready on my local branch. |
Thanks, @dreis2211. I prefer the pre-formatted version too. We can change this in Spring Java Format with this setting:
It also affects a "traditional" switch. This:
Will become this:
|
@wilkinsona thanks. I will hold my changes back until this is done. Could we maybe assign this issue to me, so nobody starts to work on it in parallel? |
Assigned |
@dreis2211 No rush whatsoever, but we've improved the formatting of switches so I think we're now ready when you are. |
There you go #31527 @wilkinsona |
Thanks, Christoph. Closing in favor of #31527. |
I don't think we make much use of switch statements, but we should see if there are places where using switch expressions will make the code more concise.
The text was updated successfully, but these errors were encountered: