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

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

Conversation

@DragonFSKY

@DragonFSKY DragonFSKY commented Jun 28, 2026 •

Copy link
Copy Markdown

Fixes #136.

Copy.hashCode() already uses wallet identity, while equals() previously used score ordering. Aligning equals() with the wallet keeps the equality and hash-code contract without changing score-based sorting.

One regression test covers different wallets with the same score, which failed on the previous implementation.

Verification:

  • mvn --errors --batch-mode clean install -Pqulice (JDK 21; 69 tests, 0 failures)

@DragonFSKY
DragonFSKY force-pushed the fix-copy-equals-hashcode-contract branch from cd552b1 to 1952817 Compare June 29, 2026 15:06
@DragonFSKY
DragonFSKY force-pushed the fix-copy-equals-hashcode-contract branch 3 times, most recently from 5759dae to f0a8fd4 Compare August 26, 2026 05:36
@DragonFSKY
DragonFSKY force-pushed the fix-copy-equals-hashcode-contract branch from f0a8fd4 to c92e507 Compare August 26, 2026 05:40
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