From 2d89453736fd026c8bcab625b8637507beaef8fd Mon Sep 17 00:00:00 2001 From: Manfred Karrer Date: Wed, 14 Mar 2018 00:23:33 -0500 Subject: [PATCH] Reformat and organize imports --- pom.xml | 5 +- src/main/java/bisq/desktop/bisq.css | 20 ++--- .../components/AutoTooltipTableColumn.java | 2 +- .../ColoredDecimalPlacesWithZerosText.java | 2 +- .../bisq/desktop/components/TooltipUtil.java | 2 +- .../skin/StaticProgressIndicatorSkin.java | 4 +- src/main/java/bisq/desktop/main/MainView.java | 2 +- .../AltCoinAccountsDataModel.java | 22 +++--- .../dao/voting/vote/CompensationViewItem.java | 2 +- .../desktop/main/dao/wallet/tx/BsqTxView.java | 12 +-- .../disputes/trader/TraderDisputeView.java | 4 +- .../main/funds/withdrawal/WithdrawalView.java | 3 +- .../market/offerbook/OfferBookChartView.java | 2 +- .../market/trades/TradesChartsViewModel.java | 2 +- .../market/trades/charts/price/Candle.java | 5 +- .../trades/charts/price/CandleStickChart.java | 1 + .../trades/charts/price/CandleTooltip.java | 1 + .../trades/charts/volume/VolumeBar.java | 1 + .../trades/charts/volume/VolumeChart.java | 1 + .../createoffer/CreateOfferViewModel.java | 2 +- .../main/offer/offerbook/OfferBook.java | 2 +- .../offer/offerbook/OfferBookViewModel.java | 8 +- .../offer/takeoffer/TakeOfferViewModel.java | 4 +- .../editor/PeerInfoWithTagEditor.java | 24 +++--- .../notifications/NotificationCenter.java | 66 ++++++++-------- .../windows/DisplayAlertMessageWindow.java | 2 +- .../DisplayUpdateDownloadWindow.java | 2 +- .../steps/buyer/BuyerStep3View.java | 4 +- .../steps/seller/SellerStep2View.java | 4 +- .../java/bisq/desktop/util/BSFormatter.java | 10 +-- .../java/bisq/desktop/util/FormBuilder.java | 4 +- .../util/validation/params/PNCParams.java | 6 +- .../validation/params/TerracoinParams.java | 2 +- .../util/validation/params/WACoinsParams.java | 2 +- .../btc/BtcMainNetParamsForValidation.java | 42 +++++----- .../common/locale/TradeCurrencyMakers.java | 2 +- .../bisq/common/monetary/VolumeMaker.java | 2 +- src/test/java/bisq/core/offer/OfferMaker.java | 76 +++++++++---------- .../DisplayedTransactionsTest.java | 2 +- .../OfferBookChartViewModelTest.java | 28 +++---- .../market/spread/SpreadViewModelTest.java | 2 +- .../createoffer/CreateOfferViewModelTest.java | 4 +- .../offerbook/OfferBookViewModelTest.java | 4 +- .../desktop/util/CurrencyListItemMakers.java | 2 +- .../java/bisq/desktop/util/GUIUtilTest.java | 2 +- 45 files changed, 203 insertions(+), 198 deletions(-) diff --git a/pom.xml b/pom.xml index 0dd966c174..f290c0c251 100644 --- a/pom.xml +++ b/pom.xml @@ -87,7 +87,7 @@ bcpg-jdk15on true ${project.build.directory}/lib - + @@ -109,7 +109,8 @@ false - + bisq.desktop.app.BisqAppMain diff --git a/src/main/java/bisq/desktop/bisq.css b/src/main/java/bisq/desktop/bisq.css index 1892d09005..0e1326e964 100644 --- a/src/main/java/bisq/desktop/bisq.css +++ b/src/main/java/bisq/desktop/bisq.css @@ -39,16 +39,16 @@ bg color of non edit textFields: fafafa -bs-bg-grey: #dddddd; /* 25 usages */ -bs-bg-grey2: #bbb; /* 1 usages */ -bs-bg-grey3: #d3d3d3; /* 1 usages */ - -bs-dark-grey:#999; /* 8 usages */ + -bs-dark-grey: #999; /* 8 usages */ -bs-light-grey: #cccccc; /* derive(-bs-white, -20%); 13 usages */ -bs-content-bg-grey: #f4f4f4; /* 14 usages */ -bs-very-light-grey: #f8f8f8; /* 10 usages */ -bs-bg-light: #FAFAFA; /* derive(-bs-white, -2%) 4 usages */ - -bs-very-light-grey:#F0F0F0; /* derive(-bs-white, -6%) 10 usages */ + -bs-very-light-grey: #F0F0F0; /* derive(-bs-white, -6%) 10 usages */ -bs-very-dark-grey: #3c3c3c; /* 8 usages */ -bs-very-dark-grey2: #111; /* 1 usages */ -bs-black-transparent: rgba(0, 0, 0, 0.5); /* 1 usages */ - -bs-light-grey2: #cfcfcf;/* 2 usages */ + -bs-light-grey2: #cfcfcf; /* 2 usages */ -bs-light-grey3: #b5b5b5; /* 1 usages */ -bs-bg-grey4: #f6f6f6; /* 1 usages */ -bs-black: #000000; /* 13 usages */ @@ -70,8 +70,8 @@ bg color of non edit textFields: fafafa -bs-yellow: #ffb60f; /* 2 usages */ -bs-yellow-light: derive(-bs-yellow, 81%); -bs-bg-grey8: #E1E9E1; /* 1 usages */ - -bs-bg-green2:#619865; /* 2 usages */ - -bs-bg-green:#99ba9c; /* 4 usages */ + -bs-bg-green2: #619865; /* 2 usages */ + -bs-bg-green: #99ba9c; /* 4 usages */ -bs-green: #00aa33; /* 6 usages */ -bs-turquoise: #2cacaf; /* 1 usages */ -bs-bg-grey5: #f1f6f7; /* 4 usages */ @@ -208,7 +208,6 @@ bg color of non edit textFields: fafafa -fx-font-size: 13; } - /* Splash */ #splash { @@ -346,7 +345,6 @@ bg color of non edit textFields: fafafa -fx-text-fill: -fx-accent; } - .dao-tx-type-received-funds-icon, .dao-tx-type-received-funds-icon:hover { -fx-text-fill: -bs-green-soft; @@ -379,7 +377,6 @@ bg color of non edit textFields: fafafa -fx-cursor: hand; } - /******************************************************************************* * * * Tooltip * @@ -413,8 +410,7 @@ textfield */ .hyperlink:hover, .hyperlink:visited, .hyperlink:hover:visited, -.hyperlink:focused -{ +.hyperlink:focused { -fx-border-style: none; -fx-border-width: 0px; } @@ -1294,8 +1290,8 @@ textfield */ } .message-header { - -fx-text-fill: -bs-light-grey; - -fx-font-size: 0.846em; + -fx-text-fill: -bs-light-grey; + -fx-font-size: 0.846em; } /******************************************************************************************************************** diff --git a/src/main/java/bisq/desktop/components/AutoTooltipTableColumn.java b/src/main/java/bisq/desktop/components/AutoTooltipTableColumn.java index 8772d1a480..584b27b27d 100644 --- a/src/main/java/bisq/desktop/components/AutoTooltipTableColumn.java +++ b/src/main/java/bisq/desktop/components/AutoTooltipTableColumn.java @@ -19,7 +19,7 @@ package bisq.desktop.components; import javafx.scene.control.TableColumn; -public class AutoTooltipTableColumn extends TableColumn { +public class AutoTooltipTableColumn extends TableColumn { public AutoTooltipTableColumn(String text) { super(); diff --git a/src/main/java/bisq/desktop/components/ColoredDecimalPlacesWithZerosText.java b/src/main/java/bisq/desktop/components/ColoredDecimalPlacesWithZerosText.java index 56faa13433..f36f34d1a3 100644 --- a/src/main/java/bisq/desktop/components/ColoredDecimalPlacesWithZerosText.java +++ b/src/main/java/bisq/desktop/components/ColoredDecimalPlacesWithZerosText.java @@ -33,7 +33,7 @@ public class ColoredDecimalPlacesWithZerosText extends HBox { super(); if (numberOfZerosToColorize <= 0) { - getChildren().addAll(new Text(number)); + getChildren().addAll(new Text(number)); } else if (number.contains(GUIUtil.RANGE_SEPARATOR)) { String[] splitNumber = number.split(GUIUtil.RANGE_SEPARATOR); Tuple2 numbers = getSplittedNumberNodes(splitNumber[0], numberOfZerosToColorize); diff --git a/src/main/java/bisq/desktop/components/TooltipUtil.java b/src/main/java/bisq/desktop/components/TooltipUtil.java index 31a243c04c..3288cd6240 100644 --- a/src/main/java/bisq/desktop/components/TooltipUtil.java +++ b/src/main/java/bisq/desktop/components/TooltipUtil.java @@ -33,7 +33,7 @@ public class TooltipUtil { if (labeled.getTooltip() != null) { labeled.setTooltip(null); } - } else if (untruncatedText != null && !untruncatedText.trim().isEmpty()){ + } else if (untruncatedText != null && !untruncatedText.trim().isEmpty()) { labeled.setTooltip(new Tooltip(untruncatedText)); } } diff --git a/src/main/java/bisq/desktop/components/indicator/skin/StaticProgressIndicatorSkin.java b/src/main/java/bisq/desktop/components/indicator/skin/StaticProgressIndicatorSkin.java index 373f00af9d..38b28e0961 100644 --- a/src/main/java/bisq/desktop/components/indicator/skin/StaticProgressIndicatorSkin.java +++ b/src/main/java/bisq/desktop/components/indicator/skin/StaticProgressIndicatorSkin.java @@ -441,8 +441,8 @@ public class StaticProgressIndicatorSkin extends BehaviorSkinBase { }); setBottomAnchor(versionLabel, 7d); model.newVersionAvailableProperty.addListener((observable, oldValue, newValue) -> { - versionLabel.getStyleClass().removeAll("version-new","version"); + versionLabel.getStyleClass().removeAll("version-new", "version"); if (newValue) { versionLabel.getStyleClass().add("version-new"); versionLabel.setOnMouseClicked(e -> model.openDownloadWindow()); diff --git a/src/main/java/bisq/desktop/main/account/content/altcoinaccounts/AltCoinAccountsDataModel.java b/src/main/java/bisq/desktop/main/account/content/altcoinaccounts/AltCoinAccountsDataModel.java index 097134f542..b6cc07341c 100644 --- a/src/main/java/bisq/desktop/main/account/content/altcoinaccounts/AltCoinAccountsDataModel.java +++ b/src/main/java/bisq/desktop/main/account/content/altcoinaccounts/AltCoinAccountsDataModel.java @@ -86,8 +86,8 @@ class AltCoinAccountsDataModel extends ActivatableDataModel { private void fillAndSortPaymentAccounts() { if (user.getPaymentAccounts() != null) { paymentAccounts.setAll(user.getPaymentAccounts().stream() - .filter(paymentAccount -> paymentAccount.getPaymentMethod().getId().equals(PaymentMethod.BLOCK_CHAINS_ID)) - .collect(Collectors.toList())); + .filter(paymentAccount -> paymentAccount.getPaymentMethod().getId().equals(PaymentMethod.BLOCK_CHAINS_ID)) + .collect(Collectors.toList())); paymentAccounts.sort((o1, o2) -> o1.getCreationDate().compareTo(o2.getCreationDate())); } } @@ -126,14 +126,14 @@ class AltCoinAccountsDataModel extends ActivatableDataModel { public boolean onDeleteAccount(PaymentAccount paymentAccount) { boolean isPaymentAccountUsed = openOfferManager.getObservableList().stream() - .filter(o -> o.getOffer().getMakerPaymentAccountId().equals(paymentAccount.getId())) - .findAny() - .isPresent(); + .filter(o -> o.getOffer().getMakerPaymentAccountId().equals(paymentAccount.getId())) + .findAny() + .isPresent(); isPaymentAccountUsed = isPaymentAccountUsed || tradeManager.getTradableList().stream() - .filter(t -> t.getOffer().getMakerPaymentAccountId().equals(paymentAccount.getId()) || - paymentAccount.getId().equals(t.getTakerPaymentAccountId())) - .findAny() - .isPresent(); + .filter(t -> t.getOffer().getMakerPaymentAccountId().equals(paymentAccount.getId()) || + paymentAccount.getId().equals(t.getTakerPaymentAccountId())) + .findAny() + .isPresent(); if (!isPaymentAccountUsed) user.removePaymentAccount(paymentAccount); return isPaymentAccountUsed; @@ -146,8 +146,8 @@ class AltCoinAccountsDataModel extends ActivatableDataModel { public void exportAccounts() { if (user.getPaymentAccounts() != null) { ArrayList accounts = new ArrayList<>(user.getPaymentAccounts().stream() - .filter(paymentAccount -> paymentAccount instanceof CryptoCurrencyAccount) - .collect(Collectors.toList())); + .filter(paymentAccount -> paymentAccount instanceof CryptoCurrencyAccount) + .collect(Collectors.toList())); GUIUtil.exportAccounts(accounts, accountsFileName, preferences, stage, persistenceProtoResolver); } } diff --git a/src/main/java/bisq/desktop/main/dao/voting/vote/CompensationViewItem.java b/src/main/java/bisq/desktop/main/dao/voting/vote/CompensationViewItem.java index b2cfe349a5..dd0e71a652 100644 --- a/src/main/java/bisq/desktop/main/dao/voting/vote/CompensationViewItem.java +++ b/src/main/java/bisq/desktop/main/dao/voting/vote/CompensationViewItem.java @@ -73,7 +73,7 @@ public class CompensationViewItem { DoubleProperty labelWidth, BsqFormatter bsqFormatter, Runnable removeHandler) { - instances.add(new CompensationViewItem(compensationRequestVoteItem,bsqWalletService, vBox, bsqFormatter, removeHandler)); + instances.add(new CompensationViewItem(compensationRequestVoteItem, bsqWalletService, vBox, bsqFormatter, removeHandler)); } public static void cleanupAllInstances() { diff --git a/src/main/java/bisq/desktop/main/dao/wallet/tx/BsqTxView.java b/src/main/java/bisq/desktop/main/dao/wallet/tx/BsqTxView.java index 64bcc0927f..7c0de61b4d 100644 --- a/src/main/java/bisq/desktop/main/dao/wallet/tx/BsqTxView.java +++ b/src/main/java/bisq/desktop/main/dao/wallet/tx/BsqTxView.java @@ -239,12 +239,12 @@ public class BsqTxView extends ActivatableView { final List walletTransactions = new ArrayList<>(bsqWalletService.getWalletTransactions()); Set items = walletTransactions.stream() .map(transaction -> new BsqTxListItem(transaction, - bsqWalletService, - btcWalletService, - bsqBlockChain.getTxType(transaction.getHashAsString()), - bsqBlockChain.hasTxBurntFee(transaction.getHashAsString()), - bsqBlockChain, - bsqFormatter) + bsqWalletService, + btcWalletService, + bsqBlockChain.getTxType(transaction.getHashAsString()), + bsqBlockChain.hasTxBurntFee(transaction.getHashAsString()), + bsqBlockChain, + bsqFormatter) ) .collect(Collectors.toSet()); observableList.setAll(items); diff --git a/src/main/java/bisq/desktop/main/disputes/trader/TraderDisputeView.java b/src/main/java/bisq/desktop/main/disputes/trader/TraderDisputeView.java index 7178a349e8..6f17860bfb 100644 --- a/src/main/java/bisq/desktop/main/disputes/trader/TraderDisputeView.java +++ b/src/main/java/bisq/desktop/main/disputes/trader/TraderDisputeView.java @@ -798,7 +798,7 @@ public class TraderDisputeView extends ActivatableView { arrow.setManaged(!item.isSystemMessage()); statusIcon.setVisible(false); if (item.isSystemMessage()) { - headerLabel.getStyleClass().addAll("message-header","success-text"); + headerLabel.getStyleClass().addAll("message-header", "success-text"); bg.setId("message-bubble-green"); messageLabel.getStyleClass().add("my-message"); copyIcon.getStyleClass().add("my-message"); @@ -973,7 +973,7 @@ public class TraderDisputeView extends ActivatableView { /////////////////////////////////////////////////////////////////////////////////////////// private TableColumn getSelectColumn() { - TableColumn column = new AutoTooltipTableColumn(Res.get("shared.select")); + TableColumn column = new AutoTooltipTableColumn(Res.get("shared.select")); column.setMinWidth(80); column.setMaxWidth(80); column.setSortable(false); diff --git a/src/main/java/bisq/desktop/main/funds/withdrawal/WithdrawalView.java b/src/main/java/bisq/desktop/main/funds/withdrawal/WithdrawalView.java index a71f977e05..894d50ce72 100644 --- a/src/main/java/bisq/desktop/main/funds/withdrawal/WithdrawalView.java +++ b/src/main/java/bisq/desktop/main/funds/withdrawal/WithdrawalView.java @@ -609,7 +609,8 @@ public class WithdrawalView extends ActivatableView { checkBox.setSelected(item.isSelected()); } else { checkBox.setOnAction(null); - setGraphic(null); } + setGraphic(null); + } } }; } diff --git a/src/main/java/bisq/desktop/main/market/offerbook/OfferBookChartView.java b/src/main/java/bisq/desktop/main/market/offerbook/OfferBookChartView.java index 26f097abaa..2085a01ee5 100644 --- a/src/main/java/bisq/desktop/main/market/offerbook/OfferBookChartView.java +++ b/src/main/java/bisq/desktop/main/market/offerbook/OfferBookChartView.java @@ -279,7 +279,7 @@ public class OfferBookChartView extends ActivatableViewAndModel { double newTableViewHeight = offerTableViewHeight.apply(newValue.doubleValue()); - if(buyOfferTableView.getHeight() != newTableViewHeight) { + if (buyOfferTableView.getHeight() != newTableViewHeight) { buyOfferTableView.setMinHeight(newTableViewHeight); sellOfferTableView.setMinHeight(newTableViewHeight); } diff --git a/src/main/java/bisq/desktop/main/market/trades/TradesChartsViewModel.java b/src/main/java/bisq/desktop/main/market/trades/TradesChartsViewModel.java index eb31a21255..32df7364d1 100644 --- a/src/main/java/bisq/desktop/main/market/trades/TradesChartsViewModel.java +++ b/src/main/java/bisq/desktop/main/market/trades/TradesChartsViewModel.java @@ -259,7 +259,7 @@ class TradesChartsViewModel extends ActivatableViewModel { Pair> pair = new Pair<>((Date) time.clone(), set); itemsPerInterval.put(i, pair); time.setTime(time.getTime() - 1); - time = roundToTick(time, tickUnit); + time = roundToTick(time, tickUnit); } // Get all entries for the defined time interval diff --git a/src/main/java/bisq/desktop/main/market/trades/charts/price/Candle.java b/src/main/java/bisq/desktop/main/market/trades/charts/price/Candle.java index 40443145c0..394a5a4d23 100644 --- a/src/main/java/bisq/desktop/main/market/trades/charts/price/Candle.java +++ b/src/main/java/bisq/desktop/main/market/trades/charts/price/Candle.java @@ -46,6 +46,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package bisq.desktop.main.market.trades.charts.price; import bisq.desktop.main.market.trades.charts.CandleData; @@ -120,9 +121,9 @@ public class Candle extends Group { style = "empty"; highLowLine.getStyleClass().setAll("candlestick-line", seriesStyleClass, dataStyleClass, - style); + style); bar.getStyleClass().setAll("candlestick-bar", seriesStyleClass, dataStyleClass, - style); + style); } } diff --git a/src/main/java/bisq/desktop/main/market/trades/charts/price/CandleStickChart.java b/src/main/java/bisq/desktop/main/market/trades/charts/price/CandleStickChart.java index f2184c9546..34374a568c 100644 --- a/src/main/java/bisq/desktop/main/market/trades/charts/price/CandleStickChart.java +++ b/src/main/java/bisq/desktop/main/market/trades/charts/price/CandleStickChart.java @@ -46,6 +46,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package bisq.desktop.main.market.trades.charts.price; import bisq.desktop.main.market.trades.charts.CandleData; diff --git a/src/main/java/bisq/desktop/main/market/trades/charts/price/CandleTooltip.java b/src/main/java/bisq/desktop/main/market/trades/charts/price/CandleTooltip.java index a3411bd717..dc0e425ff5 100644 --- a/src/main/java/bisq/desktop/main/market/trades/charts/price/CandleTooltip.java +++ b/src/main/java/bisq/desktop/main/market/trades/charts/price/CandleTooltip.java @@ -46,6 +46,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + package bisq.desktop.main.market.trades.charts.price; import bisq.desktop.components.AutoTooltipLabel; diff --git a/src/main/java/bisq/desktop/main/market/trades/charts/volume/VolumeBar.java b/src/main/java/bisq/desktop/main/market/trades/charts/volume/VolumeBar.java index 98a05d3498..4a04c024d4 100644 --- a/src/main/java/bisq/desktop/main/market/trades/charts/volume/VolumeBar.java +++ b/src/main/java/bisq/desktop/main/market/trades/charts/volume/VolumeBar.java @@ -14,6 +14,7 @@ * You should have received a copy of the GNU Affero General Public License * along with Bisq. If not, see . */ + package bisq.desktop.main.market.trades.charts.volume; import bisq.desktop.main.market.trades.charts.CandleData; diff --git a/src/main/java/bisq/desktop/main/market/trades/charts/volume/VolumeChart.java b/src/main/java/bisq/desktop/main/market/trades/charts/volume/VolumeChart.java index 3c60c72194..647fe74772 100644 --- a/src/main/java/bisq/desktop/main/market/trades/charts/volume/VolumeChart.java +++ b/src/main/java/bisq/desktop/main/market/trades/charts/volume/VolumeChart.java @@ -14,6 +14,7 @@ * You should have received a copy of the GNU Affero General Public License * along with Bisq. If not, see . */ + package bisq.desktop.main.market.trades.charts.volume; import bisq.desktop.main.market.trades.charts.CandleData; diff --git a/src/main/java/bisq/desktop/main/offer/createoffer/CreateOfferViewModel.java b/src/main/java/bisq/desktop/main/offer/createoffer/CreateOfferViewModel.java index d560f8f21f..27cb3d07f2 100644 --- a/src/main/java/bisq/desktop/main/offer/createoffer/CreateOfferViewModel.java +++ b/src/main/java/bisq/desktop/main/offer/createoffer/CreateOfferViewModel.java @@ -735,7 +735,7 @@ class CreateOfferViewModel extends ActivatableWithDataModel im return dataModel.getOffer(); } - public boolean isRange() {return dataModel.getOffer().isRange(); } + public boolean isRange() { + return dataModel.getOffer().isRange(); + } public String getAmountRange() { return amountRange; diff --git a/src/main/java/bisq/desktop/main/overlays/editor/PeerInfoWithTagEditor.java b/src/main/java/bisq/desktop/main/overlays/editor/PeerInfoWithTagEditor.java index c513f368da..cdd4b4b03f 100644 --- a/src/main/java/bisq/desktop/main/overlays/editor/PeerInfoWithTagEditor.java +++ b/src/main/java/bisq/desktop/main/overlays/editor/PeerInfoWithTagEditor.java @@ -182,8 +182,8 @@ public class PeerInfoWithTagEditor extends Overlay { private void addContent() { FormBuilder.addLabelTextField(gridPane, ++rowIndex, Res.getWithCol("shared.onionAddress"), hostName).second.setMouseTransparent(false); FormBuilder.addLabelTextField(gridPane, ++rowIndex, - Res.get("peerInfo.nrOfTrades"), - numTrades > 0 ? String.valueOf(numTrades) : Res.get("peerInfo.notTradedYet")); + Res.get("peerInfo.nrOfTrades"), + numTrades > 0 ? String.valueOf(numTrades) : Res.get("peerInfo.notTradedYet")); if (accountAge != null) FormBuilder.addLabelTextField(gridPane, ++rowIndex, Res.getWithCol("peerInfo.age"), accountAge); @@ -195,8 +195,8 @@ public class PeerInfoWithTagEditor extends Overlay { keyEventEventHandler = event -> { if (Utilities.isAltOrCtrlPressed(KeyCode.R, event)) { new SendPrivateNotificationWindow(offer.getPubKeyRing(), offer.getMakerNodeAddress(), useDevPrivilegeKeys) - .onAddAlertMessage(privateNotificationManager::sendPrivateNotificationMessageIfKeyIsValid) - .show(); + .onAddAlertMessage(privateNotificationManager::sendPrivateNotificationMessageIfKeyIsValid) + .show(); } }; } @@ -233,12 +233,12 @@ public class PeerInfoWithTagEditor extends Overlay { Timeline timeline = new Timeline(); ObservableList keyFrames = timeline.getKeyFrames(); keyFrames.add(new KeyFrame(Duration.millis(0), - new KeyValue(gridPane.rotateProperty(), 0, interpolator), - new KeyValue(gridPane.opacityProperty(), 1, interpolator) + new KeyValue(gridPane.rotateProperty(), 0, interpolator), + new KeyValue(gridPane.opacityProperty(), 1, interpolator) )); keyFrames.add(new KeyFrame(Duration.millis(duration), - new KeyValue(gridPane.rotateProperty(), -90, interpolator), - new KeyValue(gridPane.opacityProperty(), 0, interpolator) + new KeyValue(gridPane.rotateProperty(), -90, interpolator), + new KeyValue(gridPane.opacityProperty(), 0, interpolator) )); timeline.setOnFinished(event -> { gridPane.setRotate(0); @@ -261,13 +261,13 @@ public class PeerInfoWithTagEditor extends Overlay { Timeline timeline = new Timeline(); ObservableList keyFrames = timeline.getKeyFrames(); keyFrames.add(new KeyFrame(Duration.millis(0), - new KeyValue(gridPane.opacityProperty(), 0, interpolator), - new KeyValue(gridPane.translateYProperty(), startY, interpolator) + new KeyValue(gridPane.opacityProperty(), 0, interpolator), + new KeyValue(gridPane.translateYProperty(), startY, interpolator) )); keyFrames.add(new KeyFrame(Duration.millis(duration), - new KeyValue(gridPane.opacityProperty(), 1, interpolator), - new KeyValue(gridPane.translateYProperty(), 0, interpolator) + new KeyValue(gridPane.opacityProperty(), 1, interpolator), + new KeyValue(gridPane.translateYProperty(), 0, interpolator) )); timeline.play(); diff --git a/src/main/java/bisq/desktop/main/overlays/notifications/NotificationCenter.java b/src/main/java/bisq/desktop/main/overlays/notifications/NotificationCenter.java index 5ae8469044..90ce7ad931 100644 --- a/src/main/java/bisq/desktop/main/overlays/notifications/NotificationCenter.java +++ b/src/main/java/bisq/desktop/main/overlays/notifications/NotificationCenter.java @@ -121,7 +121,7 @@ public class NotificationCenter { log.debug("We have already an entry in disputeStateSubscriptionsMap."); } else { Subscription disputeStateSubscription = EasyBind.subscribe(trade.disputeStateProperty(), - disputeState -> onDisputeStateChanged(trade, disputeState)); + disputeState -> onDisputeStateChanged(trade, disputeState)); disputeStateSubscriptionsMap.put(tradeId, disputeStateSubscription); } @@ -129,7 +129,7 @@ public class NotificationCenter { log.debug("We have already an entry in tradePhaseSubscriptionsMap."); } else { Subscription tradePhaseSubscription = EasyBind.subscribe(trade.statePhaseProperty(), - phase -> onTradePhaseChanged(trade, phase)); + phase -> onTradePhaseChanged(trade, phase)); tradePhaseSubscriptionsMap.put(tradeId, tradePhaseSubscription); } }); @@ -137,17 +137,17 @@ public class NotificationCenter { }); tradeManager.getTradableList().stream() - .forEach(trade -> { - String tradeId = trade.getId(); - Subscription disputeStateSubscription = EasyBind.subscribe(trade.disputeStateProperty(), - disputeState -> onDisputeStateChanged(trade, disputeState)); - disputeStateSubscriptionsMap.put(tradeId, disputeStateSubscription); + .forEach(trade -> { + String tradeId = trade.getId(); + Subscription disputeStateSubscription = EasyBind.subscribe(trade.disputeStateProperty(), + disputeState -> onDisputeStateChanged(trade, disputeState)); + disputeStateSubscriptionsMap.put(tradeId, disputeStateSubscription); - Subscription tradePhaseSubscription = EasyBind.subscribe(trade.statePhaseProperty(), - phase -> onTradePhaseChanged(trade, phase)); - tradePhaseSubscriptionsMap.put(tradeId, tradePhaseSubscription); - } - ); + Subscription tradePhaseSubscription = EasyBind.subscribe(trade.statePhaseProperty(), + phase -> onTradePhaseChanged(trade, phase)); + tradePhaseSubscriptionsMap.put(tradeId, tradePhaseSubscription); + } + ); } /////////////////////////////////////////////////////////////////////////////////////////// @@ -177,7 +177,7 @@ public class NotificationCenter { message = Res.get("notification.trade.completed"); } else { if (trade instanceof MakerTrade && - phase.ordinal() == Trade.Phase.DEPOSIT_PUBLISHED.ordinal()) { + phase.ordinal() == Trade.Phase.DEPOSIT_PUBLISHED.ordinal()) { final String role = trade instanceof BuyerTrade ? Res.get("shared.seller") : Res.get("shared.buyer"); message = Res.get("notification.trade.accepted", role); } @@ -194,24 +194,24 @@ public class NotificationCenter { Notification notification = new Notification().tradeHeadLine(trade.getShortId()).message(message); if (navigation.getCurrentPath() != null && !navigation.getCurrentPath().contains(PendingTradesView.class)) { notification.actionButtonTextWithGoTo("navigation.portfolio.pending") - .onAction(() -> { - DontShowAgainLookup.dontShowAgain(key, true); - //noinspection unchecked - navigation.navigateTo(MainView.class, PortfolioView.class, PendingTradesView.class); - if (selectItemByTradeIdConsumer != null) - UserThread.runAfter(() -> selectItemByTradeIdConsumer.accept(trade.getId()), 1); - }) - .onClose(() -> DontShowAgainLookup.dontShowAgain(key, true)) - .show(); + .onAction(() -> { + DontShowAgainLookup.dontShowAgain(key, true); + //noinspection unchecked + navigation.navigateTo(MainView.class, PortfolioView.class, PendingTradesView.class); + if (selectItemByTradeIdConsumer != null) + UserThread.runAfter(() -> selectItemByTradeIdConsumer.accept(trade.getId()), 1); + }) + .onClose(() -> DontShowAgainLookup.dontShowAgain(key, true)) + .show(); } else if (selectedTradeId != null && !trade.getId().equals(selectedTradeId)) { notification.actionButtonText(Res.get("notification.trade.selectTrade")) - .onAction(() -> { - DontShowAgainLookup.dontShowAgain(key, true); - if (selectItemByTradeIdConsumer != null) - selectItemByTradeIdConsumer.accept(trade.getId()); - }) - .onClose(() -> DontShowAgainLookup.dontShowAgain(key, true)) - .show(); + .onAction(() -> { + DontShowAgainLookup.dontShowAgain(key, true); + if (selectItemByTradeIdConsumer != null) + selectItemByTradeIdConsumer.accept(trade.getId()); + }) + .onClose(() -> DontShowAgainLookup.dontShowAgain(key, true)) + .show(); } } } @@ -222,8 +222,8 @@ public class NotificationCenter { String message = null; if (disputeManager.findOwnDispute(trade.getId()).isPresent()) { String disputeOrTicket = disputeManager.findOwnDispute(trade.getId()).get().isSupportTicket() ? - Res.get("shared.supportTicket") : - Res.get("shared.dispute"); + Res.get("shared.supportTicket") : + Res.get("shared.dispute"); switch (disputeState) { case NO_DISPUTE: break; @@ -241,8 +241,8 @@ public class NotificationCenter { if (navigation.getCurrentPath() != null && !navigation.getCurrentPath().contains(TraderDisputeView.class)) { //noinspection unchecked notification.actionButtonTextWithGoTo("navigation.support") - .onAction(() -> navigation.navigateTo(MainView.class, DisputesView.class, TraderDisputeView.class)) - .show(); + .onAction(() -> navigation.navigateTo(MainView.class, DisputesView.class, TraderDisputeView.class)) + .show(); } else { notification.show(); } diff --git a/src/main/java/bisq/desktop/main/overlays/windows/DisplayAlertMessageWindow.java b/src/main/java/bisq/desktop/main/overlays/windows/DisplayAlertMessageWindow.java index df92804987..8a8696398f 100644 --- a/src/main/java/bisq/desktop/main/overlays/windows/DisplayAlertMessageWindow.java +++ b/src/main/java/bisq/desktop/main/overlays/windows/DisplayAlertMessageWindow.java @@ -74,7 +74,7 @@ public class DisplayAlertMessageWindow extends Overlay downloadResults = downloadTask.getValue(); Optional downloadFailed = downloadResults.stream() .filter(fileDescriptor -> !BisqInstaller.DownloadStatusEnum.OK.equals(fileDescriptor.getDownloadStatus())).findFirst(); - downloadedFilesLabel.getStyleClass().removeAll("error-text","success-text"); + downloadedFilesLabel.getStyleClass().removeAll("error-text", "success-text"); if (downloadResults == null || downloadResults.isEmpty() || downloadFailed.isPresent()) { showErrorMessage(downloadButton, statusLabel, downloadFailedString); downloadedFilesLabel.getStyleClass().add("error-text"); diff --git a/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/buyer/BuyerStep3View.java b/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/buyer/BuyerStep3View.java index 2bce28baff..f2d364b308 100644 --- a/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/buyer/BuyerStep3View.java +++ b/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/buyer/BuyerStep3View.java @@ -54,8 +54,8 @@ public class BuyerStep3View extends TradeStepView { protected String getWarningText() { setInformationHeadline(); String substitute = model.isBlockChainMethod() ? - Res.get("portfolio.pending.step3_buyer.warn.part1a", model.dataModel.getCurrencyCode()) : - Res.get("portfolio.pending.step3_buyer.warn.part1b"); + Res.get("portfolio.pending.step3_buyer.warn.part1a", model.dataModel.getCurrencyCode()) : + Res.get("portfolio.pending.step3_buyer.warn.part1b"); return Res.get("portfolio.pending.step3_buyer.warn.part2", substitute, model.getDateForOpenDispute()); } diff --git a/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/seller/SellerStep2View.java b/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/seller/SellerStep2View.java index 530980b7dd..194bb7fcb0 100644 --- a/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/seller/SellerStep2View.java +++ b/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/seller/SellerStep2View.java @@ -54,8 +54,8 @@ public class SellerStep2View extends TradeStepView { protected String getWarningText() { setInformationHeadline(); return Res.get("portfolio.pending.step2_seller.warn", - model.dataModel.getCurrencyCode(), - model.getDateForOpenDispute()); + model.dataModel.getCurrencyCode(), + model.getDateForOpenDispute()); } /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/main/java/bisq/desktop/util/BSFormatter.java b/src/main/java/bisq/desktop/util/BSFormatter.java index cd252524af..9fe593d441 100644 --- a/src/main/java/bisq/desktop/util/BSFormatter.java +++ b/src/main/java/bisq/desktop/util/BSFormatter.java @@ -285,9 +285,9 @@ public class BSFormatter { } public String formatVolume(Offer offer, Boolean decimalAligned, int maxNumberOfDigits, boolean showRange) { - String formattedVolume = offer.isRange() && showRange ? formatVolume(offer.getMinVolume()) + GUIUtil.RANGE_SEPARATOR + formatVolume(offer.getVolume()) : formatVolume(offer.getVolume()); + String formattedVolume = offer.isRange() && showRange ? formatVolume(offer.getMinVolume()) + GUIUtil.RANGE_SEPARATOR + formatVolume(offer.getVolume()) : formatVolume(offer.getVolume()); - if(decimalAligned) { + if (decimalAligned) { formattedVolume = fillUpPlacesWithEmptyStrings(formattedVolume, maxNumberOfDigits); } return formattedVolume; @@ -363,7 +363,7 @@ public class BSFormatter { public String formatAmount(Offer offer, boolean decimalAligned) { String formattedAmount = offer.isRange() ? formatCoin(offer.getMinAmount()) + GUIUtil.RANGE_SEPARATOR + formatCoin(offer.getAmount()) : formatCoin(offer.getAmount()); - if(decimalAligned) { + if (decimalAligned) { formattedAmount = fillUpPlacesWithEmptyStrings(formattedAmount, 15); } return formattedAmount; @@ -372,7 +372,7 @@ public class BSFormatter { public String formatAmount(Offer offer, int decimalPlaces, boolean decimalAligned, int maxPlaces) { String formattedAmount = offer.isRange() ? formatCoin(offer.getMinAmount(), decimalPlaces) + GUIUtil.RANGE_SEPARATOR + formatCoin(offer.getAmount(), decimalPlaces) : formatCoin(offer.getAmount(), decimalPlaces); - if(decimalAligned) { + if (decimalAligned) { formattedAmount = fillUpPlacesWithEmptyStrings(formattedAmount, maxPlaces); } return formattedAmount; @@ -403,7 +403,7 @@ public class BSFormatter { public String formatPrice(Price price, Boolean decimalAligned, int maxPlaces) { String formattedPrice = formatPrice(price); - if(decimalAligned) { + if (decimalAligned) { formattedPrice = fillUpPlacesWithEmptyStrings(formattedPrice, maxPlaces); } return formattedPrice; diff --git a/src/main/java/bisq/desktop/util/FormBuilder.java b/src/main/java/bisq/desktop/util/FormBuilder.java index 408e26109e..241b15920e 100644 --- a/src/main/java/bisq/desktop/util/FormBuilder.java +++ b/src/main/java/bisq/desktop/util/FormBuilder.java @@ -832,7 +832,7 @@ public class FormBuilder { FundsTextField fundsTextField = new FundsTextField(); GridPane.setRowIndex(fundsTextField, rowIndex); GridPane.setColumnIndex(fundsTextField, 1); - GridPane.setMargin(fundsTextField, new Insets(top, 0,0,0)); + GridPane.setMargin(fundsTextField, new Insets(top, 0, 0, 0)); gridPane.getChildren().add(fundsTextField); return new Tuple2<>(label, fundsTextField); @@ -854,7 +854,7 @@ public class FormBuilder { infoTextField.setText(fieldText); GridPane.setRowIndex(infoTextField, rowIndex); GridPane.setColumnIndex(infoTextField, 1); - GridPane.setMargin(infoTextField, new Insets(top, 0,0,0)); + GridPane.setMargin(infoTextField, new Insets(top, 0, 0, 0)); gridPane.getChildren().add(infoTextField); return new Tuple2<>(label, infoTextField); diff --git a/src/main/java/bisq/desktop/util/validation/params/PNCParams.java b/src/main/java/bisq/desktop/util/validation/params/PNCParams.java index e969894cb2..4052d34223 100644 --- a/src/main/java/bisq/desktop/util/validation/params/PNCParams.java +++ b/src/main/java/bisq/desktop/util/validation/params/PNCParams.java @@ -29,9 +29,9 @@ import org.bitcoinj.utils.MonetaryFormat; public class PNCParams extends NetworkParameters { - private static PNCParams instance; + private static PNCParams instance; - public static synchronized PNCParams get() { + public static synchronized PNCParams get() { if (instance == null) { instance = new PNCParams(); } @@ -42,7 +42,7 @@ public class PNCParams extends NetworkParameters { super(); addressHeader = 55; p2shHeader = 5; - acceptableAddressCodes = new int[] {addressHeader, p2shHeader}; + acceptableAddressCodes = new int[]{addressHeader, p2shHeader}; } @Override diff --git a/src/main/java/bisq/desktop/util/validation/params/TerracoinParams.java b/src/main/java/bisq/desktop/util/validation/params/TerracoinParams.java index 44e65d8fbc..7686331c7a 100644 --- a/src/main/java/bisq/desktop/util/validation/params/TerracoinParams.java +++ b/src/main/java/bisq/desktop/util/validation/params/TerracoinParams.java @@ -90,4 +90,4 @@ public class TerracoinParams extends NetworkParameters { public int getProtocolVersionNum(ProtocolVersion version) { return 0; } - } +} diff --git a/src/main/java/bisq/desktop/util/validation/params/WACoinsParams.java b/src/main/java/bisq/desktop/util/validation/params/WACoinsParams.java index 1a09c86736..748dc078ad 100644 --- a/src/main/java/bisq/desktop/util/validation/params/WACoinsParams.java +++ b/src/main/java/bisq/desktop/util/validation/params/WACoinsParams.java @@ -90,4 +90,4 @@ public class WACoinsParams extends NetworkParameters { public int getProtocolVersionNum(ProtocolVersion version) { return 0; } - } +} diff --git a/src/main/java/bisq/desktop/util/validation/params/btc/BtcMainNetParamsForValidation.java b/src/main/java/bisq/desktop/util/validation/params/btc/BtcMainNetParamsForValidation.java index 2fe9dfe353..50190242fe 100644 --- a/src/main/java/bisq/desktop/util/validation/params/btc/BtcMainNetParamsForValidation.java +++ b/src/main/java/bisq/desktop/util/validation/params/btc/BtcMainNetParamsForValidation.java @@ -45,7 +45,7 @@ import static com.google.common.base.Preconditions.checkState; /** * Parameters for the main production network on which people trade goods and services. - * + *

* We cannot use MainNetParams because that would be one of the other base currencies, * so we cloned the MainNetParams to BtcMainNetParamsForValidation */ @@ -120,30 +120,30 @@ public class BtcMainNetParamsForValidation extends AbstractBitcoinNetParams { // Updated Nov. 4th 2017 addrSeeds = new int[]{ - // -- seed.bitcoin.sipa.be -- - 0x254187d, 0x1af0735d, 0x20b72088, 0x30a1c321, 0x3515cb9f, 0x4539448a, 0x459caed5, - 0x4b0559d1, 0x5c88c9c1, 0x726fc523, 0x753b448a, 0x75b25c50, 0x7efc63b3, 0x8e79e849, - 0x914ff334, 0x93d60bc6, 0x9e1df618, 0xa7069f4b, 0xafbd5827, 0xb5a3ce62, 0xc635d054, - 0xc6fa4260, 0xc73aea63, 0xc7437558, 0xd78bbfd5, + // -- seed.bitcoin.sipa.be -- + 0x254187d, 0x1af0735d, 0x20b72088, 0x30a1c321, 0x3515cb9f, 0x4539448a, 0x459caed5, + 0x4b0559d1, 0x5c88c9c1, 0x726fc523, 0x753b448a, 0x75b25c50, 0x7efc63b3, 0x8e79e849, + 0x914ff334, 0x93d60bc6, 0x9e1df618, 0xa7069f4b, 0xafbd5827, 0xb5a3ce62, 0xc635d054, + 0xc6fa4260, 0xc73aea63, 0xc7437558, 0xd78bbfd5, // -- dnsseed.bluematt.me -- - 0x1a536adb, 0x20ecc692, 0x21117c4c, 0x4060d85b, 0x4a9caed5, 0x513caca3, 0x5a636358, - 0x675ad655, 0x75c0d4ad, 0xa5e3e8ad, 0xa6531525, 0xac08ab4c, 0xb2d7af41, 0xb4008bb9, - 0xb5064945, 0xc9fad02f, 0xcb59a28b, 0xd54ba834, 0xe04d0055, 0xed5d5848, 0xfb0a825e, + 0x1a536adb, 0x20ecc692, 0x21117c4c, 0x4060d85b, 0x4a9caed5, 0x513caca3, 0x5a636358, + 0x675ad655, 0x75c0d4ad, 0xa5e3e8ad, 0xa6531525, 0xac08ab4c, 0xb2d7af41, 0xb4008bb9, + 0xb5064945, 0xc9fad02f, 0xcb59a28b, 0xd54ba834, 0xe04d0055, 0xed5d5848, 0xfb0a825e, // -- dnsseed.bitcoin.dashjr.org -- - 0x858ba8c, 0xc201bb9, 0xdded4ad, 0x21fe312d, 0x330fc023, 0x4230b75f, 0x45667a7b, - 0x47370159, 0x64384e57, 0x67b1b14d, 0x6e2a0f33, 0x810c6e3b, 0x9f3a652e, 0xa0def550, - 0xab2d2d18, 0xb06a3850, 0xb7df01a9, 0xc8a8825e, 0xd3ace75c, 0xd5a0aa43, 0xdc0d599f, - 0xe1f00d47, 0xf1519f51, 0xfd83bd56, + 0x858ba8c, 0xc201bb9, 0xdded4ad, 0x21fe312d, 0x330fc023, 0x4230b75f, 0x45667a7b, + 0x47370159, 0x64384e57, 0x67b1b14d, 0x6e2a0f33, 0x810c6e3b, 0x9f3a652e, 0xa0def550, + 0xab2d2d18, 0xb06a3850, 0xb7df01a9, 0xc8a8825e, 0xd3ace75c, 0xd5a0aa43, 0xdc0d599f, + 0xe1f00d47, 0xf1519f51, 0xfd83bd56, // -- seed.bitcoinstats.com -- - 0x2e1ff68, 0x424bd6b, 0x7571e53, 0x14d33174, 0x18aac780, 0x1c5cd812, 0x40614032, - 0x40de1c4d, 0x688fd812, 0x73c6ffad, 0x7dc6ffad, 0x7ebd2149, 0x8c08d153, 0x90b5a6d3, - 0x986fd462, 0xae1c82aa, 0xbeffdc4a, 0xc0a1764b, 0xc0c0b1d3, 0xdff8c768, 0xe0e6a6d3, - 0xe23b0f34, 0xe35f372f, 0xe9ff4748, 0xeed8b943, + 0x2e1ff68, 0x424bd6b, 0x7571e53, 0x14d33174, 0x18aac780, 0x1c5cd812, 0x40614032, + 0x40de1c4d, 0x688fd812, 0x73c6ffad, 0x7dc6ffad, 0x7ebd2149, 0x8c08d153, 0x90b5a6d3, + 0x986fd462, 0xae1c82aa, 0xbeffdc4a, 0xc0a1764b, 0xc0c0b1d3, 0xdff8c768, 0xe0e6a6d3, + 0xe23b0f34, 0xe35f372f, 0xe9ff4748, 0xeed8b943, // -- seed.bitnodes.io -- - 0x4d3921f, 0xf480548, 0x1356b1d1, 0x1d25ddd8, 0x1d556056, 0x233d2567, 0x3058a2b2, - 0x3ee58c9e, 0x45ea0747, 0x4abd2088, 0x4d0d97d8, 0x5246b2b3, 0x5a0ae25b, 0x5a0ea9d9, - 0x5a55f450, 0x64610545, 0x6ed40d3e, 0x7a48cb4a, 0x98c5b35d, 0xaeb473bc, 0xdcefff86, - 0xe170d951, 0xe76280b2, 0xfa1f645e, 0xfb96466d, + 0x4d3921f, 0xf480548, 0x1356b1d1, 0x1d25ddd8, 0x1d556056, 0x233d2567, 0x3058a2b2, + 0x3ee58c9e, 0x45ea0747, 0x4abd2088, 0x4d0d97d8, 0x5246b2b3, 0x5a0ae25b, 0x5a0ea9d9, + 0x5a55f450, 0x64610545, 0x6ed40d3e, 0x7a48cb4a, 0x98c5b35d, 0xaeb473bc, 0xdcefff86, + 0xe170d951, 0xe76280b2, 0xfa1f645e, 0xfb96466d, }; } diff --git a/src/test/java/bisq/common/locale/TradeCurrencyMakers.java b/src/test/java/bisq/common/locale/TradeCurrencyMakers.java index ca3a838500..9692ddfbe0 100644 --- a/src/test/java/bisq/common/locale/TradeCurrencyMakers.java +++ b/src/test/java/bisq/common/locale/TradeCurrencyMakers.java @@ -37,6 +37,6 @@ public class TradeCurrencyMakers { public static final CryptoCurrency bitcoin = make(a(CryptoCurrency)); public static final FiatCurrency euro = make(a(FiatCurrency)); - public static final FiatCurrency usd = make(a(FiatCurrency).but(with(currencyCode,"USD"))); + public static final FiatCurrency usd = make(a(FiatCurrency).but(with(currencyCode, "USD"))); } diff --git a/src/test/java/bisq/common/monetary/VolumeMaker.java b/src/test/java/bisq/common/monetary/VolumeMaker.java index 30004abf96..d822e06e73 100644 --- a/src/test/java/bisq/common/monetary/VolumeMaker.java +++ b/src/test/java/bisq/common/monetary/VolumeMaker.java @@ -31,7 +31,7 @@ public class VolumeMaker { public static final Property volumeString = new Property<>(); public static final Instantiator FiatVolume = lookup -> - new Volume(Fiat.parseFiat(lookup.valueOf(currencyCode, "USD"), lookup.valueOf(volumeString,"100"))); + new Volume(Fiat.parseFiat(lookup.valueOf(currencyCode, "USD"), lookup.valueOf(volumeString, "100"))); public static final Instantiator AltcoinVolume = lookup -> new Volume(Altcoin.parseAltcoin(lookup.valueOf(currencyCode, "LTC"), lookup.valueOf(volumeString, "100"))); diff --git a/src/test/java/bisq/core/offer/OfferMaker.java b/src/test/java/bisq/core/offer/OfferMaker.java index 426719d651..c32f9f0adb 100644 --- a/src/test/java/bisq/core/offer/OfferMaker.java +++ b/src/test/java/bisq/core/offer/OfferMaker.java @@ -35,44 +35,44 @@ public class OfferMaker { public static final Property marketPriceMargin = new Property<>(); public static final Instantiator Offer = lookup -> new Offer( - new OfferPayload("", - 0L, - null, - null, - lookup.valueOf(direction, OfferPayload.Direction.BUY), - lookup.valueOf(price, 100000L), - lookup.valueOf(marketPriceMargin, 0.0), - lookup.valueOf(useMarketBasedPrice, false), - lookup.valueOf(amount, 100000L), - lookup.valueOf(minAmount, 100000L), - lookup.valueOf(baseCurrencyCode, "BTC"), - lookup.valueOf(counterCurrencyCode, "USD"), - null, - null, - "SEPA", - "", - null, - null, - null, - null, - null, - "", - 0L, - 0L, - 0L, - false, - 0L, - 0L, - 0L, - 0L, - false, - false, - 0L, - 0L, - false, - null, - null, - 0)); + new OfferPayload("", + 0L, + null, + null, + lookup.valueOf(direction, OfferPayload.Direction.BUY), + lookup.valueOf(price, 100000L), + lookup.valueOf(marketPriceMargin, 0.0), + lookup.valueOf(useMarketBasedPrice, false), + lookup.valueOf(amount, 100000L), + lookup.valueOf(minAmount, 100000L), + lookup.valueOf(baseCurrencyCode, "BTC"), + lookup.valueOf(counterCurrencyCode, "USD"), + null, + null, + "SEPA", + "", + null, + null, + null, + null, + null, + "", + 0L, + 0L, + 0L, + false, + 0L, + 0L, + 0L, + 0L, + false, + false, + 0L, + 0L, + false, + null, + null, + 0)); public static final Maker btcUsdOffer = a(Offer); } diff --git a/src/test/java/bisq/desktop/main/funds/transactions/DisplayedTransactionsTest.java b/src/test/java/bisq/desktop/main/funds/transactions/DisplayedTransactionsTest.java index d5d11cea5b..1bc407f5c3 100644 --- a/src/test/java/bisq/desktop/main/funds/transactions/DisplayedTransactionsTest.java +++ b/src/test/java/bisq/desktop/main/funds/transactions/DisplayedTransactionsTest.java @@ -55,7 +55,7 @@ public class DisplayedTransactionsTest { } @Test - public void testUpdateWhenRepositoryIsEmpty(){ + public void testUpdateWhenRepositoryIsEmpty() { BtcWalletService walletService = mock(BtcWalletService.class); when(walletService.getTransactions(false)) .thenReturn(Collections.singleton(mock(Transaction.class))); diff --git a/src/test/java/bisq/desktop/main/market/offerbook/OfferBookChartViewModelTest.java b/src/test/java/bisq/desktop/main/market/offerbook/OfferBookChartViewModelTest.java index d49932c972..8dd612d479 100644 --- a/src/test/java/bisq/desktop/main/market/offerbook/OfferBookChartViewModelTest.java +++ b/src/test/java/bisq/desktop/main/market/offerbook/OfferBookChartViewModelTest.java @@ -66,7 +66,7 @@ public class OfferBookChartViewModelTest { when(offerBook.getOfferBookListItems()).thenReturn(offerBookListItems); - final OfferBookChartViewModel model = new OfferBookChartViewModel(offerBook, empty, null,null, new BSFormatter()); + final OfferBookChartViewModel model = new OfferBookChartViewModel(offerBook, empty, null, null, new BSFormatter()); assertEquals(0, model.maxPlacesForBuyPrice.intValue()); } @@ -85,7 +85,7 @@ public class OfferBookChartViewModelTest { when(priceFeedService.updateCounterProperty()).thenReturn(new SimpleIntegerProperty()); when(offerBook.getOfferBookListItems()).thenReturn(offerBookListItems); - final OfferBookChartViewModel model = new OfferBookChartViewModel(offerBook, empty, priceFeedService,null, new BSFormatter()); + final OfferBookChartViewModel model = new OfferBookChartViewModel(offerBook, empty, priceFeedService, null, new BSFormatter()); model.activate(); assertEquals(0, model.maxPlacesForBuyPrice.intValue()); } @@ -102,9 +102,9 @@ public class OfferBookChartViewModelTest { final OfferBookChartViewModel model = new OfferBookChartViewModel(offerBook, empty, service, null, new BSFormatter()); model.activate(); assertEquals(7, model.maxPlacesForBuyPrice.intValue()); - offerBookListItems.addAll(make(btcItem.but(with(OfferBookListItemMaker.price,94016475L)))); + offerBookListItems.addAll(make(btcItem.but(with(OfferBookListItemMaker.price, 94016475L)))); assertEquals(9, model.maxPlacesForBuyPrice.intValue()); - offerBookListItems.addAll(make(btcItem.but(with(OfferBookListItemMaker.price,101016475L)))); + offerBookListItems.addAll(make(btcItem.but(with(OfferBookListItemMaker.price, 101016475L)))); assertEquals(10, model.maxPlacesForBuyPrice.intValue()); } @@ -115,7 +115,7 @@ public class OfferBookChartViewModelTest { when(offerBook.getOfferBookListItems()).thenReturn(offerBookListItems); - final OfferBookChartViewModel model = new OfferBookChartViewModel(offerBook, empty, null,null, new BSFormatter()); + final OfferBookChartViewModel model = new OfferBookChartViewModel(offerBook, empty, null, null, new BSFormatter()); assertEquals(0, model.maxPlacesForBuyVolume.intValue()); } @@ -131,9 +131,9 @@ public class OfferBookChartViewModelTest { final OfferBookChartViewModel model = new OfferBookChartViewModel(offerBook, empty, service, null, new BSFormatter()); model.activate(); assertEquals(4, model.maxPlacesForBuyVolume.intValue()); //0.01 - offerBookListItems.addAll(make(btcItem.but(with(OfferBookListItemMaker.amount,100000000L)))); + offerBookListItems.addAll(make(btcItem.but(with(OfferBookListItemMaker.amount, 100000000L)))); assertEquals(5, model.maxPlacesForBuyVolume.intValue()); //10.00 - offerBookListItems.addAll(make(btcItem.but(with(OfferBookListItemMaker.amount,22128600000L)))); + offerBookListItems.addAll(make(btcItem.but(with(OfferBookListItemMaker.amount, 22128600000L)))); assertEquals(7, model.maxPlacesForBuyVolume.intValue()); //2212.86 } @@ -144,7 +144,7 @@ public class OfferBookChartViewModelTest { when(offerBook.getOfferBookListItems()).thenReturn(offerBookListItems); - final OfferBookChartViewModel model = new OfferBookChartViewModel(offerBook, empty, null,null, new BSFormatter()); + final OfferBookChartViewModel model = new OfferBookChartViewModel(offerBook, empty, null, null, new BSFormatter()); assertEquals(0, model.maxPlacesForSellPrice.intValue()); } @@ -163,7 +163,7 @@ public class OfferBookChartViewModelTest { when(priceFeedService.updateCounterProperty()).thenReturn(new SimpleIntegerProperty()); when(offerBook.getOfferBookListItems()).thenReturn(offerBookListItems); - final OfferBookChartViewModel model = new OfferBookChartViewModel(offerBook, empty, priceFeedService,null, new BSFormatter()); + final OfferBookChartViewModel model = new OfferBookChartViewModel(offerBook, empty, priceFeedService, null, new BSFormatter()); model.activate(); assertEquals(0, model.maxPlacesForSellPrice.intValue()); } @@ -180,9 +180,9 @@ public class OfferBookChartViewModelTest { final OfferBookChartViewModel model = new OfferBookChartViewModel(offerBook, empty, service, null, new BSFormatter()); model.activate(); assertEquals(7, model.maxPlacesForSellPrice.intValue()); - offerBookListItems.addAll(make(btcSellItem.but(with(OfferBookListItemMaker.price,94016475L)))); + offerBookListItems.addAll(make(btcSellItem.but(with(OfferBookListItemMaker.price, 94016475L)))); assertEquals(9, model.maxPlacesForSellPrice.intValue()); - offerBookListItems.addAll(make(btcSellItem.but(with(OfferBookListItemMaker.price,101016475L)))); + offerBookListItems.addAll(make(btcSellItem.but(with(OfferBookListItemMaker.price, 101016475L)))); assertEquals(10, model.maxPlacesForSellPrice.intValue()); } @@ -193,7 +193,7 @@ public class OfferBookChartViewModelTest { when(offerBook.getOfferBookListItems()).thenReturn(offerBookListItems); - final OfferBookChartViewModel model = new OfferBookChartViewModel(offerBook, empty, null,null, new BSFormatter()); + final OfferBookChartViewModel model = new OfferBookChartViewModel(offerBook, empty, null, null, new BSFormatter()); assertEquals(0, model.maxPlacesForSellVolume.intValue()); } @@ -209,9 +209,9 @@ public class OfferBookChartViewModelTest { final OfferBookChartViewModel model = new OfferBookChartViewModel(offerBook, empty, service, null, new BSFormatter()); model.activate(); assertEquals(4, model.maxPlacesForSellVolume.intValue()); //0.01 - offerBookListItems.addAll(make(btcSellItem.but(with(OfferBookListItemMaker.amount,100000000L)))); + offerBookListItems.addAll(make(btcSellItem.but(with(OfferBookListItemMaker.amount, 100000000L)))); assertEquals(5, model.maxPlacesForSellVolume.intValue()); //10.00 - offerBookListItems.addAll(make(btcSellItem.but(with(OfferBookListItemMaker.amount,22128600000L)))); + offerBookListItems.addAll(make(btcSellItem.but(with(OfferBookListItemMaker.amount, 22128600000L)))); assertEquals(7, model.maxPlacesForSellVolume.intValue()); //2212.86 } } diff --git a/src/test/java/bisq/desktop/main/market/spread/SpreadViewModelTest.java b/src/test/java/bisq/desktop/main/market/spread/SpreadViewModelTest.java index 42fac500d4..2f01eb9ff0 100644 --- a/src/test/java/bisq/desktop/main/market/spread/SpreadViewModelTest.java +++ b/src/test/java/bisq/desktop/main/market/spread/SpreadViewModelTest.java @@ -65,7 +65,7 @@ public class SpreadViewModelTest { final SpreadViewModel model = new SpreadViewModel(offerBook, null, new BSFormatter()); model.activate(); assertEquals(6, model.maxPlacesForAmount.intValue()); // 0.001 - offerBookListItems.addAll(make(btcItem.but(with(OfferBookListItemMaker.amount,1403000000L)))); + offerBookListItems.addAll(make(btcItem.but(with(OfferBookListItemMaker.amount, 1403000000L)))); assertEquals(7, model.maxPlacesForAmount.intValue()); //14.0300 } } diff --git a/src/test/java/bisq/desktop/main/offer/createoffer/CreateOfferViewModelTest.java b/src/test/java/bisq/desktop/main/offer/createoffer/CreateOfferViewModelTest.java index 27d2532f31..8d16874218 100644 --- a/src/test/java/bisq/desktop/main/offer/createoffer/CreateOfferViewModelTest.java +++ b/src/test/java/bisq/desktop/main/offer/createoffer/CreateOfferViewModelTest.java @@ -63,7 +63,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @RunWith(PowerMockRunner.class) -@PrepareForTest({BtcWalletService .class, AddressEntry.class, PriceFeedService.class, User.class, +@PrepareForTest({BtcWalletService.class, AddressEntry.class, PriceFeedService.class, User.class, FeeService.class, CreateOfferDataModel.class, PaymentAccount.class, BsqWalletService.class, SecurityDepositValidator.class}) public class CreateOfferViewModelTest { @@ -100,7 +100,7 @@ public class CreateOfferViewModelTest { when(user.getPaymentAccountsAsObservable()).thenReturn(FXCollections.observableSet()); when(securityDepositValidator.validate(any())).thenReturn(new InputValidator.ValidationResult(false)); - CreateOfferDataModel dataModel = new CreateOfferDataModel(null, btcWalletService, bsqWalletService, empty, user, null,null, priceFeedService,null, null, null, feeService, bsFormatter); + CreateOfferDataModel dataModel = new CreateOfferDataModel(null, btcWalletService, bsqWalletService, empty, user, null, null, priceFeedService, null, null, null, feeService, bsFormatter); dataModel.initWithData(OfferPayload.Direction.BUY, new CryptoCurrency("BTC", "bitcoin")); dataModel.activate(); diff --git a/src/test/java/bisq/desktop/main/offer/offerbook/OfferBookViewModelTest.java b/src/test/java/bisq/desktop/main/offer/offerbook/OfferBookViewModelTest.java index 411a4824e8..d4f19cf0de 100644 --- a/src/test/java/bisq/desktop/main/offer/offerbook/OfferBookViewModelTest.java +++ b/src/test/java/bisq/desktop/main/offer/offerbook/OfferBookViewModelTest.java @@ -275,7 +275,7 @@ public class OfferBookViewModelTest { offerBookListItems.addAll(make(btcItemWithRange.but(with(amount, 2000000000L)))); assertEquals(16, model.maxPlacesForAmount.intValue()); offerBookListItems.addAll(make(btcItemWithRange.but(with(minAmount, 30000000000L), - with(amount,30000000000L)))); + with(amount, 30000000000L)))); assertEquals(19, model.maxPlacesForAmount.intValue()); } @@ -329,7 +329,7 @@ public class OfferBookViewModelTest { offerBookListItems.addAll(make(btcItemWithRange.but(with(amount, 2000000000L)))); assertEquals(17, model.maxPlacesForVolume.intValue()); offerBookListItems.addAll(make(btcItemWithRange.but(with(minAmount, 30000000000L), - with(amount,30000000000L)))); + with(amount, 30000000000L)))); assertEquals(25, model.maxPlacesForVolume.intValue()); } diff --git a/src/test/java/bisq/desktop/util/CurrencyListItemMakers.java b/src/test/java/bisq/desktop/util/CurrencyListItemMakers.java index dc6bbb690a..ef47b0aa3c 100644 --- a/src/test/java/bisq/desktop/util/CurrencyListItemMakers.java +++ b/src/test/java/bisq/desktop/util/CurrencyListItemMakers.java @@ -34,7 +34,7 @@ public class CurrencyListItemMakers { public static final Property numberOfTrades = new Property<>(); public static final Instantiator CurrencyListItem = lookup -> - new CurrencyListItem(lookup.valueOf(tradeCurrency, bitcoin), lookup.valueOf(numberOfTrades, 0)); + new CurrencyListItem(lookup.valueOf(tradeCurrency, bitcoin), lookup.valueOf(numberOfTrades, 0)); public static final Maker bitcoinItem = a(CurrencyListItem); public static final Maker euroItem = a(CurrencyListItem, with(tradeCurrency, euro)); diff --git a/src/test/java/bisq/desktop/util/GUIUtilTest.java b/src/test/java/bisq/desktop/util/GUIUtilTest.java index 3226cbb834..273643efe6 100644 --- a/src/test/java/bisq/desktop/util/GUIUtilTest.java +++ b/src/test/java/bisq/desktop/util/GUIUtilTest.java @@ -72,7 +72,7 @@ public class GUIUtilTest { Res.get("shared.multipleOffers"), empty); - assertEquals("✦ BTC (BTC) - 10 offers", currencyListItemConverter.toString(make(bitcoinItem.but(with(numberOfTrades,10))))); + assertEquals("✦ BTC (BTC) - 10 offers", currencyListItemConverter.toString(make(bitcoinItem.but(with(numberOfTrades, 10))))); assertEquals("★ Euro (EUR) - 0 offers", currencyListItemConverter.toString(make(euroItem))); assertEquals("★ Euro (EUR) - 1 offer", currencyListItemConverter.toString(make(euroItem.but(with(numberOfTrades, 1)))));