Make fields final (from code inspect.)

This commit is contained in:
Manfred Karrer 2016-01-21 13:11:34 +01:00
parent 8aee8b617d
commit 1dfc7357ca
20 changed files with 33 additions and 33 deletions

View File

@ -75,7 +75,7 @@ import static io.bitsquare.app.BitsquareEnvironment.APP_NAME_KEY;
public class BitsquareApp extends Application {
private static final Logger log = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(BitsquareApp.class);
public static final boolean DEV_MODE = false;
public static final boolean DEV_MODE = true;
public static final boolean IS_RELEASE_VERSION = !DEV_MODE && true;
private static Environment env;

View File

@ -53,8 +53,8 @@ public class SepaForm extends PaymentMethodForm {
private InputTextField ibanInputTextField;
private InputTextField bicInputTextField;
private TextField currencyTextField;
private List<CheckBox> euroCountryCheckBoxes = new ArrayList<>();
private List<CheckBox> nonEuroCountryCheckBoxes = new ArrayList<>();
private final List<CheckBox> euroCountryCheckBoxes = new ArrayList<>();
private final List<CheckBox> nonEuroCountryCheckBoxes = new ArrayList<>();
public static int addFormForBuyer(GridPane gridPane, int gridRow, PaymentAccountContractData paymentAccountContractData) {
addLabelTextField(gridPane, ++gridRow, "Payment method:", BSResources.get(paymentAccountContractData.getPaymentMethodName()));

View File

@ -110,7 +110,7 @@ public class MainViewModel implements ViewModel {
final StringProperty p2PNetworkLabelId = new SimpleStringProperty("footer-pane");
private MonadicBinding<Boolean> allServicesDone;
private User user;
private final User user;
private int numBTCPeers = 0;
private Timer checkForBtcSyncStateTimer;
private ChangeListener<Number> numAuthenticatedPeersListener, btcNumPeersListener;

View File

@ -42,7 +42,7 @@ import java.util.Date;
class ArbitratorRegistrationViewModel extends ActivatableViewModel {
private final ArbitratorManager arbitratorManager;
private P2PService p2PService;
private final P2PService p2PService;
private final WalletService walletService;
private final KeyRing keyRing;
@ -55,7 +55,7 @@ class ArbitratorRegistrationViewModel extends ActivatableViewModel {
private boolean allDataValid;
private final MapChangeListener<NodeAddress, Arbitrator> arbitratorMapChangeListener;
private ECKey registrationKey;
StringProperty registrationPubKeyAsHex = new SimpleStringProperty();
final StringProperty registrationPubKeyAsHex = new SimpleStringProperty();
///////////////////////////////////////////////////////////////////////////////////////////

View File

@ -34,11 +34,11 @@ import javafx.collections.ObservableList;
import java.util.stream.Collectors;
class ArbitratorSelectionViewModel extends ActivatableDataModel {
private User user;
private final User user;
private final ArbitratorManager arbitratorManager;
private final Preferences preferences;
private final KeyRing keyRing;
private BSFormatter formatter;
private final BSFormatter formatter;
final ObservableList<String> languageCodes = FXCollections.observableArrayList();
final ObservableList<ArbitratorListItem> arbitratorListItems = FXCollections.observableArrayList();
final ObservableList<String> allLanguageCodes = FXCollections.observableArrayList(LanguageUtil.getAllLanguageCodes());

View File

@ -47,7 +47,7 @@ public class FundsView extends ActivatableViewAndModel<TabPane, Activatable> {
private final ViewLoader viewLoader;
private final Navigation navigation;
private Preferences preferences;
private final Preferences preferences;
@Inject
public FundsView(CachingViewLoader viewLoader, Navigation navigation, Preferences preferences) {

View File

@ -51,16 +51,16 @@ public class MarketsChartsView extends ActivatableViewAndModel<VBox, MarketsChar
private NumberAxis xAxis, yAxis;
XYChart.Series seriesBuy, seriesSell;
private ListChangeListener<OfferBookListItem> changeListener;
private BSFormatter formatter;
private final ListChangeListener<OfferBookListItem> changeListener;
private final BSFormatter formatter;
private TableView<Offer> buyOfferTableView;
private TableView<Offer> sellOfferTableView;
private AreaChart<Number, Number> areaChart;
private ComboBox<TradeCurrency> currencyComboBox;
private Subscription tradeCurrencySubscriber;
private StringProperty priceColumnLabel = new SimpleStringProperty("Price (EUR/BTC)");
private StringProperty amountColumnLabel = new SimpleStringProperty("Amount (BTC)");
private StringProperty volumeColumnLabel = new SimpleStringProperty("Volume (EUR)");
private final StringProperty priceColumnLabel = new SimpleStringProperty("Price (EUR/BTC)");
private final StringProperty amountColumnLabel = new SimpleStringProperty("Amount (BTC)");
private final StringProperty volumeColumnLabel = new SimpleStringProperty("Volume (EUR)");
///////////////////////////////////////////////////////////////////////////////////////////

View File

@ -36,8 +36,8 @@ import javax.inject.Inject;
@FxmlView
public class MarketsStatisticsView extends ActivatableViewAndModel<GridPane, MarketsStatisticViewModel> {
private BSFormatter formatter;
private int gridRow = 0;
private final BSFormatter formatter;
private final int gridRow = 0;
private TableView<MarketStatisticItem> statisticsTableView;

View File

@ -64,7 +64,7 @@ class CreateOfferDataModel extends ActivatableDataModel {
private final Preferences preferences;
private final User user;
private final KeyRing keyRing;
private P2PService p2PService;
private final P2PService p2PService;
private final WalletPasswordPopup walletPasswordPopup;
private final BSFormatter formatter;
private final String offerId;

View File

@ -44,7 +44,7 @@ import static javafx.beans.binding.Bindings.createStringBinding;
class CreateOfferViewModel extends ActivatableWithDataModel<CreateOfferDataModel> implements ViewModel {
private final BtcValidator btcValidator;
private P2PService p2PService;
private final P2PService p2PService;
private final BSFormatter formatter;
private final FiatValidator fiatValidator;

View File

@ -28,7 +28,7 @@ import io.bitsquare.trade.offer.OpenOffer;
import javafx.collections.ObservableList;
class OpenOffersViewModel extends ActivatableWithDataModel<OpenOffersDataModel> implements ViewModel {
private P2PService p2PService;
private final P2PService p2PService;
private final BSFormatter formatter;

View File

@ -61,7 +61,7 @@ public class PendingTradesDataModel extends ActivatableDataModel {
private final WalletService walletService;
private final TradeWalletService tradeWalletService;
private User user;
private final User user;
private final KeyRing keyRing;
private final DisputeManager disputeManager;
private final Navigation navigation;
@ -75,7 +75,7 @@ public class PendingTradesDataModel extends ActivatableDataModel {
private final ObjectProperty<Trade> tradeProperty = new SimpleObjectProperty<>();
private final StringProperty txId = new SimpleStringProperty();
private Trade trade;
private Preferences preferences;
private final Preferences preferences;
///////////////////////////////////////////////////////////////////////////////////////////

View File

@ -73,7 +73,7 @@ public class PendingTradesViewModel extends ActivatableWithDataModel<PendingTrad
private final InputValidator inputValidator;
private final OKPayValidator okPayValidator;
private final AltCoinAddressValidator altCoinAddressValidator;
private P2PService p2PService;
private final P2PService p2PService;
private final ObjectProperty<BuyerState> buyerState = new SimpleObjectProperty<>(PendingTradesViewModel.BuyerState.UNDEFINED);
private final ObjectProperty<SellerState> sellerState = new SimpleObjectProperty<>(UNDEFINED);

View File

@ -56,7 +56,7 @@ public class NetworkSettingsView extends ActivatableViewAndModel<GridPane, Activ
private final WalletService walletService;
private final Preferences preferences;
private BSFormatter formatter;
private final BSFormatter formatter;
private final P2PService p2PService;
@ -72,7 +72,7 @@ public class NetworkSettingsView extends ActivatableViewAndModel<GridPane, Activ
private P2PServiceListener p2PServiceListener;
private ChangeListener<Number> numAuthenticatedPeersChangeListener;
private ChangeListener<List<Peer>> bitcoinPeersChangeListener;
private Set<NodeAddress> seedNodeNodeAddresses;
private final Set<NodeAddress> seedNodeNodeAddresses;
@Inject
public NetworkSettingsView(WalletService walletService, P2PService p2PService, Preferences preferences,

View File

@ -51,7 +51,7 @@ public class OfferDetailsPopup extends Popup {
private final BSFormatter formatter;
private final Preferences preferences;
private User user;
private final User user;
private final Navigation navigation;
private Offer offer;
private Coin tradeAmount;

View File

@ -36,7 +36,7 @@ import java.util.concurrent.CountDownLatch;
public class P2PServiceTest {
private static final Logger log = LoggerFactory.getLogger(P2PServiceTest.class);
boolean useLocalhost = true;
final boolean useLocalhost = true;
private Set<NodeAddress> seedNodes;
private int sleepTime;
private KeyRing keyRing1, keyRing2, keyRing3;

View File

@ -7,8 +7,8 @@ import io.bitsquare.p2p.storage.data.ExpirablePayload;
public final class MockMailboxMessage implements MailboxMessage, ExpirablePayload {
private final int networkId = Version.getNetworkId();
public String msg;
public NodeAddress senderNodeAddress;
public final String msg;
public final NodeAddress senderNodeAddress;
public long ttl;
public MockMailboxMessage(String msg, NodeAddress senderNodeAddress) {

View File

@ -5,7 +5,7 @@ import io.bitsquare.p2p.Message;
import io.bitsquare.p2p.storage.data.ExpirablePayload;
public final class MockMessage implements Message, ExpirablePayload {
public String msg;
public final String msg;
public long ttl;
private final int networkId = Version.getNetworkId();

View File

@ -23,7 +23,7 @@ import java.util.concurrent.CountDownLatch;
public class PeerManagerTest {
private static final Logger log = LoggerFactory.getLogger(PeerManagerTest.class);
boolean useLocalhost = true;
final boolean useLocalhost = true;
private CountDownLatch latch;
private Set<NodeAddress> seedNodes;
private int sleepTime;

View File

@ -34,8 +34,8 @@ import java.util.concurrent.Executors;
public class ProtectedDataStorageTest {
private static final Logger log = LoggerFactory.getLogger(ProtectedDataStorageTest.class);
boolean useClearNet = true;
private Set<NodeAddress> seedNodes = new HashSet<>();
final boolean useClearNet = true;
private final Set<NodeAddress> seedNodes = new HashSet<>();
private NetworkNode networkNode1;
private PeerManager peerManager1;
private EncryptionService encryptionService1, encryptionService2;
@ -43,7 +43,7 @@ public class ProtectedDataStorageTest {
private KeyPair storageSignatureKeyPair1, storageSignatureKeyPair2;
private KeyRing keyRing1, keyRing2;
private MockData mockData;
private int sleepTime = 100;
private final int sleepTime = 100;
private File dir1;
private File dir2;