-
Notifications
You must be signed in to change notification settings - Fork 143
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
fix: change == to .equals for Bytes.EMPTY and other non-primitive types #17213
Conversation
Signed-off-by: Kim Rader <[email protected]>
Signed-off-by: Kim Rader <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #17213 +/- ##
=========================================
Coverage 64.33% 64.34%
- Complexity 20942 20945 +3
=========================================
Files 2555 2555
Lines 96169 96169
Branches 10054 10054
=========================================
+ Hits 61873 61876 +3
Misses 30655 30655
+ Partials 3641 3638 -3
|
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesCodacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more |
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.
LGTM
* main: ci: run swirlds-platform-tests as part of CI builds (#17121) test: Token bulk operations and fees tests (#16892) fix: change == to .equals for Bytes.EMPTY and other non-primitive types (#17213) build(deps): bump webcompare from 2.1.5 to 2.1.7 in /hiero-dependency-versions (#17207) build: bump Gradle and module versions (#17232) refactor: 16569 Rename `MerkleStateLifecycles` to `StateLifecycles` (#17193) build(deps): bump grpc from 1.64.0 to 1.69.0 in /hiero-dependency-versions (#17209) build(deps): bump io.github.classgraph:classgraph from 4.8.65 to 4.8.179 in /hiero-dependency-versions (#17208) build(deps): bump com.github.ben-manes.caffeine:caffeine from 3.1.1 to 3.1.8 in /hiero-dependency-versions (#17206) # Conflicts: # hedera-node/hedera-app/src/main/java/com/hedera/node/app/state/StateLifecyclesImpl.java
Description:
This PR updates all object comparisons to use equals instead of == except for a few instances where reference comparisons are per design.
Related issue(s):
Fixes #16639
Notes for reviewer:
A zero-length PBJ Bytes is not necessarily Bytes.EMPTY so nothing should depend on object equality with Bytes.EMPTY. Using == for comparing objects is an anti-pattern in Java.