You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gravitino.apache.org by "keepConcentration (via GitHub)" <gi...@apache.org> on 2025/08/14 05:27:43 UTC
[PR] [#8055] improvement(core): Replace equals() with == for enum comparison in CompatibilityUtils [gravitino]
keepConcentration opened a new pull request, #8080:
URL: https://github.com/apache/gravitino/pull/8080
<!--
1. Title: [#<issue>] <type>(<scope>): <subject>
Examples:
- "[#123] feat(operator): support xxx"
- "[#233] fix: check null before access result in xxx"
- "[MINOR] refactor: fix typo in variable name"
- "[MINOR] docs: fix typo in README"
- "[#255] test: fix flaky test NameOfTheTest"
Reference: https://www.conventionalcommits.org/en/v1.0.0/
2. If the PR is unfinished, please mark this PR as draft.
-->
### What changes were proposed in this pull request?
Replace `equals()` method with `==` operator for enum comparison in the `toAuditLogStatus()` method within `CompatibilityUtils` class. Additionally, add a null safety test case to ensure proper handling of null `OperationStatus` parameters.
### Why are the changes needed?
1. Using `==` for enum comparison is more efficient than `equals()` since enums are singletons in Java
2. Added test coverage for null parameter handling to ensure robustness
Fix: #8055
### Does this PR introduce _any_ user-facing change?
No, this is purely an internal refactoring change.
### How was this patch tested?
1. Existing unit tests continue to pass, ensuring no functional regression
2. Added a new test case `testOperationStatusNullHandling()` to verify proper null parameter handling
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#8055] improvement(core): Replace equals() with == for enum comparison in CompatibilityUtils [gravitino]
Posted by "justinmclean (via GitHub)" <gi...@apache.org>.
justinmclean merged PR #8080:
URL: https://github.com/apache/gravitino/pull/8080
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org