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
migrate to Java 17 switch semantics #570
migrate to Java 17 switch semantics #570
Conversation
replace legacy switch block with java 17 semantics in eclipse.pde.internal.ui package, wherever possible.
Test Results 240 files + 6 240 suites +6 53m 38s ⏱️ + 11m 51s For more details on these errors, see this check. Results for commit 17a384b. ± Comparison against base commit 9cddd29. This pull request removes 1 test.
|
Thank you! |
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.
Thank you @gireeshpunathil for this clean up, this is much appreciated.
Sorry for the late reply. I just have to minor remarks below, in case you want to address them in a follow up.
case T_OR -> OP_OR; | ||
case T_EQ -> OP_EQ; | ||
case T_NEQ -> OP_NEQ; | ||
default -> opcode; |
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.
the default could be zero and the swtich expression could be assigned to the opcode variable during initialization already.
} | ||
|
||
|
||
boolean accept = true & switch (mWidthType) { |
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.
The leading true
is not necessary here.
And the parenthesis in the following cases can probably be deleted too.
Very nice to see code cleanup activities in PDE. @gireeshpunathil I hope to see more of these in the future! |
replace legacy switch block with java 17 semantics: 1. short-circuit initialization in the switch expression 2. default case match with the original initialization 3. reduce complex boolean expression to an elegant form Refs: eclipse-pde#570 (review)
* migrate to Java 17 switch semantics: extras replace legacy switch block with java 17 semantics: 1. short-circuit initialization in the switch expression 2. default case match with the original initialization 3. reduce complex boolean expression to an elegant form Refs: #570 (review)
replace legacy switch block with java 17 semantics in
eclipse.pde.internal.ui
package, wherever relevant.