diff --git a/xchange-kraken/src/main/java/org/knowm/xchange/kraken/KrakenAdapters.java b/xchange-kraken/src/main/java/org/knowm/xchange/kraken/KrakenAdapters.java index f6b55472c67..5967272aa76 100644 --- a/xchange-kraken/src/main/java/org/knowm/xchange/kraken/KrakenAdapters.java +++ b/xchange-kraken/src/main/java/org/knowm/xchange/kraken/KrakenAdapters.java @@ -333,10 +333,12 @@ public static OrderType adaptOrderType(KrakenType krakenType) { return krakenType.equals(KrakenType.BUY) ? OrderType.BID : OrderType.ASK; } - public static AddressWithTag adaptKrakenDepositAddress(KrakenDepositAddress[] krakenDepositAddress) { + public static AddressWithTag adaptKrakenDepositAddress( + KrakenDepositAddress[] krakenDepositAddress) { return AddressWithTag.builder() .address(krakenDepositAddress[0].getAddress()) - .addressTag(krakenDepositAddress[0].getTag()).build(); + .addressTag(krakenDepositAddress[0].getTag()) + .build(); } public static String adaptOrderId(KrakenOrderResponse orderResponse) { diff --git a/xchange-kraken/src/main/java/org/knowm/xchange/kraken/service/KrakenAccountServiceRaw.java b/xchange-kraken/src/main/java/org/knowm/xchange/kraken/service/KrakenAccountServiceRaw.java index b94a4f8cff0..726690c2fc9 100644 --- a/xchange-kraken/src/main/java/org/knowm/xchange/kraken/service/KrakenAccountServiceRaw.java +++ b/xchange-kraken/src/main/java/org/knowm/xchange/kraken/service/KrakenAccountServiceRaw.java @@ -38,11 +38,14 @@ import org.knowm.xchange.kraken.dto.account.results.WithdrawStatusResult; import org.knowm.xchange.utils.DateUtils; -/** @author jamespedwards42 */ +/** + * @author jamespedwards42 + */ @Slf4j public class KrakenAccountServiceRaw extends KrakenBaseService { - private ConcurrentHashMap depositMethods = new ConcurrentHashMap<>(); + private ConcurrentHashMap depositMethods = + new ConcurrentHashMap<>(); /** * Constructor @@ -88,14 +91,16 @@ public KrakenDepositMethods[] getDepositMethods(String assetPairs, String assets throws IOException { if (shouldCacheDepositMethods()) { try { - return depositMethods.computeIfAbsent(String.format("%s%s", assetPairs, assets), k -> { - try { - return getDepositMethodsFromRemote(assetPairs, assets); - } catch (IOException e) { - throw new RuntimeException(e); - } - }); - } catch(RuntimeException e) { + return depositMethods.computeIfAbsent( + String.format("%s%s", assetPairs, assets), + k -> { + try { + return getDepositMethodsFromRemote(assetPairs, assets); + } catch (IOException e) { + throw new RuntimeException(e); + } + }); + } catch (RuntimeException e) { if (e.getCause() instanceof IOException) { throw (IOException) e.getCause(); } diff --git a/xchange-kraken/src/test/java/org/knowm/xchange/kraken/service/KrakenAccountServiceTest.java b/xchange-kraken/src/test/java/org/knowm/xchange/kraken/service/KrakenAccountServiceTest.java index 3315d356277..8f1d262a402 100644 --- a/xchange-kraken/src/test/java/org/knowm/xchange/kraken/service/KrakenAccountServiceTest.java +++ b/xchange-kraken/src/test/java/org/knowm/xchange/kraken/service/KrakenAccountServiceTest.java @@ -162,7 +162,9 @@ public void testRequestDepositMethodCaching() { loadFile( "/org/knowm/xchange/kraken/dto/account/example-deposit-addresses-trx.json")))); - exchange.getExchangeSpecification().setExchangeSpecificParametersItem("cacheDepositMethods", true); + exchange + .getExchangeSpecification() + .setExchangeSpecificParametersItem("cacheDepositMethods", true); DefaultRequestDepositAddressParams params = DefaultRequestDepositAddressParams.builder().currency(Currency.TRX).build(); @@ -199,7 +201,9 @@ public void testRequestDepositMethodNoCache() { DefaultRequestDepositAddressParams params = DefaultRequestDepositAddressParams.builder().currency(Currency.TRX).build(); - exchange.getExchangeSpecification().setExchangeSpecificParametersItem("cacheDepositMethods", false); + exchange + .getExchangeSpecification() + .setExchangeSpecificParametersItem("cacheDepositMethods", false); classUnderTest.requestDepositAddress(params); classUnderTest.requestDepositAddress(params);