public <T> List<T> selectRows(final SQLiteDatabase db, final Func1<Cursor, T> mapper) {

            return withAccessLock(() -> {

                try (Cursor c = openCursorFor(db, null)) {
                    final List<T> result = new ArrayList<>();
                    while (c.moveToNext()) {
                        result.add(mapper.call(c));
                    }
                    return result;
                }
            });
        }
if returned id is < 0 then there is no offline log for given geocode
main/src/main/java/cgeo/geocaching/storage/DataStore.java