Loading core/jni/android_database_CursorWindow.cpp +9 −5 Original line number Diff line number Diff line Loading @@ -63,7 +63,8 @@ static void native_init_empty(JNIEnv * env, jobject object, jboolean localOnly) } if (!window->initBuffer(localOnly)) { jniThrowException(env, "java/lang/IllegalStateException", "Couldn't init cursor window"); jniThrowException(env, "java/lang/RuntimeException", "Memory couldn't be allocated for 1MB CursorWindow object."); delete window; return; } Loading @@ -82,11 +83,13 @@ static void native_init_memory(JNIEnv * env, jobject object, jobject memObj) CursorWindow * window = new CursorWindow(); if (!window) { jniThrowException(env, "java/lang/RuntimeException", "No memory for native window object"); jniThrowException(env, "java/lang/RuntimeException", "CursorWindow of size 1MB couldn't be created. No memory?"); return; } if (!window->setMemory(memory)) { jniThrowException(env, "java/lang/RuntimeException", "No memory in memObj"); jniThrowException(env, "java/lang/RuntimeException", "Memory couldn't be initialized for 1MB CursorWindow object."); delete window; return; } Loading Loading @@ -131,8 +134,9 @@ LOG_WINDOW("Closing window %p", window); static void throwExceptionWithRowCol(JNIEnv * env, jint row, jint column) { char buf[100]; snprintf(buf, sizeof(buf), "get field slot from row %d col %d failed", row, column); char buf[200]; snprintf(buf, sizeof(buf), "Couldn't read row %d, col %d from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it", row, column); jniThrowException(env, "java/lang/IllegalStateException", buf); } Loading libs/binder/CursorWindow.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -219,7 +219,8 @@ LOG_WINDOW("follwing 'pointer' to next chunk, offset of next pointer is %d", chu field_slot_t * CursorWindow::getFieldSlotWithCheck(int row, int column) { if (row < 0 || row >= mHeader->numRows || column < 0 || column >= mHeader->numColumns) { LOGE("Bad request for field slot %d,%d. numRows = %d, numColumns = %d", row, column, mHeader->numRows, mHeader->numColumns); LOGE("Failed to read row# %d, column# from a CursorWindow which has %d rows, %d columns.", row, column, mHeader->numRows, mHeader->numColumns); return NULL; } row_slot_t * rowSlot = getRowSlot(row); Loading @@ -238,7 +239,8 @@ field_slot_t * CursorWindow::getFieldSlotWithCheck(int row, int column) uint32_t CursorWindow::read_field_slot(int row, int column, field_slot_t * slotOut) { if (row < 0 || row >= mHeader->numRows || column < 0 || column >= mHeader->numColumns) { LOGE("Bad request for field slot %d,%d. numRows = %d, numColumns = %d", row, column, mHeader->numRows, mHeader->numColumns); LOGE("Can't read row# %d, col# %d from CursorWindow. Make sure your Cursor is initialized correctly.", row, column); return -1; } row_slot_t * rowSlot = getRowSlot(row); Loading Loading
core/jni/android_database_CursorWindow.cpp +9 −5 Original line number Diff line number Diff line Loading @@ -63,7 +63,8 @@ static void native_init_empty(JNIEnv * env, jobject object, jboolean localOnly) } if (!window->initBuffer(localOnly)) { jniThrowException(env, "java/lang/IllegalStateException", "Couldn't init cursor window"); jniThrowException(env, "java/lang/RuntimeException", "Memory couldn't be allocated for 1MB CursorWindow object."); delete window; return; } Loading @@ -82,11 +83,13 @@ static void native_init_memory(JNIEnv * env, jobject object, jobject memObj) CursorWindow * window = new CursorWindow(); if (!window) { jniThrowException(env, "java/lang/RuntimeException", "No memory for native window object"); jniThrowException(env, "java/lang/RuntimeException", "CursorWindow of size 1MB couldn't be created. No memory?"); return; } if (!window->setMemory(memory)) { jniThrowException(env, "java/lang/RuntimeException", "No memory in memObj"); jniThrowException(env, "java/lang/RuntimeException", "Memory couldn't be initialized for 1MB CursorWindow object."); delete window; return; } Loading Loading @@ -131,8 +134,9 @@ LOG_WINDOW("Closing window %p", window); static void throwExceptionWithRowCol(JNIEnv * env, jint row, jint column) { char buf[100]; snprintf(buf, sizeof(buf), "get field slot from row %d col %d failed", row, column); char buf[200]; snprintf(buf, sizeof(buf), "Couldn't read row %d, col %d from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it", row, column); jniThrowException(env, "java/lang/IllegalStateException", buf); } Loading
libs/binder/CursorWindow.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -219,7 +219,8 @@ LOG_WINDOW("follwing 'pointer' to next chunk, offset of next pointer is %d", chu field_slot_t * CursorWindow::getFieldSlotWithCheck(int row, int column) { if (row < 0 || row >= mHeader->numRows || column < 0 || column >= mHeader->numColumns) { LOGE("Bad request for field slot %d,%d. numRows = %d, numColumns = %d", row, column, mHeader->numRows, mHeader->numColumns); LOGE("Failed to read row# %d, column# from a CursorWindow which has %d rows, %d columns.", row, column, mHeader->numRows, mHeader->numColumns); return NULL; } row_slot_t * rowSlot = getRowSlot(row); Loading @@ -238,7 +239,8 @@ field_slot_t * CursorWindow::getFieldSlotWithCheck(int row, int column) uint32_t CursorWindow::read_field_slot(int row, int column, field_slot_t * slotOut) { if (row < 0 || row >= mHeader->numRows || column < 0 || column >= mHeader->numColumns) { LOGE("Bad request for field slot %d,%d. numRows = %d, numColumns = %d", row, column, mHeader->numRows, mHeader->numColumns); LOGE("Can't read row# %d, col# %d from CursorWindow. Make sure your Cursor is initialized correctly.", row, column); return -1; } row_slot_t * rowSlot = getRowSlot(row); Loading