diff options
author | Jeff Brown <jeffbrown@google.com> | 2011-12-14 14:25:13 -0800 |
---|---|---|
committer | Jeff Brown <jeffbrown@google.com> | 2011-12-16 03:59:26 -0800 |
commit | d5064be3b5922ee6522a33f8b729ffee2e3d7b4b (patch) | |
tree | 67d51b19e114b91270fe8d0710a868ae12a5d769 /core/java/android/database | |
parent | 99cfc22639b0cd393d74262a58a2123a2b632a58 (diff) | |
download | frameworks_base-d5064be3b5922ee6522a33f8b729ffee2e3d7b4b.zip frameworks_base-d5064be3b5922ee6522a33f8b729ffee2e3d7b4b.tar.gz frameworks_base-d5064be3b5922ee6522a33f8b729ffee2e3d7b4b.tar.bz2 |
Make SQLiteQuery and SQLiteProgram final.
We can do this because the classes already cannot be subclassed
by applications due to the fact they only have package private
constructors.
One very nice consequence of this observation is that we can hide or
delete several @deprecated protected members which are effectively
inaccessible because applications cannot create subclasses!
Change-Id: I2d3a0d2ad72b9289ebcdf907e4e4e6caf27f9076
Diffstat (limited to 'core/java/android/database')
-rw-r--r-- | core/java/android/database/sqlite/SQLiteProgram.java | 32 | ||||
-rw-r--r-- | core/java/android/database/sqlite/SQLiteQuery.java | 2 | ||||
-rw-r--r-- | core/java/android/database/sqlite/SQLiteStatement.java | 2 |
3 files changed, 12 insertions, 24 deletions
diff --git a/core/java/android/database/sqlite/SQLiteProgram.java b/core/java/android/database/sqlite/SQLiteProgram.java index 89552dc..2bbc6d7 100644 --- a/core/java/android/database/sqlite/SQLiteProgram.java +++ b/core/java/android/database/sqlite/SQLiteProgram.java @@ -32,9 +32,8 @@ public abstract class SQLiteProgram extends SQLiteClosable { private static final String TAG = "SQLiteProgram"; /** The database this program is compiled against. - * @deprecated do not use this + * @hide */ - @Deprecated protected SQLiteDatabase mDatabase; /** The SQL used to create this query */ @@ -43,9 +42,8 @@ public abstract class SQLiteProgram extends SQLiteClosable { /** * Native linkage, do not modify. This comes from the database and should not be modified * in here or in the native code. - * @deprecated do not use this + * @hide */ - @Deprecated protected int nHandle; /** @@ -56,9 +54,8 @@ public abstract class SQLiteProgram extends SQLiteClosable { /** * SQLiteCompiledSql statement id is populated with the corresponding object from the above * member. This member is used by the native_bind_* methods - * @deprecated do not use this + * @hide */ - @Deprecated protected int nStatement; /** @@ -210,18 +207,6 @@ public abstract class SQLiteProgram extends SQLiteClosable { return mSql; } - /** - * @deprecated This method is deprecated and must not be used. - * - * @param sql the SQL string to compile - * @param forceCompilation forces the SQL to be recompiled in the event that there is an - * existing compiled SQL program already around - */ - @Deprecated - protected void compile(String sql, boolean forceCompilation) { - // TODO is there a need for this? - } - private void bind(int type, int index, Object value) { mDatabase.verifyDbIsOpen(); addToBindArgs(index, (type == Cursor.FIELD_TYPE_NULL) ? null : value); @@ -407,25 +392,28 @@ public abstract class SQLiteProgram extends SQLiteClosable { } /** - * @deprecated This method is deprecated and must not be used. + * @hide * Compiles SQL into a SQLite program. * * <P>The database lock must be held when calling this method. * @param sql The SQL to compile. */ - @Deprecated protected final native void native_compile(String sql); /** - * @deprecated This method is deprecated and must not be used. + * @hide */ - @Deprecated protected final native void native_finalize(); + /** @hide */ protected final native void native_bind_null(int index); + /** @hide */ protected final native void native_bind_long(int index, long value); + /** @hide */ protected final native void native_bind_double(int index, double value); + /** @hide */ protected final native void native_bind_string(int index, String value); + /** @hide */ protected final native void native_bind_blob(int index, byte[] value); private final native void native_clear_bindings(); } diff --git a/core/java/android/database/sqlite/SQLiteQuery.java b/core/java/android/database/sqlite/SQLiteQuery.java index 56dd007..6dd2539 100644 --- a/core/java/android/database/sqlite/SQLiteQuery.java +++ b/core/java/android/database/sqlite/SQLiteQuery.java @@ -28,7 +28,7 @@ import android.util.Log; * SQLiteQuery is not internally synchronized so code using a SQLiteQuery from multiple * threads should perform its own synchronization when using the SQLiteQuery. */ -public class SQLiteQuery extends SQLiteProgram { +public final class SQLiteQuery extends SQLiteProgram { private static final String TAG = "SQLiteQuery"; private static native long nativeFillWindow(int databasePtr, int statementPtr, int windowPtr, diff --git a/core/java/android/database/sqlite/SQLiteStatement.java b/core/java/android/database/sqlite/SQLiteStatement.java index ff973a7..c99a6fb 100644 --- a/core/java/android/database/sqlite/SQLiteStatement.java +++ b/core/java/android/database/sqlite/SQLiteStatement.java @@ -35,7 +35,7 @@ import dalvik.system.BlockGuard; * threads should perform its own synchronization when using the SQLiteStatement. */ @SuppressWarnings("deprecation") -public class SQLiteStatement extends SQLiteProgram +public final class SQLiteStatement extends SQLiteProgram { private static final String TAG = "SQLiteStatement"; |