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

[Switch Expressions] Code review driven iterative clean up of Switch Expressions support #3186

Conversation

srikanth-sankaran
Copy link
Contributor

@srikanth-sankaran srikanth-sankaran commented Oct 29, 2024

What it does

  • Get rid of SwitchExpression.resolveAll and the kludge introduced by https://bugs.eclipse.org/bugs/show_bug.cgi?id=542560
  • Withdraw the error A switch expression should have a non-empty switch block as it is subsumed by A switch expression should have at least one result expression
  • Delete obsolete diagnostic property strings from messages.properties leaving corresponding IProblem constants deprecated
  • Remove dead code in the Scanner
  • Revert earlier ill thought out renaming of YieldStatement.switchExpression that actually reduces readability
  • Remove misplaced attempt to diagnose about expression in place of statement from SwitchStatement.analyseCode - this is already diagnosed in SwitchExpression.resolveType()
  • SwitchExpression.java: Eliminate unnecessary null checks; Opt for clearer variable names; Withdraw AST traversal method that is identical to super implementation.

@srikanth-sankaran srikanth-sankaran marked this pull request as ready for review October 29, 2024 21:22
@srikanth-sankaran srikanth-sankaran changed the title [Switch Expressions] Code review driven clean up of Switch Expressions support [Switch Expressions] Code review driven iterative clean up of Switch Expressions support Oct 29, 2024
@srikanth-sankaran srikanth-sankaran added this to the 4.34 M3 milestone Oct 29, 2024
@srikanth-sankaran srikanth-sankaran merged commit 5963384 into eclipse-jdt:master Oct 29, 2024
10 checks passed
@srikanth-sankaran srikanth-sankaran deleted the switch-expressions-cleanup branch October 29, 2024 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant