From 5e5e48984b4239b548a9d95a99323b874928e32f Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Tue, 21 Jul 2020 12:59:41 +0300 Subject: [PATCH] replace hollow switch with a simple if --- .../ktnx/mobileledger/async/RetrieveTransactionsTask.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java b/app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java index 86d4cc45..ef6eb817 100644 --- a/app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java +++ b/app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java @@ -159,12 +159,8 @@ public class RetrieveTransactionsTask HttpURLConnection http = NetworkUtil.prepareConnection(profile, "journal"); http.setAllowUserInteraction(false); publishProgress(progress); - switch (http.getResponseCode()) { - case 200: - break; - default: - throw new HTTPException(http.getResponseCode(), http.getResponseMessage()); - } + if (http.getResponseCode() != 200) + throw new HTTPException(http.getResponseCode(), http.getResponseMessage()); SQLiteDatabase db = App.getDatabase(); try (InputStream resp = http.getInputStream()) { -- 2.39.5