-
Notifications
You must be signed in to change notification settings - Fork 206
Modernize to Java 17 switch expression. #2816
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
base: master
Are you sure you want to change the base?
Modernize to Java 17 switch expression. #2816
Conversation
case BEFORE -> true; | ||
default -> { | ||
childHelper.fail(RulerColumnMessages.RulerColumnPlacement_illegal_child_msg); | ||
yield false; // Required because default must return a value. |
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.
This looks wrong. Is this autogenerated or manually changed?
Original code would continue for loop without adding anything to constraints.
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 a doubt only in this context. So here it cannot be written in newer syntax does it mean?
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.
No idea, have no time for this.
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.
can this loop be like this to achieve the loop?
boolean before = switch (name) {
case AFTER -> false;
case BEFORE -> true;
default -> {
childHelper.fail(RulerColumnMessages.RulerColumnPlacement_illegal_child_msg);
yield false;
}
};
continue;
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.
No!
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.
Let me check on it further.
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.
Reverting this to original switch, thanks for the suggestion.
I'm not sure the change improves readability. |
I have did it manually. |
Why not with a cleanup? Or there is nothing available? |
Any specific context of "cleanup" in this code are you referring to? |
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.
case BEFORE -> true; | ||
default -> { | ||
childHelper.fail(RulerColumnMessages.RulerColumnPlacement_illegal_child_msg); | ||
yield false; // Required because default must return a value. |
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.
No!
Test Results 1 821 files ±0 1 821 suites ±0 1h 34m 22s ⏱️ + 3m 5s For more details on these failures, see this check. Results for commit 78f65c3. ± Comparison against base commit 60b8674. ♻️ This comment has been updated with latest results. |
4773319
to
ef4610d
Compare
Thanks for the suggestion, even via this that file is not getting picked and updated. So i have reverted that file change(switch to original code). |
That is the sign that the quick fix doesn't have an automated solution for conversion (yet).
The new change shows some new warning, shows files with whitespace only changes. That shouldn't happen. I only briefly checked original PR whether the proposed change make sense, found immediately a problem and beside the problem nothing interesting in the change itself. Approving a PR means I agree with the change, which is not the case here. I would propose to close this PR, and if you are eager to apply this particular refactoring on this particular bundle, do this with the automated cleanup and only with that. For the new PR please find someone who is interested in such kind of reviews and let review it. I'm definitely not interested in this particular change. |
ef4610d
to
8bb2889
Compare
8bb2889
to
2411bcb
Compare
This pull request changes some projects for the first time in this development cycle.
An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch. Git patch
Further information are available in Common Build Issues - Missing version increments. |
Update legacy switch block with Java 17 switch expression in org.eclipse.ui.workbench.texteditor package.