Fix ProxyTest.
One of our failing CTS tests was because we weren't implement "strict" mode. I
added a CHECK here the other day while touching all callers, which conveniently
made us abort in that case, pointing to the error. Throwing instead gives us
the behavior we want.
Change-Id: Ia93900dd5157685f5142cd9662088c1417299c09
diff --git a/src/runtime_support.cc b/src/runtime_support.cc
index 7838d94..b002c5c 100644
--- a/src/runtime_support.cc
+++ b/src/runtime_support.cc
@@ -1224,7 +1224,14 @@
if (result_ref != NULL) {
JValue result_unboxed;
bool unboxed_okay = UnboxPrimitive(result_ref, proxy_mh.GetReturnType(), result_unboxed, "result");
- CHECK(unboxed_okay);
+ if (!unboxed_okay) {
+ self->ClearException();
+ self->ThrowNewExceptionF("Ljava/lang/ClassCastException;",
+ "Couldn't convert result of type %s to %s",
+ PrettyTypeOf(result_ref).c_str(),
+ PrettyDescriptor(proxy_mh.GetReturnType()).c_str());
+ return;
+ }
*reinterpret_cast<JValue*>(stack_args) = result_unboxed;
} else {
*reinterpret_cast<jobject*>(stack_args) = NULL;