Loading core/java/android/database/CursorWindow.java +4 −8 Original line number Diff line number Diff line Loading @@ -224,8 +224,6 @@ public class CursorWindow extends SQLiteClosable implements Parcelable { return getType(row, col) == Cursor.FIELD_TYPE_NULL; } private native boolean isNull_native(int row, int col); /** * Returns a byte array for the given field. * Loading Loading @@ -280,7 +278,8 @@ public class CursorWindow extends SQLiteClosable implements Parcelable { */ @Deprecated public boolean isBlob(int row, int col) { return getType(row, col) == Cursor.FIELD_TYPE_BLOB; int type = getType(row, col); return type == Cursor.FIELD_TYPE_BLOB || type == Cursor.FIELD_TYPE_NULL; } /** Loading Loading @@ -319,13 +318,10 @@ public class CursorWindow extends SQLiteClosable implements Parcelable { */ @Deprecated public boolean isString(int row, int col) { return getType(row, col) == Cursor.FIELD_TYPE_STRING; int type = getType(row, col); return type == Cursor.FIELD_TYPE_STRING || type == Cursor.FIELD_TYPE_NULL; } private native boolean isBlob_native(int row, int col); private native boolean isString_native(int row, int col); private native boolean isInteger_native(int row, int col); private native boolean isFloat_native(int row, int col); private native int getType_native(int row, int col); /** Loading core/jni/android_database_CursorWindow.cpp +6 −72 Original line number Diff line number Diff line Loading @@ -225,70 +225,6 @@ LOG_WINDOW("Getting blob for %d,%d from %p", row, column, window); return NULL; } static jboolean isBlob_native(JNIEnv* env, jobject object, jint row, jint column) { int32_t err; CursorWindow * window = GET_WINDOW(env, object); LOG_WINDOW("Checking if column is a blob or null for %d,%d from %p", row, column, window); field_slot_t field; err = window->read_field_slot(row, column, &field); if (err != 0) { throwExceptionWithRowCol(env, row, column); return NULL; } return field.type == FIELD_TYPE_BLOB || field.type == FIELD_TYPE_NULL; } static jboolean isString_native(JNIEnv* env, jobject object, jint row, jint column) { int32_t err; CursorWindow * window = GET_WINDOW(env, object); LOG_WINDOW("Checking if column is a string or null for %d,%d from %p", row, column, window); field_slot_t field; err = window->read_field_slot(row, column, &field); if (err != 0) { throwExceptionWithRowCol(env, row, column); return NULL; } return field.type == FIELD_TYPE_STRING || field.type == FIELD_TYPE_NULL; } static jboolean isInteger_native(JNIEnv* env, jobject object, jint row, jint column) { int32_t err; CursorWindow * window = GET_WINDOW(env, object); LOG_WINDOW("Checking if column is an integer for %d,%d from %p", row, column, window); field_slot_t field; err = window->read_field_slot(row, column, &field); if (err != 0) { throwExceptionWithRowCol(env, row, column); return NULL; } return field.type == FIELD_TYPE_INTEGER; } static jboolean isFloat_native(JNIEnv* env, jobject object, jint row, jint column) { int32_t err; CursorWindow * window = GET_WINDOW(env, object); LOG_WINDOW("Checking if column is a float for %d,%d from %p", row, column, window); field_slot_t field; err = window->read_field_slot(row, column, &field); if (err != 0) { throwExceptionWithRowCol(env, row, column); return NULL; } return field.type == FIELD_TYPE_FLOAT; } static jstring getString_native(JNIEnv* env, jobject object, jint row, jint column) { int32_t err; Loading Loading @@ -487,9 +423,8 @@ LOG_WINDOW("Getting double for %d,%d from %p", row, column, window); } } static jboolean isNull_native(JNIEnv* env, jobject object, jint row, jint column) bool isNull_native(CursorWindow *window, jint row, jint column) { CursorWindow * window = GET_WINDOW(env, object); LOG_WINDOW("Checking for NULL at %d,%d from %p", row, column, window); bool isNull; Loading Loading @@ -658,6 +593,10 @@ static jint getType_native(JNIEnv* env, jobject object, jint row, jint column) CursorWindow * window = GET_WINDOW(env, object); LOG_WINDOW("returning column type affinity for %d,%d from %p", row, column, window); if (isNull_native(window, row, column)) { return FIELD_TYPE_NULL; } field_slot_t field; err = window->read_field_slot(row, column, &field); if (err != 0) { Loading @@ -678,11 +617,9 @@ static JNINativeMethod sMethods[] = {"close_native", "()V", (void *)native_close}, {"getLong_native", "(II)J", (void *)getLong_native}, {"getBlob_native", "(II)[B", (void *)getBlob_native}, {"isBlob_native", "(II)Z", (void *)isBlob_native}, {"getString_native", "(II)Ljava/lang/String;", (void *)getString_native}, {"copyStringToBuffer_native", "(IIILandroid/database/CharArrayBuffer;)[C", (void *)copyStringToBuffer_native}, {"getDouble_native", "(II)D", (void *)getDouble_native}, {"isNull_native", "(II)Z", (void *)isNull_native}, {"getNumRows_native", "()I", (void *)getNumRows}, {"setNumColumns_native", "(I)Z", (void *)setNumColumns}, {"allocRow_native", "()Z", (void *)allocRow}, Loading @@ -692,9 +629,6 @@ static JNINativeMethod sMethods[] = {"putDouble_native", "(DII)Z", (void *)putDouble_native}, {"freeLastRow_native", "()V", (void *)freeLastRow}, {"putNull_native", "(II)Z", (void *)putNull_native}, {"isString_native", "(II)Z", (void *)isString_native}, {"isFloat_native", "(II)Z", (void *)isFloat_native}, {"isInteger_native", "(II)Z", (void *)isInteger_native}, {"getType_native", "(II)I", (void *)getType_native}, }; Loading Loading
core/java/android/database/CursorWindow.java +4 −8 Original line number Diff line number Diff line Loading @@ -224,8 +224,6 @@ public class CursorWindow extends SQLiteClosable implements Parcelable { return getType(row, col) == Cursor.FIELD_TYPE_NULL; } private native boolean isNull_native(int row, int col); /** * Returns a byte array for the given field. * Loading Loading @@ -280,7 +278,8 @@ public class CursorWindow extends SQLiteClosable implements Parcelable { */ @Deprecated public boolean isBlob(int row, int col) { return getType(row, col) == Cursor.FIELD_TYPE_BLOB; int type = getType(row, col); return type == Cursor.FIELD_TYPE_BLOB || type == Cursor.FIELD_TYPE_NULL; } /** Loading Loading @@ -319,13 +318,10 @@ public class CursorWindow extends SQLiteClosable implements Parcelable { */ @Deprecated public boolean isString(int row, int col) { return getType(row, col) == Cursor.FIELD_TYPE_STRING; int type = getType(row, col); return type == Cursor.FIELD_TYPE_STRING || type == Cursor.FIELD_TYPE_NULL; } private native boolean isBlob_native(int row, int col); private native boolean isString_native(int row, int col); private native boolean isInteger_native(int row, int col); private native boolean isFloat_native(int row, int col); private native int getType_native(int row, int col); /** Loading
core/jni/android_database_CursorWindow.cpp +6 −72 Original line number Diff line number Diff line Loading @@ -225,70 +225,6 @@ LOG_WINDOW("Getting blob for %d,%d from %p", row, column, window); return NULL; } static jboolean isBlob_native(JNIEnv* env, jobject object, jint row, jint column) { int32_t err; CursorWindow * window = GET_WINDOW(env, object); LOG_WINDOW("Checking if column is a blob or null for %d,%d from %p", row, column, window); field_slot_t field; err = window->read_field_slot(row, column, &field); if (err != 0) { throwExceptionWithRowCol(env, row, column); return NULL; } return field.type == FIELD_TYPE_BLOB || field.type == FIELD_TYPE_NULL; } static jboolean isString_native(JNIEnv* env, jobject object, jint row, jint column) { int32_t err; CursorWindow * window = GET_WINDOW(env, object); LOG_WINDOW("Checking if column is a string or null for %d,%d from %p", row, column, window); field_slot_t field; err = window->read_field_slot(row, column, &field); if (err != 0) { throwExceptionWithRowCol(env, row, column); return NULL; } return field.type == FIELD_TYPE_STRING || field.type == FIELD_TYPE_NULL; } static jboolean isInteger_native(JNIEnv* env, jobject object, jint row, jint column) { int32_t err; CursorWindow * window = GET_WINDOW(env, object); LOG_WINDOW("Checking if column is an integer for %d,%d from %p", row, column, window); field_slot_t field; err = window->read_field_slot(row, column, &field); if (err != 0) { throwExceptionWithRowCol(env, row, column); return NULL; } return field.type == FIELD_TYPE_INTEGER; } static jboolean isFloat_native(JNIEnv* env, jobject object, jint row, jint column) { int32_t err; CursorWindow * window = GET_WINDOW(env, object); LOG_WINDOW("Checking if column is a float for %d,%d from %p", row, column, window); field_slot_t field; err = window->read_field_slot(row, column, &field); if (err != 0) { throwExceptionWithRowCol(env, row, column); return NULL; } return field.type == FIELD_TYPE_FLOAT; } static jstring getString_native(JNIEnv* env, jobject object, jint row, jint column) { int32_t err; Loading Loading @@ -487,9 +423,8 @@ LOG_WINDOW("Getting double for %d,%d from %p", row, column, window); } } static jboolean isNull_native(JNIEnv* env, jobject object, jint row, jint column) bool isNull_native(CursorWindow *window, jint row, jint column) { CursorWindow * window = GET_WINDOW(env, object); LOG_WINDOW("Checking for NULL at %d,%d from %p", row, column, window); bool isNull; Loading Loading @@ -658,6 +593,10 @@ static jint getType_native(JNIEnv* env, jobject object, jint row, jint column) CursorWindow * window = GET_WINDOW(env, object); LOG_WINDOW("returning column type affinity for %d,%d from %p", row, column, window); if (isNull_native(window, row, column)) { return FIELD_TYPE_NULL; } field_slot_t field; err = window->read_field_slot(row, column, &field); if (err != 0) { Loading @@ -678,11 +617,9 @@ static JNINativeMethod sMethods[] = {"close_native", "()V", (void *)native_close}, {"getLong_native", "(II)J", (void *)getLong_native}, {"getBlob_native", "(II)[B", (void *)getBlob_native}, {"isBlob_native", "(II)Z", (void *)isBlob_native}, {"getString_native", "(II)Ljava/lang/String;", (void *)getString_native}, {"copyStringToBuffer_native", "(IIILandroid/database/CharArrayBuffer;)[C", (void *)copyStringToBuffer_native}, {"getDouble_native", "(II)D", (void *)getDouble_native}, {"isNull_native", "(II)Z", (void *)isNull_native}, {"getNumRows_native", "()I", (void *)getNumRows}, {"setNumColumns_native", "(I)Z", (void *)setNumColumns}, {"allocRow_native", "()Z", (void *)allocRow}, Loading @@ -692,9 +629,6 @@ static JNINativeMethod sMethods[] = {"putDouble_native", "(DII)Z", (void *)putDouble_native}, {"freeLastRow_native", "()V", (void *)freeLastRow}, {"putNull_native", "(II)Z", (void *)putNull_native}, {"isString_native", "(II)Z", (void *)isString_native}, {"isFloat_native", "(II)Z", (void *)isFloat_native}, {"isInteger_native", "(II)Z", (void *)isInteger_native}, {"getType_native", "(II)I", (void *)getType_native}, }; Loading