]> git.ktnx.net Git - mobile-ledger.git/commitdiff
whitespace
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 24 Nov 2019 20:46:09 +0000 (22:46 +0200)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 24 Nov 2019 20:46:09 +0000 (22:46 +0200)
app/src/main/java/net/ktnx/mobileledger/async/SendTransactionTask.java

index f4c7ce1fdd48ced4e421e6ea0edad468fc66a0f5..7a2b973149f5e3ab31ecd0d532bc5414e5fe0116 100644 (file)
@@ -76,7 +76,8 @@ public class SendTransactionTask extends AsyncTask<LedgerTransaction, Void, Void
         http.setDoInput(true);
         http.addRequestProperty("Content-Length", String.valueOf(bodyBytes.length));
 
-        debug("network", "request header: " + http.getRequestProperties().toString());
+        debug("network", "request header: " + http.getRequestProperties()
+                                                  .toString());
 
         try (OutputStream req = http.getOutputStream()) {
             debug("network", "Request body: " + body);
@@ -119,20 +120,23 @@ public class SendTransactionTask extends AsyncTask<LedgerTransaction, Void, Void
 
         UrlEncodedFormData params = new UrlEncodedFormData();
         params.addPair("_formid", "identify-add");
-        if (token != null) params.addPair("_token", token);
+        if (token != null)
+            params.addPair("_token", token);
         params.addPair("date", Globals.formatLedgerDate(ltr.getDate()));
         params.addPair("description", ltr.getDescription());
         for (LedgerTransactionAccount acc : ltr.getAccounts()) {
             params.addPair("account", acc.getAccountName());
             if (acc.isAmountSet())
                 params.addPair("amount", String.format(Locale.US, "%1.2f", acc.getAmount()));
-            else params.addPair("amount", "");
+            else
+                params.addPair("amount", "");
         }
 
         String body = params.toString();
         http.addRequestProperty("Content-Length", String.valueOf(body.length()));
 
-        debug("network", "request header: " + http.getRequestProperties().toString());
+        debug("network", "request header: " + http.getRequestProperties()
+                                                  .toString());
 
         try (OutputStream req = http.getOutputStream()) {
             debug("network", "Request body: " + body);
@@ -202,10 +206,10 @@ public class SendTransactionTask extends AsyncTask<LedgerTransaction, Void, Void
             if (!sendOK()) {
                 int tried = 0;
                 while (!legacySendOK()) {
-                        tried++;
-                        if (tried >= 2)
-                            throw new IOException(String.format("aborting after %d tries", tried));
-                        sleep(100);
+                    tried++;
+                    if (tried >= 2)
+                        throw new IOException(String.format("aborting after %d tries", tried));
+                    sleep(100);
                 }
             }
         }