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

BE: Chore: use enhanced switch #702

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yeikel
Copy link
Contributor

@yeikel yeikel commented Dec 10, 2024

A small change to take advantage of newer language features

How Has This Been Tested? (put an "x" (case-sensitive!) next to an item)

  • Unit checks

Checklist (put an "x" (case-sensitive!) next to all the items, otherwise the build will fail)

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (e.g. ENVIRONMENT VARIABLES)
  • My changes generate no new warnings (e.g. Sonar is happy)
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged

A picture of a cute animal (not mandatory but encouraged)

is-this-smile-cute-or-terrifying-photo-u1

@yeikel yeikel requested a review from a team as a code owner December 10, 2024 16:42
@kapybro kapybro bot added status/triage Issues pending maintainers triage status/triage/manual Manual triage in progress status/triage/completed Automatic triage completed and removed status/triage Issues pending maintainers triage labels Dec 10, 2024
Comment on lines -223 to -225
default:
throw new IllegalStateException("Unexpected value: " + action);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A default case is not needed because we are switching on an enum. If we add new values in the future, the compiler will fail with "'switch' expression does not cover all possible input values"

@yeikel yeikel force-pushed the refactor-enhanced-switch branch from 9d518e9 to 66224a3 Compare December 11, 2024 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/triage/completed Automatic triage completed status/triage/manual Manual triage in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant