diff options
author | Jeff Hao <jeffhao@google.com> | 2015-05-19 20:30:23 -0700 |
---|---|---|
committer | Jeff Hao <jeffhao@google.com> | 2015-05-20 18:32:14 -0700 |
commit | 15e9ad1d028d7f12cb598b075453173532a00d91 (patch) | |
tree | f31edd7f7e10d8372c452229b4f9eb749647864f /runtime/jni_internal_test.cc | |
parent | 5d52f3dca52548f4a4598abd06432cad3dca6b8a (diff) | |
download | android_art-15e9ad1d028d7f12cb598b075453173532a00d91.tar.gz android_art-15e9ad1d028d7f12cb598b075453173532a00d91.tar.bz2 android_art-15e9ad1d028d7f12cb598b075453173532a00d91.zip |
Intercept JNI invocation of String.<init> methods.
libmono uses JNI AllocObject and CallNonvirtualVoidMethod to create and
initialize a string instead of using the recommended NewObject. This
change adds an intercept to change the String.<init> call to a
StringFactory call instead. Then, it uses the object id of the original
string object referrer and maps it to the result of the StringFactory.
Bug: 21288130
Change-Id: Ib4db402c178bc37188d5c5faf30b6e4fdc747b17
Diffstat (limited to 'runtime/jni_internal_test.cc')
-rw-r--r-- | runtime/jni_internal_test.cc | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/runtime/jni_internal_test.cc b/runtime/jni_internal_test.cc index 3d14a4e284..581ef0e61a 100644 --- a/runtime/jni_internal_test.cc +++ b/runtime/jni_internal_test.cc @@ -858,8 +858,7 @@ TEST_F(JniInternalTest, FromReflectedMethod_ToReflectedMethod) { jstring s = reinterpret_cast<jstring>(env_->AllocObject(c)); ASSERT_NE(s, nullptr); env_->CallVoidMethod(s, mid2); - // With the string change, this should now throw an UnsupportedOperationException. - ASSERT_EQ(JNI_TRUE, env_->ExceptionCheck()); + ASSERT_EQ(JNI_FALSE, env_->ExceptionCheck()); env_->ExceptionClear(); mid = env_->GetMethodID(c, "length", "()I"); |