]> git.ktnx.net Git - mobile-ledger.git/commitdiff
replace hollow switch with a simple if
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Tue, 21 Jul 2020 09:59:41 +0000 (12:59 +0300)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Tue, 21 Jul 2020 09:59:41 +0000 (12:59 +0300)
app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java

index 86d4cc457f0155322808d720eb57074c5cdefce8..ef6eb8172c0598f3088af2c5481be4073042862f 100644 (file)
@@ -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()) {