From fd3f0e6d2570c5a5a7461dfc1a204ad77958b4b5 Mon Sep 17 00:00:00 2001 From: Christoph Atteneder Date: Mon, 1 Feb 2021 10:52:06 +0100 Subject: [PATCH 1/3] Minor cleanup --- .../pendingtrades/PendingTradesView.java | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/PendingTradesView.java b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/PendingTradesView.java index c2dfcea6c6..0e82a2bd1e 100644 --- a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/PendingTradesView.java +++ b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/PendingTradesView.java @@ -126,16 +126,16 @@ public class PendingTradesView extends ActivatableViewAndModel tradesListChangeListener; - private Map newChatMessagesByTradeMap = new HashMap<>(); + private final Map newChatMessagesByTradeMap = new HashMap<>(); private String tradeIdOfOpenChat; private double chatPopupStageXPosition = -1; private double chatPopupStageYPosition = -1; private ChangeListener xPositionListener; private ChangeListener yPositionListener; - private Map buttonByTrade = new HashMap<>(); - private Map badgeByTrade = new HashMap<>(); - private Map> listenerByTrade = new HashMap<>(); + private final Map buttonByTrade = new HashMap<>(); + private final Map badgeByTrade = new HashMap<>(); + private final Map> listenerByTrade = new HashMap<>(); private ChangeListener tradeStateListener; private ChangeListener disputeStateListener; private ChangeListener mediationResultStateListener; @@ -536,9 +536,7 @@ public class PendingTradesView extends ActivatableViewAndModel { - tableView.getSelectionModel().select(index); - }); + UserThread.execute(() -> tableView.getSelectionModel().select(index)); } } @@ -864,7 +862,7 @@ public class PendingTradesView extends ActivatableViewAndModel setRemoveTradeColumnCellFactory() { + private void setRemoveTradeColumnCellFactory() { moveTradeToFailedColumn.setCellValueFactory((trade) -> new ReadOnlyObjectWrapper<>(trade.getValue())); moveTradeToFailedColumn.setCellFactory( new Callback<>() { @@ -937,6 +935,5 @@ public class PendingTradesView extends ActivatableViewAndModel Date: Mon, 1 Feb 2021 10:52:21 +0100 Subject: [PATCH 2/3] Reset references to enable GC --- .../desktop/main/portfolio/pendingtrades/PendingTradesView.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/PendingTradesView.java b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/PendingTradesView.java index 0e82a2bd1e..4836406669 100644 --- a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/PendingTradesView.java +++ b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/PendingTradesView.java @@ -576,6 +576,8 @@ public class PendingTradesView extends ActivatableViewAndModel Date: Mon, 1 Feb 2021 11:24:20 +0100 Subject: [PATCH 3/3] Add sanity check --- .../desktop/main/portfolio/pendingtrades/PendingTradesView.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/PendingTradesView.java b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/PendingTradesView.java index 4836406669..81ef8590f6 100644 --- a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/PendingTradesView.java +++ b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/PendingTradesView.java @@ -584,6 +584,8 @@ public class PendingTradesView extends ActivatableViewAndModel