Merge "Change ISE to AssertException, which is more suitable." into qt-dev

This commit is contained in:
Makoto Onuki
2019-04-04 23:56:29 +00:00
committed by Android (Google) Code Review

View File

@@ -138,7 +138,7 @@ public class CursorWindow extends SQLiteClosable implements Parcelable {
mName = name != null && name.length() != 0 ? name : "<unnamed>"; mName = name != null && name.length() != 0 ? name : "<unnamed>";
mWindowPtr = nativeCreate(mName, (int) windowSizeBytes); mWindowPtr = nativeCreate(mName, (int) windowSizeBytes);
if (mWindowPtr == 0) { if (mWindowPtr == 0) {
throw new IllegalStateException(); // Shouldn't happen. throw new AssertionError(); // Not possible, the native code won't return it.
} }
mCloseGuard.open("close"); mCloseGuard.open("close");
recordNewWindow(Binder.getCallingPid(), mWindowPtr); recordNewWindow(Binder.getCallingPid(), mWindowPtr);
@@ -166,7 +166,7 @@ public class CursorWindow extends SQLiteClosable implements Parcelable {
mStartPos = source.readInt(); mStartPos = source.readInt();
mWindowPtr = nativeCreateFromParcel(source); mWindowPtr = nativeCreateFromParcel(source);
if (mWindowPtr == 0) { if (mWindowPtr == 0) {
throw new IllegalStateException(); // Shouldn't happen. throw new AssertionError(); // Not possible, the native code won't return it.
} }
mName = nativeGetName(mWindowPtr); mName = nativeGetName(mWindowPtr);
mCloseGuard.open("close"); mCloseGuard.open("close");