Skip to content

fix: #128 swap ours and theirs in Wallet.File.merge error - #132

Merged
yegor256 merged 1 commit into
zold-io:masterfrom
bibonix:128-merge-ours-theirs-message
Jun 14, 2026
Merged

yegor256 merged 1 commit into
zold-io:masterfrom
bibonix:128-merge-ours-theirs-message

Conversation

@bibonix

@bibonix bibonix commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

The IOException thrown by Wallet.File.merge on an id mismatch labelled the other wallet's id as ours and this wallet's id as theirs, so a maintainer reading the message followed the labels to the wrong side of the comparison. The guard other.id() != this.id() itself was correct; only the FormattedText arguments were ordered wrong.

This change swaps the two arguments so the label matches the value, and updates the assertion in WalletTest.doesNotMergeWalletsWithDifferentId that pinned the previous buggy message. No other call site is touched.

Verified locally with mvn --batch-mode -Pqulice clean install on Java 21: BUILD SUCCESS, qulice clean, 68 tests run with 0 failures, 0 errors, 1 skipped.

Closes #128

The IOException thrown by Wallet.File.merge on an id mismatch labelled the
other wallet's id as ours and this wallet's id as theirs, sending a reader
to the wrong side of the comparison. Swap the FormattedText arguments so
the label matches the value, and update the pinned assertion in
WalletTest.doesNotMergeWalletsWithDifferentId.

Closes zold-io#128
@yegor256
yegor256 merged commit 197f846 into zold-io:master Jun 14, 2026
10 of 11 checks passed
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.

Wallet.File.merge swaps "ours" and "theirs" in the IOException message

3 participants