From: Damyan Ivanov Date: Tue, 21 Jul 2020 09:59:41 +0000 (+0300) Subject: replace hollow switch with a simple if X-Git-Tag: v0.15.0~78 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=5e5e48984b4239b548a9d95a99323b874928e32f;p=mobile-ledger.git replace hollow switch with a simple if --- 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()) {