From 6fc1087aba5599f2fe029199bbb751cf174d4b81 Mon Sep 17 00:00:00 2001 From: Sean Gilligan Date: Thu, 7 Sep 2023 15:34:42 -0700 Subject: [PATCH] wallettemplate: mark fields as final This commit fixes every IntelliJ warning about fields being final for the wallettemplate module. --- .../walletfx/controls/BitcoinAddressValidator.java | 2 +- .../bitcoinj/walletfx/controls/NotificationBarPane.java | 6 +++--- .../java/org/bitcoinj/walletfx/utils/BitcoinUIModel.java | 8 ++++---- .../walletfx/utils/easing/EasingInterpolator.java | 2 +- .../walletfx/utils/easing/ElasticInterpolator.java | 4 ++-- .../java/wallettemplate/WalletPasswordController.java | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/wallettemplate/src/main/java/org/bitcoinj/walletfx/controls/BitcoinAddressValidator.java b/wallettemplate/src/main/java/org/bitcoinj/walletfx/controls/BitcoinAddressValidator.java index 70bfe58c8..dd5b2bf02 100644 --- a/wallettemplate/src/main/java/org/bitcoinj/walletfx/controls/BitcoinAddressValidator.java +++ b/wallettemplate/src/main/java/org/bitcoinj/walletfx/controls/BitcoinAddressValidator.java @@ -29,7 +29,7 @@ import org.bitcoinj.walletfx.utils.TextFieldValidator; */ public class BitcoinAddressValidator { private final AddressParser parser; - private Node[] nodes; + private final Node[] nodes; public BitcoinAddressValidator(AddressParser parser, TextField field, Node... nodes) { diff --git a/wallettemplate/src/main/java/org/bitcoinj/walletfx/controls/NotificationBarPane.java b/wallettemplate/src/main/java/org/bitcoinj/walletfx/controls/NotificationBarPane.java index 2950652fb..c1cd5b2b7 100644 --- a/wallettemplate/src/main/java/org/bitcoinj/walletfx/controls/NotificationBarPane.java +++ b/wallettemplate/src/main/java/org/bitcoinj/walletfx/controls/NotificationBarPane.java @@ -48,10 +48,10 @@ public class NotificationBarPane extends BorderPane { public static final Duration ANIM_IN_DURATION = GuiUtils.UI_ANIMATION_TIME.multiply(2); public static final Duration ANIM_OUT_DURATION = GuiUtils.UI_ANIMATION_TIME; - private HBox bar; - private Label label; + private final HBox bar; + private final Label label; private double barHeight; - private ProgressBar progressBar; + private final ProgressBar progressBar; public class Item { public final SimpleStringProperty label; diff --git a/wallettemplate/src/main/java/org/bitcoinj/walletfx/utils/BitcoinUIModel.java b/wallettemplate/src/main/java/org/bitcoinj/walletfx/utils/BitcoinUIModel.java index 502e092b9..86a606e14 100644 --- a/wallettemplate/src/main/java/org/bitcoinj/walletfx/utils/BitcoinUIModel.java +++ b/wallettemplate/src/main/java/org/bitcoinj/walletfx/utils/BitcoinUIModel.java @@ -33,10 +33,10 @@ import java.util.Date; * A class that exposes relevant bitcoin stuff as JavaFX bindable properties. */ public class BitcoinUIModel { - private SimpleObjectProperty
address = new SimpleObjectProperty<>(); - private SimpleObjectProperty balance = new SimpleObjectProperty<>(Coin.ZERO); - private SimpleDoubleProperty syncProgress = new SimpleDoubleProperty(-1); - private ProgressBarUpdater syncProgressUpdater = new ProgressBarUpdater(); + private final SimpleObjectProperty
address = new SimpleObjectProperty<>(); + private final SimpleObjectProperty balance = new SimpleObjectProperty<>(Coin.ZERO); + private final SimpleDoubleProperty syncProgress = new SimpleDoubleProperty(-1); + private final ProgressBarUpdater syncProgressUpdater = new ProgressBarUpdater(); public BitcoinUIModel() { } diff --git a/wallettemplate/src/main/java/org/bitcoinj/walletfx/utils/easing/EasingInterpolator.java b/wallettemplate/src/main/java/org/bitcoinj/walletfx/utils/easing/EasingInterpolator.java index 4bdb7c4a7..32a3709af 100644 --- a/wallettemplate/src/main/java/org/bitcoinj/walletfx/utils/easing/EasingInterpolator.java +++ b/wallettemplate/src/main/java/org/bitcoinj/walletfx/utils/easing/EasingInterpolator.java @@ -38,7 +38,7 @@ public abstract class EasingInterpolator extends Interpolator { /** * The easing mode. */ - private ObjectProperty easingMode = new SimpleObjectProperty<>(EasingMode.EASE_OUT); + private final ObjectProperty easingMode = new SimpleObjectProperty<>(EasingMode.EASE_OUT); /** * Constructs the interpolator with a specific easing mode. diff --git a/wallettemplate/src/main/java/org/bitcoinj/walletfx/utils/easing/ElasticInterpolator.java b/wallettemplate/src/main/java/org/bitcoinj/walletfx/utils/easing/ElasticInterpolator.java index 6b348f77a..bcd36e838 100644 --- a/wallettemplate/src/main/java/org/bitcoinj/walletfx/utils/easing/ElasticInterpolator.java +++ b/wallettemplate/src/main/java/org/bitcoinj/walletfx/utils/easing/ElasticInterpolator.java @@ -49,12 +49,12 @@ public class ElasticInterpolator extends EasingInterpolator { /** * The amplitude. */ - private DoubleProperty amplitude = new SimpleDoubleProperty(this, "amplitude", 1); + private final DoubleProperty amplitude = new SimpleDoubleProperty(this, "amplitude", 1); /** * The number of oscillations. */ - private DoubleProperty oscillations = new SimpleDoubleProperty(this, "oscillations", 3); + private final DoubleProperty oscillations = new SimpleDoubleProperty(this, "oscillations", 3); /** * Default constructor. Initializes the interpolator with ease out mode. diff --git a/wallettemplate/src/main/java/wallettemplate/WalletPasswordController.java b/wallettemplate/src/main/java/wallettemplate/WalletPasswordController.java index 546dae264..3df2470c7 100644 --- a/wallettemplate/src/main/java/wallettemplate/WalletPasswordController.java +++ b/wallettemplate/src/main/java/wallettemplate/WalletPasswordController.java @@ -61,7 +61,7 @@ public class WalletPasswordController implements OverlayController> overlayUI; - private SimpleObjectProperty aesKey = new SimpleObjectProperty<>(); + private final SimpleObjectProperty aesKey = new SimpleObjectProperty<>(); @Override public void initOverlay(OverlayableStackPaneController overlayableStackPaneController, OverlayableStackPaneController.OverlayUI> ui) {