]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/utils/MLDB.java
first step towards pattern-assisted auto-filling of transactions
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / utils / MLDB.java
index 03b207c8f02c017e1643e131e1a8ac6b3acde32e..16e46e68a6439d8b6fd6725fa928291375af18db 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2019 Damyan Ivanov.
+ * Copyright © 2021 Damyan Ivanov.
  * This file is part of MoLe.
  * MoLe is free software: you can distribute it and/or modify it
  * under the term of the GNU General Public License as published by
@@ -165,9 +165,7 @@ public final class MLDB {
             String sql;
             String[] params;
             if (profileSpecific) {
-                MobileLedgerProfile p = (profile == null) ? Data.profile.getValue() : profile;
-                if (p == null)
-                    throw new AssertionError();
+                MobileLedgerProfile p = (profile == null) ? Data.getProfile() : profile;
                 sql = String.format(
                         "SELECT rowid as _id, %s, CASE WHEN %s_upper LIKE ?||'%%' THEN 1 " +
                         "WHEN %s_upper LIKE '%%:'||?||'%%' then 2 " +
@@ -201,8 +199,8 @@ public final class MLDB {
                     (parent, itemView, position, id) -> callback.descriptionSelected(
                             String.valueOf(view.getText())));
     }
-    public static void queryInBackground(@NonNull String statement, @NonNull String[] params,
-                                         @NonNull CallbackHelper callbackHelper) {
+    public static void queryInBackground(@NonNull String statement, String[] params,
+                                         @NonNull final CallbackHelper callbackHelper) {
         /* All callbacks are called in the new (asynchronous) thread! */
         Thread t = new Thread(() -> {
             callbackHelper.onStart();