From 3cdfa0fa27372fd738271171a2bdceb2ff47888a Mon Sep 17 00:00:00 2001 From: woodser Date: Mon, 11 Nov 2024 06:49:04 -0500 Subject: [PATCH] fix equals and hashcode of trade, crypto, and traditional currencies --- .../haveno/core/locale/CryptoCurrency.java | 2 -- .../haveno/core/locale/TradeCurrency.java | 22 ++++++++++++++++--- .../core/locale/TraditionalCurrency.java | 2 -- .../settings/preferences/PreferencesView.java | 2 +- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/core/src/main/java/haveno/core/locale/CryptoCurrency.java b/core/src/main/java/haveno/core/locale/CryptoCurrency.java index bbc5b4a4..6c46c9d2 100644 --- a/core/src/main/java/haveno/core/locale/CryptoCurrency.java +++ b/core/src/main/java/haveno/core/locale/CryptoCurrency.java @@ -19,10 +19,8 @@ package haveno.core.locale; import com.google.protobuf.Message; -import lombok.EqualsAndHashCode; import lombok.Getter; -@EqualsAndHashCode(callSuper = true) public final class CryptoCurrency extends TradeCurrency { // http://boschista.deviantart.com/journal/Cool-ASCII-Symbols-214218618 private final static String PREFIX = "✦ "; diff --git a/core/src/main/java/haveno/core/locale/TradeCurrency.java b/core/src/main/java/haveno/core/locale/TradeCurrency.java index a9da96ea..b60abf5e 100644 --- a/core/src/main/java/haveno/core/locale/TradeCurrency.java +++ b/core/src/main/java/haveno/core/locale/TradeCurrency.java @@ -19,19 +19,16 @@ package haveno.core.locale; import haveno.common.proto.ProtobufferRuntimeException; import haveno.common.proto.persistable.PersistablePayload; -import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.ToString; import lombok.extern.slf4j.Slf4j; import org.jetbrains.annotations.NotNull; -@EqualsAndHashCode @ToString @Getter @Slf4j public abstract class TradeCurrency implements PersistablePayload, Comparable { protected final String code; - @EqualsAndHashCode.Exclude protected final String name; public TradeCurrency(String code, String name) { @@ -82,4 +79,23 @@ public abstract class TradeCurrency implements PersistablePayload, Comparable