From 533be5a1cacad6c896af645cb8a81b5bb6b1378d Mon Sep 17 00:00:00 2001 From: HenrikJannsen Date: Wed, 4 Jan 2023 19:30:02 -0500 Subject: [PATCH] Combine nested if statements Signed-off-by: HenrikJannsen --- .../main/java/bisq/core/provider/price/PriceRequest.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/bisq/core/provider/price/PriceRequest.java b/core/src/main/java/bisq/core/provider/price/PriceRequest.java index 39f4d1a985..90861c035e 100644 --- a/core/src/main/java/bisq/core/provider/price/PriceRequest.java +++ b/core/src/main/java/bisq/core/provider/price/PriceRequest.java @@ -60,15 +60,12 @@ public class PriceRequest { if (!shutDownRequested) { resultFuture.set(marketPriceTuple); } - } public void onFailure(@NotNull Throwable throwable) { - if (!shutDownRequested) { - if (!resultFuture.setException(new PriceRequestException(throwable, baseUrl))) { - // In case the setException returns false we need to cancel the future. - resultFuture.cancel(true); - } + if (!shutDownRequested && !resultFuture.setException(new PriceRequestException(throwable, baseUrl))) { + // In case the setException returns false we need to cancel the future. + resultFuture.cancel(true); } } }, MoreExecutors.directExecutor());