-
Notifications
You must be signed in to change notification settings - Fork 4
Replace the chain of if/else with a switch expression. #423
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
Replace the chain of if/else with a switch expression. #423
Conversation
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
xapi-model/src/main/java/dev/learning/xapi/jackson/StrictLocaleDeserializer.java
Outdated
Show resolved
Hide resolved
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.
Pull request overview
This PR modernizes the codebase to use Java 21+ language features, specifically replacing if/else chains with switch expressions and using unnamed variables (underscore) for unused exception parameters. It also updates several build dependencies to newer versions.
Key Changes:
- Replaced if/else chain with switch expression using pattern matching and guarded patterns in
StatementHttpMessageWriter.getParts() - Updated unused exception variables to use underscore (
_) in catch blocks across multiple files - Updated build tool dependencies: maven-checkstyle-plugin (3.5.0 → 3.6.0), checkstyle (10.6.0 → 12.1.2), and jjwt (0.12.6 → 0.13.0)
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| xapi-client/src/main/java/dev/learning/xapi/client/StatementHttpMessageWriter.java | Refactored if/else chain to switch expression with pattern matching for handling Statement and List objects |
| xapi-model/src/main/java/dev/learning/xapi/jackson/StrictLocaleDeserializer.java | Updated catch block to use unnamed variable for unused MissingResourceException |
| xapi-client/src/test/java/dev/learning/xapi/client/configuration/XapiClientAutoConfigurationUsernamePasswordTest.java | Updated catch block to use unnamed variable for unused IOException |
| xapi-client/src/test/java/dev/learning/xapi/client/configuration/XapiClientAutoConfigurationAuthorizationTest.java | Updated catch block to use unnamed variable for unused IOException |
| pom.xml | Updated maven-checkstyle-plugin, checkstyle, and jjwt versions; added explicit checkstyle dependency configuration |
|



Description
Resolves # (issue)
Checklist: