]> git.ktnx.net Git - mobile-ledger.git/commitdiff
inline the storeAccountsAndTransactions method
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Fri, 23 Apr 2021 04:56:14 +0000 (04:56 +0000)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Fri, 23 Apr 2021 04:56:14 +0000 (04:56 +0000)
it is a bit silly to have run() that only calls one method

app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java

index 0e42f87dfcd75b3e0de018dc1c23224c8807675b..9636208b65a2446787383307ce4efb9ffc371a51 100644 (file)
@@ -715,8 +715,8 @@ public class RetrieveTransactionsTask extends
             this.accounts = accounts;
             this.transactions = transactions;
         }
-        private void storeAccountsAndTransactions(List<LedgerAccount> accounts,
-                                                  List<LedgerTransaction> transactions) {
+        @Override
+        public void run() {
             AccountDAO accDao = DB.get()
                                   .getAccountDAO();
             TransactionDAO trDao = DB.get()
@@ -730,8 +730,7 @@ public class RetrieveTransactionsTask extends
                 if (existing != null) {
                     a.account.setExpanded(existing.isExpanded());
                     a.account.setAmountsExpanded(existing.isAmountsExpanded());
-                    a.account.setId(
-                            existing.getId()); // not strictly needed, but since we have it
+                    a.account.setId(existing.getId()); // not strictly needed, but since we have it
                     // anyway...
                 }
 
@@ -757,9 +756,5 @@ public class RetrieveTransactionsTask extends
               .insertSync(new Option(profile.getId(), Option.OPT_LAST_SCRAPE,
                       String.valueOf((new Date()).getTime())));
         }
-        @Override
-        public void run() {
-            storeAccountsAndTransactions(accounts, transactions);
-        }
     }
 }