From fcd99669789afc3c6a7df12b820612ba7e667df6 Mon Sep 17 00:00:00 2001 From: Chris Beams Date: Tue, 26 Aug 2014 16:26:16 +0200 Subject: [PATCH 1/5] Remove code that has been commented out --- .../btc/AddressBasedCoinSelector.java | 20 ------- .../io/bitsquare/btc/BlockChainFacade.java | 8 --- .../java/io/bitsquare/btc/BtcValidator.java | 12 ----- .../java/io/bitsquare/btc/WalletFacade.java | 52 ------------------- .../java/io/bitsquare/gui/MainController.java | 6 --- .../skin/ConfidenceProgressIndicatorSkin.java | 26 ---------- .../processbar/ProcessStepBarSkin.java | 5 -- .../createoffer/CreateOfferController.java | 7 --- .../gui/util/BitSquareFormatter.java | 6 --- .../java/io/bitsquare/locale/CountryUtil.java | 10 ---- .../io/bitsquare/locale/LanguageUtil.java | 17 ------ .../msg/BootstrappedPeerFactory.java | 23 -------- .../java/io/bitsquare/msg/MessageFacade.java | 10 ---- src/main/java/io/bitsquare/msg/P2PNode.java | 26 ---------- .../java/io/bitsquare/settings/Settings.java | 4 -- .../bitsquare/trade/orderbook/OrderBook.java | 29 ----------- .../offerer/VerifyAndSignContract.java | 16 ------ src/main/java/io/bitsquare/util/FileUtil.java | 38 -------------- 18 files changed, 315 deletions(-) diff --git a/src/main/java/io/bitsquare/btc/AddressBasedCoinSelector.java b/src/main/java/io/bitsquare/btc/AddressBasedCoinSelector.java index 110a152250..336b210e87 100644 --- a/src/main/java/io/bitsquare/btc/AddressBasedCoinSelector.java +++ b/src/main/java/io/bitsquare/btc/AddressBasedCoinSelector.java @@ -55,11 +55,6 @@ public class AddressBasedCoinSelector extends DefaultCoinSelector { // Constructor /////////////////////////////////////////////////////////////////////////////////////////// - /*public AddressBasedCoinSelector(NetworkParameters params, AddressInfo addressInfo) - { - this(params, addressInfo, false); - } */ - public AddressBasedCoinSelector(NetworkParameters params, AddressEntry addressEntry, boolean includePending) { this.params = params; this.addressEntry = addressEntry; @@ -172,19 +167,4 @@ public class AddressBasedCoinSelector extends DefaultCoinSelector { return new CoinSelection(Coin.valueOf(total), selected); } - /* - public static boolean isSelectable(Transaction tx) - { - // Only pick chain-included transactions, or transactions that are ours and pending. - TransactionConfidence confidence = tx.getConfidence(); - TransactionConfidence.ConfidenceType type = confidence.getConfidenceType(); - return type.equals(TransactionConfidence.ConfidenceType.BUILDING) || - type.equals(TransactionConfidence.ConfidenceType.PENDING) && - 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 - // counted, set to 0 - (confidence.numBroadcastPeers() > 1 || tx.getParams() == RegTestParams.get()); - } - */ } diff --git a/src/main/java/io/bitsquare/btc/BlockChainFacade.java b/src/main/java/io/bitsquare/btc/BlockChainFacade.java index b7d6cd1849..1a38a295c3 100644 --- a/src/main/java/io/bitsquare/btc/BlockChainFacade.java +++ b/src/main/java/io/bitsquare/btc/BlockChainFacade.java @@ -39,14 +39,6 @@ public class BlockChainFacade { //TODO public boolean verifyAccountRegistration() { return true; - - // tx id 76982adc582657b2eb68f3e43341596a68aadc4ef6b9590e88e93387d4d5d1f9 - // address: mjbxLbuVpU1cNXLJbrJZyirYwweoRPVVTj - /* - if (findAddressInBlockChain(address) && isFeePayed(address)) - return getDataForTxWithAddress(address) != null; - else - return true; */ } private boolean findAddressInBlockChain(String address) { diff --git a/src/main/java/io/bitsquare/btc/BtcValidator.java b/src/main/java/io/bitsquare/btc/BtcValidator.java index 9bb278dca1..a21bf59544 100644 --- a/src/main/java/io/bitsquare/btc/BtcValidator.java +++ b/src/main/java/io/bitsquare/btc/BtcValidator.java @@ -35,16 +35,4 @@ public class BtcValidator { return amount != null && amount.compareTo(FeePolicy.TX_FEE.add(Transaction.MIN_NONDUST_OUTPUT)) > 0; } - /* public boolean isAddressValid(String addressString) - { - try - { - new Address(BtcValidator.params, addressString); - return true; - } catch (AddressFormatException e) - { - return false; - } - } */ - } diff --git a/src/main/java/io/bitsquare/btc/WalletFacade.java b/src/main/java/io/bitsquare/btc/WalletFacade.java index cfe1e376e4..0f98241767 100644 --- a/src/main/java/io/bitsquare/btc/WalletFacade.java +++ b/src/main/java/io/bitsquare/btc/WalletFacade.java @@ -182,8 +182,6 @@ public class WalletFacade { if (params == RegTestParams.get()) { walletAppKit.peerGroup().setMinBroadcastConnections(1); } - /* else - walletAppKit.peerGroup().setMinBroadcastConnections(2); */ walletEventListener = new WalletEventListener() { @Override @@ -348,12 +346,6 @@ public class WalletFacade { if (transactions != null) { transactionConfidenceList.addAll(transactions.stream().map(tx -> getTransactionConfidence(tx, address)).collect(Collectors.toList())); - /* same as: - for (Transaction tx : transactions) - { - transactionConfidenceList.add(getTransactionConfidence(tx, address)); - } - */ } return getMostRecentConfidence(transactionConfidenceList); } @@ -380,21 +372,6 @@ public class WalletFacade { transactionConfidenceList.add(tx.getConfidence()); } }); - /* - same as: - for (TransactionOutput transactionOutput : mergedOutputs) - { - if (transactionOutput.getScriptPubKey().isSentToAddress() || - transactionOutput.getScriptPubKey().isSentToP2SH()) - { - Address outputAddress = transactionOutput.getScriptPubKey().getToAddress(params); - if (address.equals(outputAddress)) - { - transactionConfidenceList.add(tx.getConfidence()); - } - } - } - */ return getMostRecentConfidence(transactionConfidenceList); } @@ -502,20 +479,6 @@ public class WalletFacade { return getRegistrationBalance().compareTo(FeePolicy.ACCOUNT_REGISTRATION_FEE) >= 0; } - /* public boolean isUnusedTradeAddressBalanceAboveCreationFee() - { - AddressEntry unUsedAddressEntry = getUnusedTradeAddressInfo(); - Coin unUsedAddressInfoBalance = getBalanceForAddress(unUsedAddressEntry.getAddress()); - return unUsedAddressInfoBalance.compareTo(FeePolicy.CREATE_OFFER_FEE) > 0; - } - - public boolean isUnusedTradeAddressBalanceAboveTakeOfferFee() - { - AddressEntry unUsedAddressEntry = getUnusedTradeAddressInfo(); - Coin unUsedAddressInfoBalance = getBalanceForAddress(unUsedAddressEntry.getAddress()); - return unUsedAddressInfoBalance.compareTo(FeePolicy.TAKE_OFFER_FEE) > 0; - }*/ - //TODO public int getNumOfPeersSeenTx(String txID) { // TODO check from blockchain @@ -553,21 +516,7 @@ public class WalletFacade { sendRequest.coinSelector = new AddressBasedCoinSelector(params, getRegistrationAddressEntry(), false); sendRequest.changeAddress = getRegistrationAddressEntry().getAddress(); Wallet.SendResult sendResult = wallet.sendCoins(sendRequest); - //Object k = getRegistrationAddressInfo().getKey(); Futures.addCallback(sendResult.broadcastComplete, callback); - /*Futures.addCallback(sendResult.broadcastComplete, new FutureCallback(){ - @Override - public void onSuccess(@Nullable Transaction result) - { - Object k = getRegistrationAddressInfo().getKey(); - } - - @Override - public void onFailure(Throwable t) - { - - } - }); */ log.debug("Registration transaction: " + tx); printInputs("payRegistrationFee", tx); @@ -579,7 +528,6 @@ public class WalletFacade { Coin fee = FeePolicy.CREATE_OFFER_FEE.subtract(FeePolicy.TX_FEE); log.trace("fee: " + fee.toFriendlyString()); tx.addOutput(fee, feePolicy.getAddressForCreateOfferFee()); - // printInputs("payCreateOfferFee", tx); Wallet.SendRequest sendRequest = Wallet.SendRequest.forTx(tx); sendRequest.shuffleOutputs = false; // we allow spending of unconfirmed tx (double spend risk is low and usability would suffer if we need to diff --git a/src/main/java/io/bitsquare/gui/MainController.java b/src/main/java/io/bitsquare/gui/MainController.java index 03bdb4106d..7bff98c19d 100644 --- a/src/main/java/io/bitsquare/gui/MainController.java +++ b/src/main/java/io/bitsquare/gui/MainController.java @@ -310,12 +310,6 @@ public class MainController extends ViewController { /////////////////////////////////////////////////////////////////////////////////////////// private void loadViewFromNavButton(NavigationItem navigationItem) { - - /* if (childController instanceof CachedViewController) - ((CachedViewController) childController).deactivate(); - else if (childController != null) - childController.terminate();*/ - final GuiceFXMLLoader loader = new GuiceFXMLLoader(getClass().getResource(navigationItem.getFxmlUrl())); try { final Node view = loader.load(); diff --git a/src/main/java/io/bitsquare/gui/components/confidence/skin/ConfidenceProgressIndicatorSkin.java b/src/main/java/io/bitsquare/gui/components/confidence/skin/ConfidenceProgressIndicatorSkin.java index ebfd4c9a0f..755ee50c11 100644 --- a/src/main/java/io/bitsquare/gui/components/confidence/skin/ConfidenceProgressIndicatorSkin.java +++ b/src/main/java/io/bitsquare/gui/components/confidence/skin/ConfidenceProgressIndicatorSkin.java @@ -93,17 +93,6 @@ public class ConfidenceProgressIndicatorSkin extends BehaviorSkinBase= 1) ? (DONE) : ("" + intProgress + "%")); - text.setTextOrigin(VPos.TOP); - text.getStyleClass().setAll("text", "percentage"); */ - // The circular background for the progress pie piece indicator = new StackPane(); indicator.setScaleShape(false); @@ -519,17 +504,6 @@ public class ConfidenceProgressIndicatorSkin extends BehaviorSkinBase= 1); - - // if the % text can't fit anywhere in the bounds then don't display it - /* double textWidth = text.getLayoutBounds().getWidth(); - double textHeight = text.getLayoutBounds().getHeight(); - if (control.getWidth() >= textWidth && control.getHeight() >= textHeight) { - if (!text.isVisible()) text.setVisible(true); - text.setLayoutY(snapPosition(centerY + radius + textGap)); - text.setLayoutX(snapPosition(centerX - (textWidth/2))); - } else { - if (text.isVisible()) text.setVisible(false); - } */ } @Override diff --git a/src/main/java/io/bitsquare/gui/components/processbar/ProcessStepBarSkin.java b/src/main/java/io/bitsquare/gui/components/processbar/ProcessStepBarSkin.java index 865038dcad..b7d88ad194 100644 --- a/src/main/java/io/bitsquare/gui/components/processbar/ProcessStepBarSkin.java +++ b/src/main/java/io/bitsquare/gui/components/processbar/ProcessStepBarSkin.java @@ -143,13 +143,8 @@ class ProcessStepBarSkin extends BehaviorSkinBase, Behavior } public void deSelect() { - /*BorderStroke borderStroke = new BorderStroke(Color.GRAY, BorderStrokeStyle.SOLID, null, - new BorderWidths(borderWidth, borderWidth, borderWidth, borderWidth), Insets.EMPTY); - this.setBorder(new Border(borderStroke)); - setTextFill(Color.GRAY); */ } - public double getArrowWidth() { return arrowWidth; } diff --git a/src/main/java/io/bitsquare/gui/trade/createoffer/CreateOfferController.java b/src/main/java/io/bitsquare/gui/trade/createoffer/CreateOfferController.java index 6877296152..e2e7f67a92 100644 --- a/src/main/java/io/bitsquare/gui/trade/createoffer/CreateOfferController.java +++ b/src/main/java/io/bitsquare/gui/trade/createoffer/CreateOfferController.java @@ -275,13 +275,6 @@ public class CreateOfferController extends CachedViewController { placeOfferButton.visibleProperty().bind(viewModel.isOfferPlacedScreen.not()); closeButton.visibleProperty().bind(viewModel.isOfferPlacedScreen); - //TODO - /* progressIndicator.visibleProperty().bind(viewModel.isOfferPlacedScreen); - confirmationLabel.visibleProperty().bind(viewModel.isOfferPlacedScreen); - txTitleLabel.visibleProperty().bind(viewModel.isOfferPlacedScreen); - transactionIdTextField.visibleProperty().bind(viewModel.isOfferPlacedScreen); - */ - placeOfferButton.disableProperty().bind(amountTextField.isValidProperty() .and(minAmountTextField.isValidProperty()) .and(volumeTextField.isValidProperty()) diff --git a/src/main/java/io/bitsquare/gui/util/BitSquareFormatter.java b/src/main/java/io/bitsquare/gui/util/BitSquareFormatter.java index 43eeab18d2..fbe5484458 100644 --- a/src/main/java/io/bitsquare/gui/util/BitSquareFormatter.java +++ b/src/main/java/io/bitsquare/gui/util/BitSquareFormatter.java @@ -48,12 +48,6 @@ public class BitSquareFormatter { return coin != null ? coin.toPlainString() : ""; } - - /* public static String formatCoinToWithSymbol(Coin coin) - { - return "฿ " + coin.toPlainString(); - } */ - public static String formatCoinWithCode(Coin coin) { return coin != null ? coin.toFriendlyString() : ""; } diff --git a/src/main/java/io/bitsquare/locale/CountryUtil.java b/src/main/java/io/bitsquare/locale/CountryUtil.java index 63b9278c26..25f6c2af2e 100644 --- a/src/main/java/io/bitsquare/locale/CountryUtil.java +++ b/src/main/java/io/bitsquare/locale/CountryUtil.java @@ -120,16 +120,6 @@ public class CountryUtil { Set allLocalesAsSet = allLocales.stream().filter(locale -> !"".equals(locale.getCountry())).map(locale -> new Locale("", locale.getCountry(), "")).collect(Collectors.toSet()); - /* - same as: - Set allLocalesAsSet = new HashSet<>(); - for (Locale locale : allLocales) - { - if (!locale.getCountry().equals("")) - { - allLocalesAsSet.add(new Locale("", locale.getCountry(), "")); - } - } */ allLocales = new ArrayList<>(); allLocales.addAll(allLocalesAsSet); diff --git a/src/main/java/io/bitsquare/locale/LanguageUtil.java b/src/main/java/io/bitsquare/locale/LanguageUtil.java index 2290347598..5a0d7d7674 100644 --- a/src/main/java/io/bitsquare/locale/LanguageUtil.java +++ b/src/main/java/io/bitsquare/locale/LanguageUtil.java @@ -26,23 +26,6 @@ import java.util.stream.Collectors; public class LanguageUtil { - /*public static List getPopularLanguages() - { - List list = new ArrayList<>(); - list.add(new Locale("de", "AT")); - list.add(new Locale("de", "DE")); - list.add(new Locale("en", "US")); - list.add(new Locale("en", "UK")); - list.add(new Locale("es", "ES")); - list.add(new Locale("ru", "RU")); - list.add(new Locale("zh", "CN")); - list.add(new Locale("en", "AU")); - list.add(new Locale("it", "IT")); - list.add(new Locale("en", "CA")); - return list; - } */ - - public static List getAllLanguageLocales() { List allLocales = Arrays.asList(Locale.getAvailableLocales()); final Set allLocalesAsSet = diff --git a/src/main/java/io/bitsquare/msg/BootstrappedPeerFactory.java b/src/main/java/io/bitsquare/msg/BootstrappedPeerFactory.java index c88bc64585..bf18316d7b 100644 --- a/src/main/java/io/bitsquare/msg/BootstrappedPeerFactory.java +++ b/src/main/java/io/bitsquare/msg/BootstrappedPeerFactory.java @@ -117,16 +117,6 @@ public class BootstrappedPeerFactory { @Override public void peerInserted(PeerAddress peerAddress, boolean verified) { log.debug("Peer inserted: peerAddress=" + peerAddress + ", verified=" + verified); - - /* NavigableSet closePeers = peer.peerBean().peerMap().closePeers(2); - log.debug("closePeers size = " + closePeers.size()); - log.debug("closePeers = " + closePeers); - closePeers.forEach(e -> log.debug("forEach: " + e.toString())); - - List allPeers = peer.peerBean().peerMap().all(); - log.debug("allPeers size = " + allPeers.size()); - log.debug("allPeers = " + allPeers); - allPeers.forEach(e -> log.debug("forEach: " + e.toString()));*/ } @Override @@ -136,7 +126,6 @@ public class BootstrappedPeerFactory { @Override public void peerUpdated(PeerAddress peerAddress, PeerStatatistic peerStatistics) { - // log.debug("Peer updated: peerAddress=" + peerAddress + ", peerStatistics=" + peerStatistics); } }); @@ -358,17 +347,5 @@ public class BootstrappedPeerFactory { // The seed node should only be used if no other known peers are available private void requestBootstrapPeerMap() { log.debug("getBootstrapPeerMap"); - - /* NavigableSet closePeers = peer.peerBean().peerMap().closePeers(2); - log.debug("closePeers size = " + closePeers.size()); - log.debug("closePeers = " + closePeers); - closePeers.forEach(e -> log.debug("forEach: " + e.toString())); - - List allPeers = peer.peerBean().peerMap().all(); - log.debug("allPeers size = " + allPeers.size()); - log.debug("allPeers = " + allPeers); - allPeers.forEach(e -> log.debug("forEach: " + e.toString())); */ } - - } diff --git a/src/main/java/io/bitsquare/msg/MessageFacade.java b/src/main/java/io/bitsquare/msg/MessageFacade.java index 7cb0448fa1..28e23a5653 100644 --- a/src/main/java/io/bitsquare/msg/MessageFacade.java +++ b/src/main/java/io/bitsquare/msg/MessageFacade.java @@ -377,16 +377,6 @@ public class MessageFacade implements MessageBroker { orderBookListeners.remove(listener); } - /* public void addPingPeerListener(PingPeerListener listener) - { - pingPeerListeners.add(listener); - } - - public void removePingPeerListener(PingPeerListener listener) - { - pingPeerListeners.remove(listener); - } */ - public void addArbitratorListener(ArbitratorListener listener) { arbitratorListeners.add(listener); } diff --git a/src/main/java/io/bitsquare/msg/P2PNode.java b/src/main/java/io/bitsquare/msg/P2PNode.java index 3610ddef81..35bb47f3d0 100644 --- a/src/main/java/io/bitsquare/msg/P2PNode.java +++ b/src/main/java/io/bitsquare/msg/P2PNode.java @@ -73,32 +73,6 @@ public class P2PNode { private Thread bootstrapToLocalhostThread; private Thread bootstrapToServerThread; - // just for lightweight client test - /* public static void main(String[] args) - { - P2PNode p2pNode = new P2PNode(DSAKeyUtil.generateKeyPair(), false, SeedNodeAddress.StaticSeedNodeAddresses - .DIGITAL_OCEAN, - (message, peerAddress) -> log.debug("handleMessage: message= " + message + "/ - peerAddress=" + peerAddress)); - p2pNode.start(new FutureCallback() - { - @Override - public void onSuccess(@Nullable PeerDHT result) - { - log.debug("p2pNode.start success result = " + result); - } - - @Override - public void onFailure(Throwable t) - { - log.error(t.toString()); - } - }); - for (; ; ) - { - } - }*/ - private KeyPair keyPair; private final Boolean useDiskStorage; private final SeedNodeAddress.StaticSeedNodeAddresses defaultStaticSeedNodeAddresses; diff --git a/src/main/java/io/bitsquare/settings/Settings.java b/src/main/java/io/bitsquare/settings/Settings.java index 1ea57acb0d..49dde1bda4 100644 --- a/src/main/java/io/bitsquare/settings/Settings.java +++ b/src/main/java/io/bitsquare/settings/Settings.java @@ -114,11 +114,7 @@ public class Settings implements Serializable { List candidates = new ArrayList<>(); //noinspection Convert2streamapi for (Arbitrator arbitrator : acceptedArbitrators) { - /*if (arbitrator.getArbitrationFeePercent() >= collateral && - arbitrator.getMinArbitrationAmount().compareTo(amount) < 0) - { */ candidates.add(arbitrator); - // } } return !candidates.isEmpty() ? candidates.get((int) (Math.random() * candidates.size())) : null; } diff --git a/src/main/java/io/bitsquare/trade/orderbook/OrderBook.java b/src/main/java/io/bitsquare/trade/orderbook/OrderBook.java index f52d928dff..d4eec345cf 100644 --- a/src/main/java/io/bitsquare/trade/orderbook/OrderBook.java +++ b/src/main/java/io/bitsquare/trade/orderbook/OrderBook.java @@ -153,35 +153,6 @@ public class OrderBook implements OrderBookListener { boolean result = currencyResult && countryResult && languageResult && amountResult && directionResult && priceResult && arbitratorResult; - /* - log.debug("result = " + result + - ", currencyResult = " + currencyResult + - ", countryResult = " + countryResult + - ", languageResult = " + languageResult + - ", amountResult = " + amountResult + - ", directionResult = " + directionResult + - ", priceResult = " + priceResult + - ", arbitratorResult = " + arbitratorResult - );*/ - /* - log.debug("currentBankAccount.getCurrency() = " + currentBankAccount.getCurrency() + - ", offer.getCurrency() = " + offer.getCurrency()); - log.debug("offer.getCountryLocale() = " + offer.getBankAccountCountryLocale() + - ", settings.getAcceptedCountries() = " + settings.getAcceptedCountries().toString()); - log.debug("settings.getAcceptedLanguageLocales() = " + settings.getAcceptedLanguageLocales() + - ", offer.getAcceptedLanguageLocales() = " + offer.getAcceptedLanguageLocales()); - log.debug("currentBankAccount.getBankAccountType().getType() = " + currentBankAccount.getBankAccountType - ().getType() + - ", offer.getBankAccountTypeEnum() = " + offer.getBankAccountTypeEnum()); - log.debug("orderBookFilter.getAmount() = " + orderBookFilter.getAmount() + - ", offer.getAmount() = " + offer.getAmount()); - log.debug("orderBookFilter.getDirection() = " + orderBookFilter.getDirection() + - ", offer.getDirection() = " + offer.getDirection()); - log.debug("orderBookFilter.getPrice() = " + orderBookFilter.getPrice() + - ", offer.getPrice() = " + offer.getPrice()); - log.debug("offer.getArbitrator() = " + offer.getArbitrator() + - ", settings.getAcceptedArbitrators() = " + settings.getAcceptedArbitrators()); - */ return result; }); } diff --git a/src/main/java/io/bitsquare/trade/protocol/offerer/VerifyAndSignContract.java b/src/main/java/io/bitsquare/trade/protocol/offerer/VerifyAndSignContract.java index f486540bf2..7ce7d09f80 100644 --- a/src/main/java/io/bitsquare/trade/protocol/offerer/VerifyAndSignContract.java +++ b/src/main/java/io/bitsquare/trade/protocol/offerer/VerifyAndSignContract.java @@ -54,27 +54,11 @@ public class VerifyAndSignContract { bankAccount, peersBankAccount, messagePublicKey, takerMessagePublicKey); String contractAsJson = Utilities.objectToJson(contract); - // log.trace("Offerer contract created: " + contract); - // log.trace("Offerers contractAsJson: " + contractAsJson); - // log.trace("Takers contractAsJson: " + sharedModel.peersContractAsJson); - //TODO PublicKey cause problems, need to be changed to hex - /*if (contractAsJson.equals(peersContractAsJson)) - {*/ log.trace("The 2 contracts as json does match"); String signature = cryptoFacade.signContract(registrationKey, contractAsJson); //log.trace("signature: " + signature); resultHandler.onResult(contract, contractAsJson, signature); - /* } - else - { - // TODO use diff output as feedback ? - log.error("Contracts are not matching."); - log.error("Offerers contractAsJson: " + contractAsJson); - log.error("Takers contractAsJson: " + peersContractAsJson); - - faultHandler.onFault(new Exception("Contracts are not matching")); - }*/ } public interface ResultHandler { diff --git a/src/main/java/io/bitsquare/util/FileUtil.java b/src/main/java/io/bitsquare/util/FileUtil.java index e50d03b44e..ac3cd6314a 100644 --- a/src/main/java/io/bitsquare/util/FileUtil.java +++ b/src/main/java/io/bitsquare/util/FileUtil.java @@ -36,44 +36,6 @@ public class FileUtil { return File.createTempFile("temp_" + prefix, null, StorageDirectory.getStorageDirectory()); } - /* - public static String getApplicationFileName() - { - File executionRoot = new File(StorageDirectory.class.getProtectionDomain().getCodeSource().getLocation() - .getFile()); - try - { - log.trace("getApplicationFileName " + executionRoot.getCanonicalPath()); - } catch (IOException e) - { - e.printStackTrace(); - } - // check if it is packed into a mac app (e.g.: "/Users/mk/Desktop/bitsquare.app/Contents/Java/bitsquare.jar") - try - { - if (executionRoot.getCanonicalPath().endsWith(".app/Contents/Java/bitsquare.jar") && System.getProperty - ("os.name").startsWith("Mac")) - { - File appFile = executionRoot.getParentFile().getParentFile().getParentFile(); - try - { - int lastSlash = appFile.getCanonicalPath().lastIndexOf("/") + 1; - return appFile.getCanonicalPath().substring(lastSlash).replace(".app", ""); - } catch (IOException e) - { - e.printStackTrace(); - } - } - } catch (IOException e) - { - e.printStackTrace(); - } - - // fallback use AppName - return BitSquare.getAppName(); - } -*/ - public static void writeTempFileToFile(File tempFile, File file) throws IOException { if (Utils.isWindows()) { // Work around an issue on Windows whereby you can't rename over existing files. From 3fcc56f849f58899dea73d60aff74a55fafff8a6 Mon Sep 17 00:00:00 2001 From: Chris Beams Date: Tue, 26 Aug 2014 16:28:58 +0200 Subject: [PATCH 2/5] Collapse TODO comments onto single line --- .../java/io/bitsquare/btc/BlockChainFacade.java | 15 +++++---------- .../gui/settings/SettingsController.java | 3 +-- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/main/java/io/bitsquare/btc/BlockChainFacade.java b/src/main/java/io/bitsquare/btc/BlockChainFacade.java index 1a38a295c3..a288e513f1 100644 --- a/src/main/java/io/bitsquare/btc/BlockChainFacade.java +++ b/src/main/java/io/bitsquare/btc/BlockChainFacade.java @@ -42,33 +42,28 @@ public class BlockChainFacade { } private boolean findAddressInBlockChain(String address) { - // TODO - // lookup for address in blockchain + // TODO lookup for address in blockchain return true; } private byte[] getDataForTxWithAddress(String address) { - // TODO - // return data after OP_RETURN + // TODO return data after OP_RETURN return null; } private boolean isFeePayed(String address) { - // TODO - // check if fee is payed + // TODO check if fee is paid return true; } private boolean isAccountIDBlacklisted(String accountID) { - // TODO - // check if accountID is on blacklist + // TODO check if accountID is on blacklist return false; } private boolean isBankAccountBlacklisted(BankAccount bankAccount) { - // TODO - // check if accountID is on blacklist + // TODO check if accountID is on blacklist return false; } } diff --git a/src/main/java/io/bitsquare/gui/settings/SettingsController.java b/src/main/java/io/bitsquare/gui/settings/SettingsController.java index 8d3df331b7..54cefd651d 100644 --- a/src/main/java/io/bitsquare/gui/settings/SettingsController.java +++ b/src/main/java/io/bitsquare/gui/settings/SettingsController.java @@ -162,8 +162,7 @@ public class SettingsController extends CachedViewController { @Override public ViewController loadViewAndGetChildController(NavigationItem navigationItem) { - // TODO - // caching causes exception + // TODO caching causes exception final GuiceFXMLLoader loader = new GuiceFXMLLoader(getClass().getResource(navigationItem.getFxmlUrl()), false); try { final Node view = loader.load(); From 75299b4311245142592ccb441f30c54694e7228e Mon Sep 17 00:00:00 2001 From: Chris Beams Date: Tue, 26 Aug 2014 16:29:35 +0200 Subject: [PATCH 3/5] Remove Bitsquare GPL copyright from Oracle sources Certain sources are already copyrighted by Oracle. This commit partially reverts be3beb5 by deleting the copyright headers that were added there. All Oracle copyright headers remain intact. --- .../ConfidenceProgressIndicator.java | 17 ---------------- .../ConfidenceProgressIndicatorBehavior.java | 20 ++----------------- .../skin/ConfidenceProgressIndicatorSkin.java | 17 ---------------- 3 files changed, 2 insertions(+), 52 deletions(-) diff --git a/src/main/java/io/bitsquare/gui/components/confidence/ConfidenceProgressIndicator.java b/src/main/java/io/bitsquare/gui/components/confidence/ConfidenceProgressIndicator.java index adac2e0ef9..2ee2c3d916 100644 --- a/src/main/java/io/bitsquare/gui/components/confidence/ConfidenceProgressIndicator.java +++ b/src/main/java/io/bitsquare/gui/components/confidence/ConfidenceProgressIndicator.java @@ -1,20 +1,3 @@ -/* - * This file is part of Bitsquare. - * - * Bitsquare is free software: you can redistribute it and/or modify it - * under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or (at - * your option) any later version. - * - * Bitsquare is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public - * License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with Bitsquare. If not, see . - */ - /* * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. diff --git a/src/main/java/io/bitsquare/gui/components/confidence/behavior/ConfidenceProgressIndicatorBehavior.java b/src/main/java/io/bitsquare/gui/components/confidence/behavior/ConfidenceProgressIndicatorBehavior.java index 2b28b15086..d3c159331b 100644 --- a/src/main/java/io/bitsquare/gui/components/confidence/behavior/ConfidenceProgressIndicatorBehavior.java +++ b/src/main/java/io/bitsquare/gui/components/confidence/behavior/ConfidenceProgressIndicatorBehavior.java @@ -1,21 +1,3 @@ -/* - * This file is part of Bitsquare. - * - * Bitsquare is free software: you can redistribute it and/or modify it - * under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or (at - * your option) any later version. - * - * Bitsquare is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public - * License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with Bitsquare. If not, see . - */ - -package io.bitsquare.gui.components.confidence.behavior; /* * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -41,6 +23,8 @@ package io.bitsquare.gui.components.confidence.behavior; * questions. */ +package io.bitsquare.gui.components.confidence.behavior; + import io.bitsquare.gui.components.confidence.ConfidenceProgressIndicator; import java.util.Collections; diff --git a/src/main/java/io/bitsquare/gui/components/confidence/skin/ConfidenceProgressIndicatorSkin.java b/src/main/java/io/bitsquare/gui/components/confidence/skin/ConfidenceProgressIndicatorSkin.java index 755ee50c11..1bd5d85c71 100644 --- a/src/main/java/io/bitsquare/gui/components/confidence/skin/ConfidenceProgressIndicatorSkin.java +++ b/src/main/java/io/bitsquare/gui/components/confidence/skin/ConfidenceProgressIndicatorSkin.java @@ -1,20 +1,3 @@ -/* - * This file is part of Bitsquare. - * - * Bitsquare is free software: you can redistribute it and/or modify it - * under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or (at - * your option) any later version. - * - * Bitsquare is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public - * License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with Bitsquare. If not, see . - */ - /* * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. From e4be536b638fae9dc69c6c9d98d1b18b05f00641 Mon Sep 17 00:00:00 2001 From: Chris Beams Date: Tue, 26 Aug 2014 16:31:21 +0200 Subject: [PATCH 4/5] Polish Javadoc --- src/main/java/io/bitsquare/btc/BlockChainFacade.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/bitsquare/btc/BlockChainFacade.java b/src/main/java/io/bitsquare/btc/BlockChainFacade.java index a288e513f1..7071db2916 100644 --- a/src/main/java/io/bitsquare/btc/BlockChainFacade.java +++ b/src/main/java/io/bitsquare/btc/BlockChainFacade.java @@ -22,7 +22,7 @@ import io.bitsquare.bank.BankAccount; import javax.inject.Inject; /** - * That facade delivers blockchain functionality from the bitcoinJ library + * A facade delivers blockchain functionality from the BitcoinJ library. */ @SuppressWarnings({"SameReturnValue", "UnusedParameters"}) public class BlockChainFacade { From bf6652c3406f42084b374d699374f5043af8d2d1 Mon Sep 17 00:00:00 2001 From: Chris Beams Date: Tue, 26 Aug 2014 16:31:35 +0200 Subject: [PATCH 5/5] Add trailing newline --- src/main/java/io/bitsquare/btc/WalletFacade.java | 2 +- .../bitsquare/gui/trade/createoffer/CreateOfferController.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/bitsquare/btc/WalletFacade.java b/src/main/java/io/bitsquare/btc/WalletFacade.java index 0f98241767..25c577a4bf 100644 --- a/src/main/java/io/bitsquare/btc/WalletFacade.java +++ b/src/main/java/io/bitsquare/btc/WalletFacade.java @@ -1131,4 +1131,4 @@ public class WalletFacade { } } -} \ No newline at end of file +} diff --git a/src/main/java/io/bitsquare/gui/trade/createoffer/CreateOfferController.java b/src/main/java/io/bitsquare/gui/trade/createoffer/CreateOfferController.java index e2e7f67a92..ed88a180e4 100644 --- a/src/main/java/io/bitsquare/gui/trade/createoffer/CreateOfferController.java +++ b/src/main/java/io/bitsquare/gui/trade/createoffer/CreateOfferController.java @@ -342,4 +342,4 @@ class ViewModel { final StringProperty transactionId = new SimpleStringProperty(); final BooleanProperty isOfferPlacedScreen = new SimpleBooleanProperty(); final BooleanProperty isPlaceOfferButtonDisabled = new SimpleBooleanProperty(false); -} \ No newline at end of file +}