From 65c4f3991ad7e89cc144dba5f8acb4fcec3655b2 Mon Sep 17 00:00:00 2001 From: Jake Wharton Date: Wed, 2 Sep 2015 12:43:51 -0400 Subject: [PATCH] Comment out worker thread annotations for now. These do not play well with various combinations of lint, RxJava, and retrolambda and result in false-positives. --- .../com/squareup/sqlbrite/BriteDatabase.java | 23 +++++++++---------- .../java/com/squareup/sqlbrite/SqlBrite.java | 3 +-- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/sqlbrite/src/main/java/com/squareup/sqlbrite/BriteDatabase.java b/sqlbrite/src/main/java/com/squareup/sqlbrite/BriteDatabase.java index 46cdea24..85789f04 100644 --- a/sqlbrite/src/main/java/com/squareup/sqlbrite/BriteDatabase.java +++ b/sqlbrite/src/main/java/com/squareup/sqlbrite/BriteDatabase.java @@ -24,7 +24,6 @@ import android.support.annotation.IntDef; import android.support.annotation.NonNull; import android.support.annotation.Nullable; -import android.support.annotation.WorkerThread; import com.squareup.sqlbrite.SqlBrite.Query; import java.io.Closeable; import java.io.IOException; @@ -312,7 +311,7 @@ private QueryObservable createQuery(final Func1, Boolean> tableFilte * * @see SQLiteDatabase#rawQuery(String, String[]) */ - @CheckResult @WorkerThread + @CheckResult // TODO @WorkerThread public Cursor query(@NonNull String sql, @NonNull String... args) { if (logging) log("QUERY\n sql: %s\n args: %s", sql, Arrays.toString(args)); return getReadableDatabase().rawQuery(sql, args); @@ -323,7 +322,7 @@ public Cursor query(@NonNull String sql, @NonNull String... args) { * * @see SQLiteDatabase#insert(String, String, ContentValues) */ - @WorkerThread + // TODO @WorkerThread public long insert(@NonNull String table, @NonNull ContentValues values) { return insert(table, values, CONFLICT_NONE); } @@ -333,7 +332,7 @@ public long insert(@NonNull String table, @NonNull ContentValues values) { * * @see SQLiteDatabase#insertWithOnConflict(String, String, ContentValues, int) */ - @WorkerThread + // TODO @WorkerThread public long insert(@NonNull String table, @NonNull ContentValues values, @ConflictAlgorithm int conflictAlgorithm) { SQLiteDatabase db = getWriteableDatabase(); @@ -359,7 +358,7 @@ public long insert(@NonNull String table, @NonNull ContentValues values, * * @see SQLiteDatabase#delete(String, String, String[]) */ - @WorkerThread + // TODO @WorkerThread public int delete(@NonNull String table, @Nullable String whereClause, @Nullable String... whereArgs) { SQLiteDatabase db = getWriteableDatabase(); @@ -385,7 +384,7 @@ public int delete(@NonNull String table, @Nullable String whereClause, * * @see SQLiteDatabase#update(String, ContentValues, String, String[]) */ - @WorkerThread + // TODO @WorkerThread public int update(@NonNull String table, @NonNull ContentValues values, @Nullable String whereClause, @Nullable String... whereArgs) { return update(table, values, CONFLICT_NONE, whereClause, whereArgs); @@ -397,7 +396,7 @@ public int update(@NonNull String table, @NonNull ContentValues values, * * @see SQLiteDatabase#updateWithOnConflict(String, ContentValues, String, String[], int) */ - @WorkerThread + // TODO @WorkerThread public int update(@NonNull String table, @NonNull ContentValues values, @ConflictAlgorithm int conflictAlgorithm, @Nullable String whereClause, @Nullable String... whereArgs) { @@ -427,7 +426,7 @@ public interface Transaction extends Closeable { * * @see SQLiteDatabase#endTransaction() */ - @WorkerThread + // TODO @WorkerThread void end(); /** @@ -438,7 +437,7 @@ public interface Transaction extends Closeable { * * @see SQLiteDatabase#setTransactionSuccessful() */ - @WorkerThread + // TODO @WorkerThread void markSuccessful(); /** @@ -452,7 +451,7 @@ public interface Transaction extends Closeable { * * @see SQLiteDatabase#yieldIfContendedSafely() */ - @WorkerThread + // TODO @WorkerThread boolean yieldIfContendedSafely(); /** @@ -469,13 +468,13 @@ public interface Transaction extends Closeable { * * @see SQLiteDatabase#yieldIfContendedSafely(long) */ - @WorkerThread + // TODO @WorkerThread boolean yieldIfContendedSafely(long sleepAmount, TimeUnit sleepUnit); /** * Equivalent to calling {@link #end()} */ - @WorkerThread + // TODO @WorkerThread @Override void close(); } diff --git a/sqlbrite/src/main/java/com/squareup/sqlbrite/SqlBrite.java b/sqlbrite/src/main/java/com/squareup/sqlbrite/SqlBrite.java index fa1bb17c..92c7b76f 100644 --- a/sqlbrite/src/main/java/com/squareup/sqlbrite/SqlBrite.java +++ b/sqlbrite/src/main/java/com/squareup/sqlbrite/SqlBrite.java @@ -20,7 +20,6 @@ import android.database.sqlite.SQLiteOpenHelper; import android.support.annotation.CheckResult; import android.support.annotation.NonNull; -import android.support.annotation.WorkerThread; import android.util.Log; import rx.Observable; import rx.Subscriber; @@ -73,7 +72,7 @@ public BriteContentResolver wrapContentProvider(@NonNull ContentResolver content /** An executable query. */ public static abstract class Query { /** Execute the query on the underlying database and return the resulting cursor. */ - @CheckResult @WorkerThread + @CheckResult // TODO @WorkerThread // TODO Implementations might return null, which is gross. Throw? public abstract Cursor run();