Skip to content

Commit aa32c30

Browse files
author
Jeff Brown
committed
Restore broken CursorWindow.getType behavior.
Bug: 5430009 Some CTS tests try to call getType on fields in empty cursor windows or with out of bound column indices (-1). Restoring the previous behavior of returning FIELD_TYPE_NULL instead of throwing. Fix this later. Change-Id: I782bd02012474e7dabc5bb7ea2dc45e8b0c7ef25
1 parent 3bc6bbc commit aa32c30

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

core/jni/android_database_CursorWindow.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,10 @@ static jint nativeGetType(JNIEnv* env, jclass clazz, jint windowPtr,
147147

148148
field_slot_t* fieldSlot = window->getFieldSlotWithCheck(row, column);
149149
if (!fieldSlot) {
150-
throwExceptionWithRowCol(env, row, column);
151-
return NULL;
150+
// FIXME: This is really broken but we have CTS tests that depend
151+
// on this legacy behavior.
152+
//throwExceptionWithRowCol(env, row, column);
153+
return FIELD_TYPE_NULL;
152154
}
153155
return fieldSlot->type;
154156
}

0 commit comments

Comments
 (0)