-
Notifications
You must be signed in to change notification settings - Fork 6
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
95 Add stable equals/hashCode for PBJ objects #109
Conversation
JUnit Test Report 39 files ±0 39 suites ±0 2m 8s ⏱️ -58s Results for commit df696c8. ± Comparison against base commit 3e79908. This pull request removes 3 and adds 1 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
pbj-core/pbj-runtime/src/main/java/com/hedera/pbj/runtime/io/buffer/BufferedData.java
Outdated
Show resolved
Hide resolved
pbj-integration-tests/src/test/java/com/hedera/pbj/intergration/test/TestHashFunctions.java
Outdated
Show resolved
Hide resolved
pbj-integration-tests/src/jmh/java/com/hedera/pbj/intergration/jmh/EqualsHashCodeBench.java
Outdated
Show resolved
Hide resolved
pbj-integration-tests/src/jmh/java/com/hedera/pbj/intergration/jmh/EqualsHashCodeBench.java
Outdated
Show resolved
Hide resolved
pbj-integration-tests/src/jmh/java/com/hedera/pbj/intergration/jmh/EqualsHashCodeBench.java
Outdated
Show resolved
Hide resolved
pbj-integration-tests/src/test/java/com/hedera/pbj/intergration/test/TestHashFunctions.java
Outdated
Show resolved
Hide resolved
a4a066d
to
f73ef6c
Compare
pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/generators/ModelGenerator.java
Show resolved
Hide resolved
pbj-integration-tests/src/test/java/com/hedera/pbj/intergration/test/TestHashFunctions.java
Show resolved
Hide resolved
pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/generators/ModelGenerator.java
Show resolved
Hide resolved
pbj-integration-tests/src/test/java/com/hedera/pbj/intergration/test/TestHashFunctions.java
Show resolved
Hide resolved
pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/Common.java
Show resolved
Hide resolved
pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/Common.java
Show resolved
Hide resolved
pbj-integration-tests/src/test/java/com/hedera/pbj/intergration/test/TestHashFunctions.java
Show resolved
Hide resolved
pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/generators/ModelGenerator.java
Show resolved
Hide resolved
pbj-integration-tests/src/jmh/java/com/hedera/pbj/intergration/jmh/EqualsHashCodeBench.java
Outdated
Show resolved
Hide resolved
pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/Common.java
Show resolved
Hide resolved
pbj-integration-tests/src/test/java/com/hedera/pbj/intergration/test/TestHashFunctions.java
Show resolved
Hide resolved
pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/generators/ModelGenerator.java
Show resolved
Hide resolved
pbj-integration-tests/src/test/java/com/hedera/pbj/intergration/test/TestHashFunctions.java
Show resolved
Hide resolved
pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/generators/ModelGenerator.java
Show resolved
Hide resolved
pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/Common.java
Outdated
Show resolved
Hide resolved
pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/Common.java
Show resolved
Hide resolved
pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/generators/ModelGenerator.java
Show resolved
Hide resolved
pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/Common.java
Show resolved
Hide resolved
pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/Common.java
Outdated
Show resolved
Hide resolved
pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/Common.java
Outdated
Show resolved
Hide resolved
pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/Common.java
Outdated
Show resolved
Hide resolved
pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/generators/ModelGenerator.java
Outdated
Show resolved
Hide resolved
pbj-core/pbj-runtime/src/main/java/com/hedera/pbj/runtime/io/buffer/Bytes.java
Outdated
Show resolved
Hide resolved
pbj-integration-tests/src/test/java/com/hedera/pbj/intergration/test/HashEqualsTest.java
Show resolved
Hide resolved
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 preferences |
Cleaned up some code. Add equals method implementation. Added tests and benchmarks for hashCode and equals This is a fix for issue #95. Signed-off-by: Lubomir Litchev <lubomir@swirldslabs.com> Co-authored-by: Ivan Malygin <ivan@swirldslabs.com>
…adding spaced with `.indent` calls. Signed-off-by: Ivan Malygin <ivan@swirldslabs.com>
Signed-off-by: Ivan Malygin <ivan@swirldslabs.com>
Co-authored-by: codacy-production[bot] <61871480+codacy-production[bot]@users.noreply.github.com> Signed-off-by: Ivan Malygin <ivan@swirldslabs.com>
Signed-off-by: Ivan Malygin <ivan@swirldslabs.com>
…ed code directory layout to match Maven. Signed-off-by: Ivan Malygin <ivan@swirldslabs.com>
2eaaae7
to
e21de96
Compare
pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/Common.java
Outdated
Show resolved
Hide resolved
pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/Common.java
Outdated
Show resolved
Hide resolved
pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/Common.java
Show resolved
Hide resolved
pbj-core/pbj-compiler/src/main/java/com/hedera/pbj/compiler/impl/Common.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Ivan Malygin <ivan@swirldslabs.com>
Signed-off-by: Ivan Malygin <ivan@swirldslabs.com>
Signed-off-by: Ivan Malygin <ivan@swirldslabs.com>
This pull request is a cleaner version of #102
I excluded formatting and fixed some minor warnings.
Related issue(s):
Fixes #95
Notes for reviewer:
This implementation does not include optional fields with default values into
hashCode
/equals
calculations, so changing the object definition is not going to affect how existing objects behave.Checklist