From 6e3b1fde86319d1edd11858d1f34c5234ad2512e Mon Sep 17 00:00:00 2001 From: Peter Serwylo Date: Mon, 27 Jun 2016 22:23:35 +1000 Subject: [PATCH] Implement `getLong` for `ContentValuesCursor`. This is required because SQLite "rowids" are 64 bit integers: > all rows within SQLite tables have a 64-bit signed integer > key that uniquely identifies the row within its table." https://sqlite.org/lang_createtable.html#rowid --- .../java/org/fdroid/fdroid/data/ContentValuesCursor.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/fdroid/fdroid/data/ContentValuesCursor.java b/app/src/main/java/org/fdroid/fdroid/data/ContentValuesCursor.java index 8bc350ce4..3c64c7957 100644 --- a/app/src/main/java/org/fdroid/fdroid/data/ContentValuesCursor.java +++ b/app/src/main/java/org/fdroid/fdroid/data/ContentValuesCursor.java @@ -65,7 +65,10 @@ class ContentValuesCursor extends AbstractCursor { @Override public long getLong(int i) { - throw new IllegalArgumentException("unimplemented"); + if (values[i] instanceof Long) { + return (Long) values[i]; + } + throw new IllegalArgumentException("Value is not a Long"); } @Override