Skip to content

Fix Copy equality/hashCode contract#142

Open
DragonFSKY wants to merge 1 commit into
zold-io:masterfrom
DragonFSKY:fix-copy-equals-hashcode-contract
Open

Fix Copy equality/hashCode contract#142
DragonFSKY wants to merge 1 commit into
zold-io:masterfrom
DragonFSKY:fix-copy-equals-hashcode-contract

Conversation

@DragonFSKY

Copy link
Copy Markdown

Fixes #136.

Summary

  • make Copies.Copy.equals(Object) use the same wallet-based identity as hashCode()
  • keep score-based ordering in compareTo(...) unchanged
  • add regression coverage for with(...) preserving copy identity/hash code and for different wallets with the same score not being equal

Verification

  • git diff --check

I also attempted mvn -Dtest=CopiesTest test, but local execution is currently blocked before tests by the current compiler/annotation-processing setup: generated envelope classes such as ScoreEnvelope and TransactionEnvelope are not produced locally. The latest upstream mvn workflow on master is green, so I am leaving CI as the authoritative full build check for this PR.

@DragonFSKY DragonFSKY force-pushed the fix-copy-equals-hashcode-contract branch from cd552b1 to 1952817 Compare June 29, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Copies.Copy.equals and Copies.Copy.hashCode in Copies.java disagree, breaking the Java equals/hashCode contract

1 participant