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

Allow optional default case label if switch missing all statements #1477

Merged
merged 2 commits into from
Jun 26, 2024

Conversation

jjohnstn
Copy link
Contributor

What it does

Adds an additional quick fix proposal for an empty switch when Java >= 14 is used to add an empty block default label.

How to test

See issue or new test.

Author checklist

- modify LocalCorrectionsSubProcessor.createMissingDefaultProposal() to
  add an additional proposal to add a default label if JVM >= 14
  and no other statements exist in switch
- modify test in QuickFixTest14
- fixes eclipse-jdt#1459
@jjohnstn jjohnstn self-assigned this Jun 25, 2024
@jjohnstn jjohnstn added the enhancement New feature or request label Jun 25, 2024
@jjohnstn jjohnstn added this to the 4.33 M1 milestone Jun 25, 2024
@jjohnstn jjohnstn merged commit 5162902 into eclipse-jdt:master Jun 26, 2024
9 checks passed
@jjohnstn jjohnstn deleted the emptyswitch branch June 26, 2024 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Quickfix for empty switch should propose to add a default branch as an expression
1 participant