From 10c88600fcca3d97d8065082e374de1dfd1d946a Mon Sep 17 00:00:00 2001 From: Chris Beams Date: Wed, 14 Mar 2018 21:02:11 +0100 Subject: [PATCH] Organize imports with common layout (bisq-network/style#2) --- .idea/codeStyles/Project.xml | 76 +++++++++++++++++-- .../alert/PrivateNotificationManager.java | 4 +- .../java/bisq/core/app/BisqEnvironment.java | 4 +- .../core/arbitration/ArbitratorManager.java | 4 +- .../bisq/core/btc/ProxySocketFactory.java | 4 +- .../btc/wallet/BisqDefaultCoinSelector.java | 4 +- ...BtcCompensationRequestFeeCoinSelector.java | 4 +- .../bisq/core/btc/wallet/WalletConfig.java | 10 +-- .../bisq/core/btc/wallet/WalletsSetup.java | 6 +- .../core/dao/node/full/rpc/RpcService.java | 4 +- .../compensation/CompensationRequest.java | 4 +- .../CompensationRequestPayload.java | 4 +- .../generic/GenericProposalPayload.java | 4 +- .../java/bisq/core/filter/FilterManager.java | 4 +- src/main/java/bisq/core/locale/Res.java | 8 +- .../params/btc/AbstractBitcoinNetParams.java | 4 +- .../bisq/core/provider/fee/FeeService.java | 4 +- .../core/provider/price/PriceFeedService.java | 4 +- .../trade/statistics/TradeStatistics.java | 4 +- .../trade/statistics/TradeStatistics2.java | 4 +- .../dao/node/full/FullNodeParserTest.java | 4 +- 21 files changed, 114 insertions(+), 54 deletions(-) diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index 55d422fe..d99d2a86 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -15,6 +15,14 @@ + + + + + + + + @@ -27,7 +35,7 @@ - + @@ -35,14 +43,26 @@ + + + + + + + + - + + + + + @@ -53,34 +73,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - - + - + + + @@ -93,6 +151,8 @@ + + diff --git a/src/main/java/bisq/core/alert/PrivateNotificationManager.java b/src/main/java/bisq/core/alert/PrivateNotificationManager.java index 04772a4e..7c424358 100644 --- a/src/main/java/bisq/core/alert/PrivateNotificationManager.java +++ b/src/main/java/bisq/core/alert/PrivateNotificationManager.java @@ -41,10 +41,10 @@ import java.security.SignatureException; -import java.util.UUID; - import java.math.BigInteger; +import java.util.UUID; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/bisq/core/app/BisqEnvironment.java b/src/main/java/bisq/core/app/BisqEnvironment.java index a7401e9a..85ca8f99 100644 --- a/src/main/java/bisq/core/app/BisqEnvironment.java +++ b/src/main/java/bisq/core/app/BisqEnvironment.java @@ -32,6 +32,8 @@ import bisq.common.storage.Storage; import bisq.common.util.Utilities; +import org.bitcoinj.core.NetworkParameters; + import org.springframework.core.env.JOptCommandLinePropertySource; import org.springframework.core.env.MutablePropertySources; import org.springframework.core.env.PropertiesPropertySource; @@ -42,8 +44,6 @@ import org.springframework.core.io.ResourceLoader; import org.springframework.core.io.support.ResourcePropertySource; -import org.bitcoinj.core.NetworkParameters; - import joptsimple.OptionSet; import org.apache.commons.lang3.StringUtils; diff --git a/src/main/java/bisq/core/arbitration/ArbitratorManager.java b/src/main/java/bisq/core/arbitration/ArbitratorManager.java index d51c4314..a4ffd4f6 100644 --- a/src/main/java/bisq/core/arbitration/ArbitratorManager.java +++ b/src/main/java/bisq/core/arbitration/ArbitratorManager.java @@ -48,6 +48,8 @@ import java.security.PublicKey; import java.security.SignatureException; +import java.math.BigInteger; + import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -57,8 +59,6 @@ import java.util.function.Function; import java.util.stream.Collectors; -import java.math.BigInteger; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/bisq/core/btc/ProxySocketFactory.java b/src/main/java/bisq/core/btc/ProxySocketFactory.java index 32eb6f2e..4b3eea87 100644 --- a/src/main/java/bisq/core/btc/ProxySocketFactory.java +++ b/src/main/java/bisq/core/btc/ProxySocketFactory.java @@ -35,8 +35,6 @@ package bisq.core.btc; -import java.io.IOException; - import javax.net.SocketFactory; import java.net.InetAddress; @@ -44,6 +42,8 @@ import java.net.Proxy; import java.net.Socket; +import java.io.IOException; + /** * A basic SocketFactory for creating sockets that connect through the specified * proxy. diff --git a/src/main/java/bisq/core/btc/wallet/BisqDefaultCoinSelector.java b/src/main/java/bisq/core/btc/wallet/BisqDefaultCoinSelector.java index 500eaa62..505d3ee7 100644 --- a/src/main/java/bisq/core/btc/wallet/BisqDefaultCoinSelector.java +++ b/src/main/java/bisq/core/btc/wallet/BisqDefaultCoinSelector.java @@ -28,13 +28,13 @@ import org.bitcoinj.wallet.CoinSelection; import org.bitcoinj.wallet.CoinSelector; +import java.math.BigInteger; + import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Set; -import java.math.BigInteger; - import lombok.extern.slf4j.Slf4j; /** diff --git a/src/main/java/bisq/core/btc/wallet/BtcCompensationRequestFeeCoinSelector.java b/src/main/java/bisq/core/btc/wallet/BtcCompensationRequestFeeCoinSelector.java index 2446aaa9..e33c1d54 100644 --- a/src/main/java/bisq/core/btc/wallet/BtcCompensationRequestFeeCoinSelector.java +++ b/src/main/java/bisq/core/btc/wallet/BtcCompensationRequestFeeCoinSelector.java @@ -32,12 +32,12 @@ import com.google.common.annotations.VisibleForTesting; +import java.math.BigInteger; + import java.util.ArrayList; import java.util.Collections; import java.util.List; -import java.math.BigInteger; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/bisq/core/btc/wallet/WalletConfig.java b/src/main/java/bisq/core/btc/wallet/WalletConfig.java index 6b7f977b..c6cb847d 100644 --- a/src/main/java/bisq/core/btc/wallet/WalletConfig.java +++ b/src/main/java/bisq/core/btc/wallet/WalletConfig.java @@ -55,6 +55,11 @@ import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.Proxy; +import java.net.UnknownHostException; + import java.nio.channels.FileLock; import java.io.File; @@ -63,11 +68,6 @@ import java.io.InputStream; import java.io.RandomAccessFile; -import java.net.InetAddress; -import java.net.InetSocketAddress; -import java.net.Proxy; -import java.net.UnknownHostException; - import java.util.List; import java.util.concurrent.TimeUnit; diff --git a/src/main/java/bisq/core/btc/wallet/WalletsSetup.java b/src/main/java/bisq/core/btc/wallet/WalletsSetup.java index 11ae20af..66bbfb22 100644 --- a/src/main/java/bisq/core/btc/wallet/WalletsSetup.java +++ b/src/main/java/bisq/core/btc/wallet/WalletsSetup.java @@ -72,14 +72,14 @@ import javafx.beans.property.SimpleIntegerProperty; import javafx.beans.property.SimpleObjectProperty; +import java.net.InetAddress; +import java.net.UnknownHostException; + import java.nio.file.Paths; import java.io.File; import java.io.IOException; -import java.net.InetAddress; -import java.net.UnknownHostException; - import java.util.ArrayList; import java.util.Date; import java.util.List; diff --git a/src/main/java/bisq/core/dao/node/full/rpc/RpcService.java b/src/main/java/bisq/core/dao/node/full/rpc/RpcService.java index 15679b16..1aedf403 100644 --- a/src/main/java/bisq/core/dao/node/full/rpc/RpcService.java +++ b/src/main/java/bisq/core/dao/node/full/rpc/RpcService.java @@ -49,14 +49,14 @@ import com.google.common.collect.ImmutableList; +import java.math.BigDecimal; + import java.util.List; import java.util.Map; import java.util.Properties; import java.util.function.Consumer; import java.util.stream.Collectors; -import java.math.BigDecimal; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/bisq/core/dao/proposal/compensation/CompensationRequest.java b/src/main/java/bisq/core/dao/proposal/compensation/CompensationRequest.java index 768ab82a..a95e3599 100644 --- a/src/main/java/bisq/core/dao/proposal/compensation/CompensationRequest.java +++ b/src/main/java/bisq/core/dao/proposal/compensation/CompensationRequest.java @@ -25,11 +25,11 @@ import io.bisq.generated.protobuffer.PB; -import org.springframework.util.CollectionUtils; - import org.bitcoinj.core.Address; import org.bitcoinj.core.Coin; +import org.springframework.util.CollectionUtils; + import java.util.Map; import lombok.Getter; diff --git a/src/main/java/bisq/core/dao/proposal/compensation/CompensationRequestPayload.java b/src/main/java/bisq/core/dao/proposal/compensation/CompensationRequestPayload.java index ec8f1e5f..786b65aa 100644 --- a/src/main/java/bisq/core/dao/proposal/compensation/CompensationRequestPayload.java +++ b/src/main/java/bisq/core/dao/proposal/compensation/CompensationRequestPayload.java @@ -26,11 +26,11 @@ import io.bisq.generated.protobuffer.PB; -import org.springframework.util.CollectionUtils; - import org.bitcoinj.core.Coin; import org.bitcoinj.core.Utils; +import org.springframework.util.CollectionUtils; + import java.security.PublicKey; import java.util.Date; diff --git a/src/main/java/bisq/core/dao/proposal/generic/GenericProposalPayload.java b/src/main/java/bisq/core/dao/proposal/generic/GenericProposalPayload.java index 64f5b0f8..992138c1 100644 --- a/src/main/java/bisq/core/dao/proposal/generic/GenericProposalPayload.java +++ b/src/main/java/bisq/core/dao/proposal/generic/GenericProposalPayload.java @@ -26,10 +26,10 @@ import io.bisq.generated.protobuffer.PB; -import org.springframework.util.CollectionUtils; - import org.bitcoinj.core.Utils; +import org.springframework.util.CollectionUtils; + import java.security.PublicKey; import java.util.Date; diff --git a/src/main/java/bisq/core/filter/FilterManager.java b/src/main/java/bisq/core/filter/FilterManager.java index f2ed00ec..f8317850 100644 --- a/src/main/java/bisq/core/filter/FilterManager.java +++ b/src/main/java/bisq/core/filter/FilterManager.java @@ -50,13 +50,13 @@ import java.security.SignatureException; +import java.math.BigInteger; + import java.util.ArrayList; import java.util.List; import java.util.Optional; import java.util.stream.Collectors; -import java.math.BigInteger; - import java.lang.reflect.Method; import org.slf4j.Logger; diff --git a/src/main/java/bisq/core/locale/Res.java b/src/main/java/bisq/core/locale/Res.java index 755395dd..a059ccf2 100644 --- a/src/main/java/bisq/core/locale/Res.java +++ b/src/main/java/bisq/core/locale/Res.java @@ -21,14 +21,14 @@ import org.apache.commons.lang3.StringUtils; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; +import java.text.MessageFormat; import java.net.URL; import java.net.URLConnection; -import java.text.MessageFormat; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; import java.util.Locale; import java.util.MissingResourceException; diff --git a/src/main/java/bisq/core/payment/validation/params/btc/AbstractBitcoinNetParams.java b/src/main/java/bisq/core/payment/validation/params/btc/AbstractBitcoinNetParams.java index ce1cf818..6729061f 100644 --- a/src/main/java/bisq/core/payment/validation/params/btc/AbstractBitcoinNetParams.java +++ b/src/main/java/bisq/core/payment/validation/params/btc/AbstractBitcoinNetParams.java @@ -48,10 +48,10 @@ import com.google.common.base.Stopwatch; -import java.util.concurrent.TimeUnit; - import java.math.BigInteger; +import java.util.concurrent.TimeUnit; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/bisq/core/provider/fee/FeeService.java b/src/main/java/bisq/core/provider/fee/FeeService.java index e803d285..20962b01 100644 --- a/src/main/java/bisq/core/provider/fee/FeeService.java +++ b/src/main/java/bisq/core/provider/fee/FeeService.java @@ -36,11 +36,11 @@ import javafx.beans.property.ReadOnlyIntegerProperty; import javafx.beans.property.SimpleIntegerProperty; +import java.time.Instant; + import java.util.Map; import java.util.concurrent.TimeUnit; -import java.time.Instant; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/bisq/core/provider/price/PriceFeedService.java b/src/main/java/bisq/core/provider/price/PriceFeedService.java index ce252258..6dd2d07a 100644 --- a/src/main/java/bisq/core/provider/price/PriceFeedService.java +++ b/src/main/java/bisq/core/provider/price/PriceFeedService.java @@ -46,6 +46,8 @@ import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; +import java.time.Instant; + import java.util.ArrayList; import java.util.Date; import java.util.HashMap; @@ -55,8 +57,6 @@ import java.util.Random; import java.util.function.Consumer; -import java.time.Instant; - import lombok.extern.slf4j.Slf4j; import org.jetbrains.annotations.NotNull; diff --git a/src/main/java/bisq/core/trade/statistics/TradeStatistics.java b/src/main/java/bisq/core/trade/statistics/TradeStatistics.java index ff7f4670..5e21907c 100644 --- a/src/main/java/bisq/core/trade/statistics/TradeStatistics.java +++ b/src/main/java/bisq/core/trade/statistics/TradeStatistics.java @@ -36,12 +36,12 @@ import com.google.protobuf.ByteString; -import org.springframework.util.CollectionUtils; - import org.bitcoinj.core.Coin; import org.bitcoinj.utils.ExchangeRate; import org.bitcoinj.utils.Fiat; +import org.springframework.util.CollectionUtils; + import java.security.PublicKey; import java.util.Date; diff --git a/src/main/java/bisq/core/trade/statistics/TradeStatistics2.java b/src/main/java/bisq/core/trade/statistics/TradeStatistics2.java index 728d91b3..164b1d6b 100644 --- a/src/main/java/bisq/core/trade/statistics/TradeStatistics2.java +++ b/src/main/java/bisq/core/trade/statistics/TradeStatistics2.java @@ -38,12 +38,12 @@ import com.google.protobuf.ByteString; -import org.springframework.util.CollectionUtils; - import org.bitcoinj.core.Coin; import org.bitcoinj.utils.ExchangeRate; import org.bitcoinj.utils.Fiat; +import org.springframework.util.CollectionUtils; + import java.util.ArrayList; import java.util.Collections; import java.util.Date; diff --git a/src/test/java/bisq/core/dao/node/full/FullNodeParserTest.java b/src/test/java/bisq/core/dao/node/full/FullNodeParserTest.java index 00665134..e1ad5fa8 100644 --- a/src/test/java/bisq/core/dao/node/full/FullNodeParserTest.java +++ b/src/test/java/bisq/core/dao/node/full/FullNodeParserTest.java @@ -43,12 +43,12 @@ import java.io.File; +import java.math.BigDecimal; + import java.util.ArrayList; import java.util.Date; import java.util.Optional; -import java.math.BigDecimal; - import mockit.Expectations; import mockit.Injectable; import mockit.Tested;