From 3aacc99f38e29e985ff7d010b644bc50889e54bd Mon Sep 17 00:00:00 2001 From: Steven Barclay Date: Thu, 9 Feb 2023 21:16:40 +0800 Subject: [PATCH] Tidy up TransactionsView slightly 1. Expression lambda -> method reference; 2. Statement lambda -> expression lambda; 3. Field -> local variable. --- .../main/funds/transactions/TransactionsView.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/desktop/src/main/java/bisq/desktop/main/funds/transactions/TransactionsView.java b/desktop/src/main/java/bisq/desktop/main/funds/transactions/TransactionsView.java index 8c341c91fb..55f33584a6 100644 --- a/desktop/src/main/java/bisq/desktop/main/funds/transactions/TransactionsView.java +++ b/desktop/src/main/java/bisq/desktop/main/funds/transactions/TransactionsView.java @@ -201,7 +201,7 @@ public class TransactionsView extends ActivatableView { dateColumn.setComparator(Comparator.comparing(TransactionsListItem::getDate)); tradeIdColumn.setComparator(Comparator.comparing(o -> o.getTradable() != null ? o.getTradable().getId() : "")); - detailsColumn.setComparator(Comparator.comparing(o -> o.getDetails())); + detailsColumn.setComparator(Comparator.comparing(TransactionsListItem::getDetails)); addressColumn.setComparator(Comparator.comparing(item -> item.getDirection() + item.getAddressString())); transactionColumn.setComparator(Comparator.comparing(TransactionsListItem::getTxId)); amountColumn.setComparator(Comparator.comparing(TransactionsListItem::getAmountAsCoin)); @@ -211,9 +211,7 @@ public class TransactionsView extends ActivatableView { dateColumn.setSortType(TableColumn.SortType.DESCENDING); tableView.getSortOrder().add(dateColumn); - walletChangeEventListener = wallet -> { - updateList(); - }; + walletChangeEventListener = wallet -> updateList(); keyEventEventHandler = event -> { // Not intended to be public to users as the feature is not well tested @@ -419,15 +417,13 @@ public class TransactionsView extends ActivatableView { TransactionsListItem> column) { return new TableCell<>() { - private HyperlinkWithIcon hyperlinkWithIcon; - @Override public void updateItem(final TransactionsListItem item, boolean empty) { super.updateItem(item, empty); if (item != null && !empty) { if (item.isDustAttackTx()) { - hyperlinkWithIcon = new HyperlinkWithIcon(item.getDetails(), AwesomeIcon.WARNING_SIGN); + var hyperlinkWithIcon = new HyperlinkWithIcon(item.getDetails(), AwesomeIcon.WARNING_SIGN); hyperlinkWithIcon.setOnAction(event -> new Popup().warning(Res.get("funds.tx.dustAttackTx.popup")).show()); setGraphic(hyperlinkWithIcon); } else {