From 830932d93d338cd23114a61e98eb5ffae135c0bc Mon Sep 17 00:00:00 2001 From: Chris Beams Date: Sun, 2 Nov 2014 16:28:26 +0100 Subject: [PATCH 1/2] Strip trailing whitespace --- src/main/java/io/bitsquare/SeedNode.java | 2 +- .../io/bitsquare/btc/AddressBasedCoinSelector.java | 2 +- src/main/java/io/bitsquare/btc/FeePolicy.java | 2 +- src/main/java/io/bitsquare/gui/Navigation.java | 4 ++-- .../io/bitsquare/gui/components/InfoDisplay.java | 6 +++--- .../io/bitsquare/gui/components/InputTextField.java | 2 +- .../content/changepassword/ChangePasswordViewCB.java | 2 +- .../main/account/content/fiat/FiatAccountModel.java | 2 +- .../main/account/content/fiat/FiatAccountViewCB.java | 2 +- .../main/account/content/irc/IrcAccountViewCB.java | 2 +- .../account/content/password/PasswordViewCB.java | 2 +- .../content/registration/RegistrationModel.java | 4 ++-- .../content/registration/RegistrationViewCB.java | 2 +- .../content/restrictions/RestrictionsModel.java | 2 +- .../account/content/seedwords/SeedWordsViewCB.java | 2 +- .../main/funds/transactions/TransactionsViewCB.java | 2 +- .../java/io/bitsquare/gui/main/home/HomeViewCB.java | 2 +- .../gui/main/portfolio/PortfolioViewCB.java | 2 +- .../main/portfolio/pending/PendingTradesModel.java | 2 +- .../gui/main/trade/createoffer/CreateOfferPM.java | 6 +++--- .../main/trade/createoffer/CreateOfferViewCB.java | 4 ++-- .../gui/main/trade/offerbook/OfferBookPM.java | 2 +- .../gui/main/trade/takeoffer/TakeOfferPM.java | 2 +- .../gui/main/trade/takeoffer/TakeOfferViewCB.java | 2 +- src/main/java/io/bitsquare/locale/CountryUtil.java | 4 ++-- src/main/java/io/bitsquare/msg/actor/DHTManager.java | 2 +- .../java/io/bitsquare/network/tomp2p/TomP2PPeer.java | 2 +- src/main/java/io/bitsquare/trade/Trade.java | 2 +- .../protocol/createoffer/tasks/VerifyOffer.java | 2 +- src/main/java/io/bitsquare/user/User.java | 6 +++--- src/main/java/io/bitsquare/util/ViewLoader.java | 2 +- .../io/bitsquare/msg/BasicUsecasesInWANTest.java | 4 ++-- src/test/java/net/tomp2p/dht/UtilsDHT2.java | 12 ++++++------ 33 files changed, 49 insertions(+), 49 deletions(-) diff --git a/src/main/java/io/bitsquare/SeedNode.java b/src/main/java/io/bitsquare/SeedNode.java index b2972abc98..54005460a8 100644 --- a/src/main/java/io/bitsquare/SeedNode.java +++ b/src/main/java/io/bitsquare/SeedNode.java @@ -67,7 +67,7 @@ public class SeedNode extends Thread { @Override public void peerUpdated(PeerAddress peerAddress, PeerStatistic peerStatistics) { - // log.debug("Peer updated: peerAddress=" + peerAddress + ", + // log.debug("Peer updated: peerAddress=" + peerAddress + ", // peerStatistics=" + peerStatistics); } }); diff --git a/src/main/java/io/bitsquare/btc/AddressBasedCoinSelector.java b/src/main/java/io/bitsquare/btc/AddressBasedCoinSelector.java index 3784268e3f..1e5b89dbf3 100644 --- a/src/main/java/io/bitsquare/btc/AddressBasedCoinSelector.java +++ b/src/main/java/io/bitsquare/btc/AddressBasedCoinSelector.java @@ -99,7 +99,7 @@ class AddressBasedCoinSelector extends DefaultCoinSelector { // we accept network tx without confirmations and numBroadcastPeers > 0 //confidence.getSource().equals(TransactionConfidence.Source.SELF) && // In regtest mode we expect to have only one peer, so we won't see transactions propagate. - // TODO: The value 1 below dates from a time when transactions we broadcast *to* were + // TODO: The value 1 below dates from a time when transactions we broadcast *to* were // counted, set to 0 (confidence.numBroadcastPeers() > 1 || tx.getParams() == RegTestParams.get());*/ diff --git a/src/main/java/io/bitsquare/btc/FeePolicy.java b/src/main/java/io/bitsquare/btc/FeePolicy.java index 87d75c6c57..1e3d2b92f1 100644 --- a/src/main/java/io/bitsquare/btc/FeePolicy.java +++ b/src/main/java/io/bitsquare/btc/FeePolicy.java @@ -49,7 +49,7 @@ public class FeePolicy { // Not used at the moment // private static final String registrationFeeAddress = "mvkDXt4QmN4Nq9dRUsRigBCaovde9nLkZR"; - // + // private static String createOfferFeeAddress; private static String takeOfferFeeAddress; diff --git a/src/main/java/io/bitsquare/gui/Navigation.java b/src/main/java/io/bitsquare/gui/Navigation.java index 8c635a9216..350d00637a 100644 --- a/src/main/java/io/bitsquare/gui/Navigation.java +++ b/src/main/java/io/bitsquare/gui/Navigation.java @@ -32,8 +32,8 @@ public class Navigation { private static final Logger log = LoggerFactory.getLogger(Navigation.class); - // New listeners can be added during iteration so we use CopyOnWriteArrayList to prevent invalid array - // modification + // New listeners can be added during iteration so we use CopyOnWriteArrayList to prevent invalid array + // modification private final List listeners = new CopyOnWriteArrayList<>(); private final Persistence persistence; private Item[] currentItems; diff --git a/src/main/java/io/bitsquare/gui/components/InfoDisplay.java b/src/main/java/io/bitsquare/gui/components/InfoDisplay.java index 0bf661387b..134572cba6 100644 --- a/src/main/java/io/bitsquare/gui/components/InfoDisplay.java +++ b/src/main/java/io/bitsquare/gui/components/InfoDisplay.java @@ -86,7 +86,7 @@ public class InfoDisplay extends Parent { link = new Hyperlink(BSResources.get("shared.readMore")); link.setPadding(new Insets(0, 0, 0, -2)); - // We need that to know if we have a wrapping or not. + // We need that to know if we have a wrapping or not. // Did not find a way to get that from the API. Label testLabel = new Label(); testLabel.textProperty().bind(text); @@ -109,7 +109,7 @@ public class InfoDisplay extends Parent { }; - // when clicking "Read more..." we expand and change the link to the Help + // when clicking "Read more..." we expand and change the link to the Help link.setOnAction(new EventHandler() { @Override public void handle(ActionEvent actionEvent) { @@ -136,7 +136,7 @@ public class InfoDisplay extends Parent { sceneProperty().addListener((ov, oldValue, newValue) -> { if (oldValue == null && newValue != null && newValue.getWindow() != null) { newValue.getWindow().widthProperty().addListener(listener); - // localToScene does deliver 0 instead of the correct x position when scene propery gets set, + // localToScene does deliver 0 instead of the correct x position when scene propery gets set, // so we delay for 1 render cycle Platform.runLater(() -> { label.setVisible(true); diff --git a/src/main/java/io/bitsquare/gui/components/InputTextField.java b/src/main/java/io/bitsquare/gui/components/InputTextField.java index 027c286508..fc9c8dd7f4 100644 --- a/src/main/java/io/bitsquare/gui/components/InputTextField.java +++ b/src/main/java/io/bitsquare/gui/components/InputTextField.java @@ -45,7 +45,7 @@ import org.slf4j.LoggerFactory; * There can be only 1 errorMessageDisplays at a time we use static field for it. * The position is derived from the position of the textField itself or if set from the layoutReference node. */ -//TODO There are some rare situation where it behaves buggy. Needs further investigation and improvements. Also +//TODO There are some rare situation where it behaves buggy. Needs further investigation and improvements. Also // consider replacement with controlsFX components. public class InputTextField extends TextField { private static final Logger log = LoggerFactory.getLogger(InputTextField.class); diff --git a/src/main/java/io/bitsquare/gui/main/account/content/changepassword/ChangePasswordViewCB.java b/src/main/java/io/bitsquare/gui/main/account/content/changepassword/ChangePasswordViewCB.java index ab50bd948a..f3a8b6e8d9 100644 --- a/src/main/java/io/bitsquare/gui/main/account/content/changepassword/ChangePasswordViewCB.java +++ b/src/main/java/io/bitsquare/gui/main/account/content/changepassword/ChangePasswordViewCB.java @@ -89,7 +89,7 @@ public class ChangePasswordViewCB extends CachedViewCB impleme /////////////////////////////////////////////////////////////////////////////////////////// - // ContextAware implementation + // ContextAware implementation /////////////////////////////////////////////////////////////////////////////////////////// @Override diff --git a/src/main/java/io/bitsquare/gui/main/account/content/fiat/FiatAccountModel.java b/src/main/java/io/bitsquare/gui/main/account/content/fiat/FiatAccountModel.java index c4a2c87d01..24eb043004 100644 --- a/src/main/java/io/bitsquare/gui/main/account/content/fiat/FiatAccountModel.java +++ b/src/main/java/io/bitsquare/gui/main/account/content/fiat/FiatAccountModel.java @@ -138,7 +138,7 @@ class FiatAccountModel extends UIModel { reset(); } - // We ask the user if he likes to add his own bank account country to the accepted country list if he has not + // We ask the user if he likes to add his own bank account country to the accepted country list if he has not // already added it before void addCountryToAcceptedCountriesList() { settings.addAcceptedCountry(country.get()); diff --git a/src/main/java/io/bitsquare/gui/main/account/content/fiat/FiatAccountViewCB.java b/src/main/java/io/bitsquare/gui/main/account/content/fiat/FiatAccountViewCB.java index e361bccbc7..77e709f6e4 100644 --- a/src/main/java/io/bitsquare/gui/main/account/content/fiat/FiatAccountViewCB.java +++ b/src/main/java/io/bitsquare/gui/main/account/content/fiat/FiatAccountViewCB.java @@ -130,7 +130,7 @@ public class FiatAccountViewCB extends CachedViewCB implements Co /////////////////////////////////////////////////////////////////////////////////////////// - // ContextAware implementation + // ContextAware implementation /////////////////////////////////////////////////////////////////////////////////////////// @Override diff --git a/src/main/java/io/bitsquare/gui/main/account/content/irc/IrcAccountViewCB.java b/src/main/java/io/bitsquare/gui/main/account/content/irc/IrcAccountViewCB.java index 43406c72f2..a9f1e57bc8 100644 --- a/src/main/java/io/bitsquare/gui/main/account/content/irc/IrcAccountViewCB.java +++ b/src/main/java/io/bitsquare/gui/main/account/content/irc/IrcAccountViewCB.java @@ -150,7 +150,7 @@ public class IrcAccountViewCB extends CachedViewCB implements Cont /////////////////////////////////////////////////////////////////////////////////////////// - // ContextAware implementation + // ContextAware implementation /////////////////////////////////////////////////////////////////////////////////////////// @Override diff --git a/src/main/java/io/bitsquare/gui/main/account/content/password/PasswordViewCB.java b/src/main/java/io/bitsquare/gui/main/account/content/password/PasswordViewCB.java index cf8e6688c5..589079c4ad 100644 --- a/src/main/java/io/bitsquare/gui/main/account/content/password/PasswordViewCB.java +++ b/src/main/java/io/bitsquare/gui/main/account/content/password/PasswordViewCB.java @@ -89,7 +89,7 @@ public class PasswordViewCB extends CachedViewCB implements ContextA /////////////////////////////////////////////////////////////////////////////////////////// - // ContextAware implementation + // ContextAware implementation /////////////////////////////////////////////////////////////////////////////////////////// @Override diff --git a/src/main/java/io/bitsquare/gui/main/account/content/registration/RegistrationModel.java b/src/main/java/io/bitsquare/gui/main/account/content/registration/RegistrationModel.java index 5f1a6b35a8..01c22e1386 100644 --- a/src/main/java/io/bitsquare/gui/main/account/content/registration/RegistrationModel.java +++ b/src/main/java/io/bitsquare/gui/main/account/content/registration/RegistrationModel.java @@ -148,7 +148,7 @@ class RegistrationModel extends UIModel { /////////////////////////////////////////////////////////////////////////////////////////// - // Getters + // Getters /////////////////////////////////////////////////////////////////////////////////////////// WalletFacade getWalletFacade() { @@ -169,7 +169,7 @@ class RegistrationModel extends UIModel { /////////////////////////////////////////////////////////////////////////////////////////// - // Private + // Private /////////////////////////////////////////////////////////////////////////////////////////// private void updateBalance(@NotNull Coin balance) { diff --git a/src/main/java/io/bitsquare/gui/main/account/content/registration/RegistrationViewCB.java b/src/main/java/io/bitsquare/gui/main/account/content/registration/RegistrationViewCB.java index 219d340e52..414a7b498e 100644 --- a/src/main/java/io/bitsquare/gui/main/account/content/registration/RegistrationViewCB.java +++ b/src/main/java/io/bitsquare/gui/main/account/content/registration/RegistrationViewCB.java @@ -158,7 +158,7 @@ public class RegistrationViewCB extends CachedViewCB implements /////////////////////////////////////////////////////////////////////////////////////////// - // ContextAware implementation + // ContextAware implementation /////////////////////////////////////////////////////////////////////////////////////////// @Override diff --git a/src/main/java/io/bitsquare/gui/main/account/content/restrictions/RestrictionsModel.java b/src/main/java/io/bitsquare/gui/main/account/content/restrictions/RestrictionsModel.java index 0cf422230c..48320f24a1 100644 --- a/src/main/java/io/bitsquare/gui/main/account/content/restrictions/RestrictionsModel.java +++ b/src/main/java/io/bitsquare/gui/main/account/content/restrictions/RestrictionsModel.java @@ -178,7 +178,7 @@ class RestrictionsModel extends UIModel { /////////////////////////////////////////////////////////////////////////////////////////// - // Private + // Private /////////////////////////////////////////////////////////////////////////////////////////// private void saveSettings() { diff --git a/src/main/java/io/bitsquare/gui/main/account/content/seedwords/SeedWordsViewCB.java b/src/main/java/io/bitsquare/gui/main/account/content/seedwords/SeedWordsViewCB.java index df6802dc31..133a055cbc 100644 --- a/src/main/java/io/bitsquare/gui/main/account/content/seedwords/SeedWordsViewCB.java +++ b/src/main/java/io/bitsquare/gui/main/account/content/seedwords/SeedWordsViewCB.java @@ -85,7 +85,7 @@ public class SeedWordsViewCB extends CachedViewCB implements Contex /////////////////////////////////////////////////////////////////////////////////////////// - // ContextAware implementation + // ContextAware implementation /////////////////////////////////////////////////////////////////////////////////////////// @Override diff --git a/src/main/java/io/bitsquare/gui/main/funds/transactions/TransactionsViewCB.java b/src/main/java/io/bitsquare/gui/main/funds/transactions/TransactionsViewCB.java index a1f9aa33df..1d8271c81d 100644 --- a/src/main/java/io/bitsquare/gui/main/funds/transactions/TransactionsViewCB.java +++ b/src/main/java/io/bitsquare/gui/main/funds/transactions/TransactionsViewCB.java @@ -122,7 +122,7 @@ public class TransactionsViewCB extends CachedViewCB { Popups.openWarningPopup("Under construction", "This will open a details popup but that is not implemented yet."); } - + /////////////////////////////////////////////////////////////////////////////////////////// // Cell factories diff --git a/src/main/java/io/bitsquare/gui/main/home/HomeViewCB.java b/src/main/java/io/bitsquare/gui/main/home/HomeViewCB.java index 82bad072aa..372d558b52 100644 --- a/src/main/java/io/bitsquare/gui/main/home/HomeViewCB.java +++ b/src/main/java/io/bitsquare/gui/main/home/HomeViewCB.java @@ -26,7 +26,7 @@ import java.util.ResourceBundle; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -// home is just hosting the arbiters buttons yet, but that's just for dev, not clear yet what will be in home, +// home is just hosting the arbiters buttons yet, but that's just for dev, not clear yet what will be in home, // probably overview, event history, news, charts,... -> low prio public class HomeViewCB extends CachedViewCB { private static final Logger log = LoggerFactory.getLogger(HomeViewCB.class); diff --git a/src/main/java/io/bitsquare/gui/main/portfolio/PortfolioViewCB.java b/src/main/java/io/bitsquare/gui/main/portfolio/PortfolioViewCB.java index 67d6e54d92..e7a1971ef5 100644 --- a/src/main/java/io/bitsquare/gui/main/portfolio/PortfolioViewCB.java +++ b/src/main/java/io/bitsquare/gui/main/portfolio/PortfolioViewCB.java @@ -81,7 +81,7 @@ public class PortfolioViewCB extends CachedViewCB { if (newValue == offersTab) navigation.navigationTo(Navigation.Item.MAIN, Navigation.Item.PORTFOLIO, Navigation.Item.OFFERS); else if (newValue == pendingTradesTab) - navigation.navigationTo(Navigation.Item.MAIN, Navigation.Item.PORTFOLIO, + navigation.navigationTo(Navigation.Item.MAIN, Navigation.Item.PORTFOLIO, Navigation.Item.PENDING_TRADES); else if (newValue == closedTradesTab) navigation.navigationTo(Navigation.Item.MAIN, Navigation.Item.PORTFOLIO, Navigation.Item.CLOSED_TRADES); diff --git a/src/main/java/io/bitsquare/gui/main/portfolio/pending/PendingTradesModel.java b/src/main/java/io/bitsquare/gui/main/portfolio/pending/PendingTradesModel.java index 37975e2fdd..31eac954fe 100644 --- a/src/main/java/io/bitsquare/gui/main/portfolio/pending/PendingTradesModel.java +++ b/src/main/java/io/bitsquare/gui/main/portfolio/pending/PendingTradesModel.java @@ -331,4 +331,4 @@ class PendingTradesModel extends UIModel { } } - + diff --git a/src/main/java/io/bitsquare/gui/main/trade/createoffer/CreateOfferPM.java b/src/main/java/io/bitsquare/gui/main/trade/createoffer/CreateOfferPM.java index 0790fcdbb7..45fc40ef04 100644 --- a/src/main/java/io/bitsquare/gui/main/trade/createoffer/CreateOfferPM.java +++ b/src/main/java/io/bitsquare/gui/main/trade/createoffer/CreateOfferPM.java @@ -158,7 +158,7 @@ class CreateOfferPM extends PresentationModel { directionLabel.set(model.getDirection() == Direction.BUY ? BSResources.get("shared.buy") : BSResources.get ("shared.sell")); - // apply only if valid + // apply only if valid boolean amountValid = false; if (amount != null && isBtcInputValid(amount.toPlainString()) .isValid) { @@ -201,7 +201,7 @@ class CreateOfferPM extends PresentationModel { isPlaceOfferButtonVisible.set(true); } - // On focus out we do validation and apply the data to the model + // On focus out we do validation and apply the data to the model void onFocusOutAmountTextField(Boolean oldValue, Boolean newValue, String userInput) { if (oldValue && !newValue) { InputValidator.ValidationResult result = isBtcInputValid(amount.get()); @@ -277,7 +277,7 @@ class CreateOfferPM extends PresentationModel { calculateAmount(); - // must be placed after calculateAmount (btc value has been adjusted in case the calculation leads to + // must be placed after calculateAmount (btc value has been adjusted in case the calculation leads to // invalid decimal places for the amount value showWarningAdjustedVolume.set(!formatter.formatFiat(formatter.parseToFiatWith2Decimals(userInput)) .equals(volume diff --git a/src/main/java/io/bitsquare/gui/main/trade/createoffer/CreateOfferViewCB.java b/src/main/java/io/bitsquare/gui/main/trade/createoffer/CreateOfferViewCB.java index 97b72b19f5..a63dada893 100644 --- a/src/main/java/io/bitsquare/gui/main/trade/createoffer/CreateOfferViewCB.java +++ b/src/main/java/io/bitsquare/gui/main/trade/createoffer/CreateOfferViewCB.java @@ -70,7 +70,7 @@ import org.slf4j.LoggerFactory; import static javafx.beans.binding.Bindings.createStringBinding; // TODO Implement other positioning method in InoutTextField to display it over the field instead of right side -// priceAmountHBox is too large after redesign as to be used as layoutReference. +// priceAmountHBox is too large after redesign as to be used as layoutReference. public class CreateOfferViewCB extends CachedViewCB { private static final Logger log = LoggerFactory.getLogger(CreateOfferViewCB.class); @@ -350,7 +350,7 @@ public class CreateOfferViewCB extends CachedViewCB { if (newValue) { overlayManager.blurContent(); - // Dialogs are a bit limited. There is no callback for the InformationDialog button click, so we added + // Dialogs are a bit limited. There is no callback for the InformationDialog button click, so we added // our own actions. List actions = new ArrayList<>(); /* actions.add(new AbstractAction(BSResources.get("shared.copyTxId")) { diff --git a/src/main/java/io/bitsquare/gui/main/trade/offerbook/OfferBookPM.java b/src/main/java/io/bitsquare/gui/main/trade/offerbook/OfferBookPM.java index 8214e1989e..8845e5940d 100644 --- a/src/main/java/io/bitsquare/gui/main/trade/offerbook/OfferBookPM.java +++ b/src/main/java/io/bitsquare/gui/main/trade/offerbook/OfferBookPM.java @@ -82,7 +82,7 @@ class OfferBookPM extends PresentationModel { fiatCode.bind(model.fiatCode); restrictionsInfo.bind(model.restrictionsInfo); - // Bidirectional bindings are used for all input fields: amount, price and volume + // Bidirectional bindings are used for all input fields: amount, price and volume // We do volume/amount calculation during input, so user has immediate feedback amount.addListener((ov, oldValue, newValue) -> { if (isBtcInputValid(newValue).isValid) { diff --git a/src/main/java/io/bitsquare/gui/main/trade/takeoffer/TakeOfferPM.java b/src/main/java/io/bitsquare/gui/main/trade/takeoffer/TakeOfferPM.java index cb2a0fbe5d..48afc5b312 100644 --- a/src/main/java/io/bitsquare/gui/main/trade/takeoffer/TakeOfferPM.java +++ b/src/main/java/io/bitsquare/gui/main/trade/takeoffer/TakeOfferPM.java @@ -202,7 +202,7 @@ class TakeOfferPM extends PresentationModel { isTakeOfferButtonVisible.set(true); } - // On focus out we do validation and apply the data to the model + // On focus out we do validation and apply the data to the model void onFocusOutAmountTextField(Boolean oldValue, Boolean newValue, String userInput) { if (oldValue && !newValue) { InputValidator.ValidationResult result = isBtcInputValid(amount.get()); diff --git a/src/main/java/io/bitsquare/gui/main/trade/takeoffer/TakeOfferViewCB.java b/src/main/java/io/bitsquare/gui/main/trade/takeoffer/TakeOfferViewCB.java index 9e6c274440..de51061850 100644 --- a/src/main/java/io/bitsquare/gui/main/trade/takeoffer/TakeOfferViewCB.java +++ b/src/main/java/io/bitsquare/gui/main/trade/takeoffer/TakeOfferViewCB.java @@ -324,7 +324,7 @@ public class TakeOfferViewCB extends CachedViewCB { if (newValue) { overlayManager.blurContent(); - // Dialogs are a bit limited. There is no callback for the InformationDialog button click, so we added + // Dialogs are a bit limited. There is no callback for the InformationDialog button click, so we added // our own actions. List actions = new ArrayList<>(); /* actions.add(new AbstractAction(BSResources.get("shared.copyTxId")) { diff --git a/src/main/java/io/bitsquare/locale/CountryUtil.java b/src/main/java/io/bitsquare/locale/CountryUtil.java index e6024a47c6..2cbe6f334f 100644 --- a/src/main/java/io/bitsquare/locale/CountryUtil.java +++ b/src/main/java/io/bitsquare/locale/CountryUtil.java @@ -131,8 +131,8 @@ public class CountryUtil { return regionCode; } - // We use getAvailableLocales as we depend on display names (would be a bit painful with translations if handled - // from a static list -or we find something ready made?). + // We use getAvailableLocales as we depend on display names (would be a bit painful with translations if handled + // from a static list -or we find something ready made?). private static List getAllCountryLocales() { List allLocales = Arrays.asList(Locale.getAvailableLocales()); Set allLocalesAsSet = allLocales.stream().filter(locale -> !"".equals(locale.getCountry())) diff --git a/src/main/java/io/bitsquare/msg/actor/DHTManager.java b/src/main/java/io/bitsquare/msg/actor/DHTManager.java index ee0ad5fd70..3f32dd73b0 100644 --- a/src/main/java/io/bitsquare/msg/actor/DHTManager.java +++ b/src/main/java/io/bitsquare/msg/actor/DHTManager.java @@ -91,7 +91,7 @@ public class DHTManager extends AbstractActor { @Override public void peerUpdated(PeerAddress peerAddress, PeerStatistic peerStatistics) { - // log.debug("Peer updated: peerAddress=" + peerAddress + ", + // log.debug("Peer updated: peerAddress=" + peerAddress + ", // peerStatistics=" + peerStatistics); } }); diff --git a/src/main/java/io/bitsquare/network/tomp2p/TomP2PPeer.java b/src/main/java/io/bitsquare/network/tomp2p/TomP2PPeer.java index 55a9555da3..4702f87e4d 100644 --- a/src/main/java/io/bitsquare/network/tomp2p/TomP2PPeer.java +++ b/src/main/java/io/bitsquare/network/tomp2p/TomP2PPeer.java @@ -33,7 +33,7 @@ import net.tomp2p.peers.PeerAddress; public class TomP2PPeer implements Peer, Serializable { private static final long serialVersionUID = -2022551056208230853L; - + private final PeerAddress peerAddress; public TomP2PPeer(PeerAddress peerAddress) { diff --git a/src/main/java/io/bitsquare/trade/Trade.java b/src/main/java/io/bitsquare/trade/Trade.java index 1dc80b05d8..0b5c3e9e84 100644 --- a/src/main/java/io/bitsquare/trade/Trade.java +++ b/src/main/java/io/bitsquare/trade/Trade.java @@ -63,7 +63,7 @@ public class Trade implements Serializable { private State state; private Throwable fault; - // When serialized those transient properties are not instantiated, so we instantiate them in the getters at first + // When serialized those transient properties are not instantiated, so we instantiate them in the getters at first // access. Only use the accessor not the private field. // TODO use ObjectProperties instead of BooleanProperty transient private BooleanProperty _payoutTxChanged; diff --git a/src/main/java/io/bitsquare/trade/protocol/createoffer/tasks/VerifyOffer.java b/src/main/java/io/bitsquare/trade/protocol/createoffer/tasks/VerifyOffer.java index c8a3de8330..45323e40b3 100644 --- a/src/main/java/io/bitsquare/trade/protocol/createoffer/tasks/VerifyOffer.java +++ b/src/main/java/io/bitsquare/trade/protocol/createoffer/tasks/VerifyOffer.java @@ -62,7 +62,7 @@ public class VerifyOffer { // TODO check balance // securityDeposit - // Coin totalsToFund + // Coin totalsToFund // getAddressInfoByTradeID(offerId) // TODO when offer is flattened continue here... diff --git a/src/main/java/io/bitsquare/user/User.java b/src/main/java/io/bitsquare/user/User.java index fe0a4921c8..096c6763dc 100644 --- a/src/main/java/io/bitsquare/user/User.java +++ b/src/main/java/io/bitsquare/user/User.java @@ -50,7 +50,7 @@ public class User implements Serializable { private KeyPair messageKeyPair; private String accountID; - // Used for serialisation (ObservableList cannot be serialized) -> serialisation will change anyway so that is + // Used for serialisation (ObservableList cannot be serialized) -> serialisation will change anyway so that is // only temporary private List _bankAccounts = new ArrayList<>(); private BankAccount _currentBankAccount; @@ -59,7 +59,7 @@ public class User implements Serializable { private final transient ObjectProperty currentBankAccount = new SimpleObjectProperty<>(); public User() { - // Used for serialisation (ObservableList cannot be serialized) -> serialisation will change anyway so that is + // Used for serialisation (ObservableList cannot be serialized) -> serialisation will change anyway so that is // only temporary bankAccounts.addListener((ListChangeListener) change -> _bankAccounts = new ArrayList<>(bankAccounts)); @@ -178,7 +178,7 @@ public class User implements Serializable { return currentBankAccount; } - // Used for serialisation (ObservableList cannot be serialized) -> serialisation will change anyway so that is + // Used for serialisation (ObservableList cannot be serialized) -> serialisation will change anyway so that is // only temporary List getSerializedBankAccounts() { return _bankAccounts; diff --git a/src/main/java/io/bitsquare/util/ViewLoader.java b/src/main/java/io/bitsquare/util/ViewLoader.java index 2ab892199b..eabc58124f 100644 --- a/src/main/java/io/bitsquare/util/ViewLoader.java +++ b/src/main/java/io/bitsquare/util/ViewLoader.java @@ -55,7 +55,7 @@ public class ViewLoader { this(url, true); } - // TODO check relationship with CachedViewCB -> derive caching strategy, but there are some special cases where + // TODO check relationship with CachedViewCB -> derive caching strategy, but there are some special cases where // we need an override, as caching is done manually in the client class public ViewLoader(URL url, boolean useCaching) { this.url = url; diff --git a/src/test/java/io/bitsquare/msg/BasicUsecasesInWANTest.java b/src/test/java/io/bitsquare/msg/BasicUsecasesInWANTest.java index ca54d106d9..2f26b9139e 100644 --- a/src/test/java/io/bitsquare/msg/BasicUsecasesInWANTest.java +++ b/src/test/java/io/bitsquare/msg/BasicUsecasesInWANTest.java @@ -83,7 +83,7 @@ public class BasicUsecasesInWANTest { private String overrideBootStrapMode = "default"; // nat, relay - // In port forwarding mode the isSuccess returns false, but the DHT operations succeeded. + // In port forwarding mode the isSuccess returns false, but the DHT operations succeeded. // Needs investigation why. private boolean ignoreSuccessTests = true; @@ -288,7 +288,7 @@ public class BasicUsecasesInWANTest { } } - // That test should succeed in port forwarding as we use the server seed node as receiver + // That test should succeed in port forwarding as we use the server seed node as receiver @Test @Ignore public void testSendDirectPortForwarding() throws Exception { diff --git a/src/test/java/net/tomp2p/dht/UtilsDHT2.java b/src/test/java/net/tomp2p/dht/UtilsDHT2.java index 7a9126d38d..81db62cf5e 100644 --- a/src/test/java/net/tomp2p/dht/UtilsDHT2.java +++ b/src/test/java/net/tomp2p/dht/UtilsDHT2.java @@ -1,12 +1,12 @@ /* * Copyright 2012 Thomas Bocek - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -82,7 +82,7 @@ public class UtilsDHT2 { } public static PeerAddress createAddress(Number160 idSender, String inetSender, int tcpPortSender, - int udpPortSender, boolean firewallUDP, + int udpPortSender, boolean firewallUDP, boolean firewallTCP) throws UnknownHostException { InetAddress inetSend = InetAddress.getByName(inetSender); PeerSocketAddress peerSocketAddress = new PeerSocketAddress(inetSend, tcpPortSender, udpPortSender); @@ -92,9 +92,9 @@ public class UtilsDHT2 { } public static Message createDummyMessage(Number160 idSender, String inetSender, int tcpPortSendor, - int udpPortSender, Number160 idRecipien, String inetRecipient, + int udpPortSender, Number160 idRecipien, String inetRecipient, int tcpPortRecipient, - int udpPortRecipient, byte command, Type type, boolean firewallUDP, + int udpPortRecipient, byte command, Type type, boolean firewallUDP, boolean firewallTCP) throws UnknownHostException { Message message = new Message(); From 43cf337fe4ca04eb0e570e38859fce1e50231529 Mon Sep 17 00:00:00 2001 From: Chris Beams Date: Mon, 3 Nov 2014 13:45:34 +0100 Subject: [PATCH 2/2] Support code coverage using JaCoCo and Coveralls The Gradle build now supports generating code coverage reports using JaCoCo. The reports can be run with: ./gradle jacocoTestReport and then view the HTML output at: build/reports/jacoco/test/html/index.html The bitsquare repository has now also been registered with a (free) account at http://coveralls.io. Our Travis CI configuration has been updated to publish JaCoCo XML test report data to coveralls.io, which results in the reports found at: - https://coveralls.io/r/bitsquare/bitsquare For more information on the JaCoCo and Coveralls Gradle plugins, see: - http://www.gradle.org/docs/current/userguide/jacoco_plugin.html - https://github.com/kt3k/coveralls-gradle-plugin --- .travis.yml | 6 ++++++ README.md | 1 + build.gradle | 11 ++++++++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d5419e15fe..e33e129f73 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,3 +18,9 @@ notifications: on_failure: always use_notice: true skip_join: true + +env: + - TERM=dumb + +after_success: + - ./gradlew jacocoTestReport coveralls diff --git a/README.md b/README.md index 36c2ffc7a8..725ecbcc5e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ [![Build Status](https://travis-ci.org/bitsquare/bitsquare.svg?branch=master)](https://travis-ci.org/bitsquare/bitsquare) +[![Coverage Status](https://img.shields.io/coveralls/bitsquare/bitsquare.svg)](https://coveralls.io/r/bitsquare/bitsquare) What is Bitsquare? diff --git a/build.gradle b/build.gradle index f5cfa1d98a..ded7abf36d 100644 --- a/build.gradle +++ b/build.gradle @@ -2,11 +2,15 @@ import org.apache.tools.ant.taskdefs.condition.Os plugins { id "com.github.johnrengelman.shadow" version "1.1.2" + id "com.github.kt3k.coveralls" version "2.0.1x" } apply plugin: 'java' apply plugin: 'eclipse' apply plugin: 'application' +apply plugin: 'jacoco' + +wrapper.gradleVersion = '2.1' version = '0.1.0-SNAPSHOT' sourceCompatibility = 1.8 @@ -60,4 +64,9 @@ task packageNative(type:Exec, dependsOn:shadowJar) { args project.version, shadowJar.archivePath, mainClassName } -wrapper.gradleVersion = '2.1' +jacocoTestReport { + reports { + xml.enabled = true + html.enabled = true + } +}