Dbrant has uploaded a new change for review.
https://gerrit.wikimedia.org/r/277708
Change subject: Don't lazy-init db column indices.
......................................................................
Don't lazy-init db column indices.
Column indices can vary between different tables.
In a subsequent patch, we can lazy-init the indices on a per-table basis.
In the meantime, this fixes the current bug. Fortunately, there's no issue
with the integrity of our db itself.
Bug: T130086
Change-Id: Ied03ebdbe6986217b2838d82a6fdfc0d03b5baba
---
M app/src/main/java/org/wikipedia/database/column/Column.java
1 file changed, 1 insertion(+), 6 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia
refs/changes/08/277708/1
diff --git a/app/src/main/java/org/wikipedia/database/column/Column.java
b/app/src/main/java/org/wikipedia/database/column/Column.java
index 20bd14b..ec459a3 100644
--- a/app/src/main/java/org/wikipedia/database/column/Column.java
+++ b/app/src/main/java/org/wikipedia/database/column/Column.java
@@ -2,12 +2,10 @@
import android.database.Cursor;
import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
public abstract class Column<T> {
@NonNull private final String name;
@NonNull private final String type;
- @Nullable private Integer index;
/**
* @param name Column name.
@@ -48,9 +46,6 @@
}
protected int getIndex(@NonNull Cursor cursor) {
- if (index == null) {
- index = cursor.getColumnIndexOrThrow(getName());
- }
- return index;
+ return cursor.getColumnIndexOrThrow(getName());
}
}
\ No newline at end of file
--
To view, visit https://gerrit.wikimedia.org/r/277708
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ied03ebdbe6986217b2838d82a6fdfc0d03b5baba
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Dbrant <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits