diff options
| author | Brian Carlstrom <bdc@google.com> | 2013-06-26 22:26:16 -0700 |
|---|---|---|
| committer | Brian Carlstrom <bdc@google.com> | 2013-06-27 00:10:34 -0700 |
| commit | 75fe90cdb6e358a09047468b750648c8a3bfac9f (patch) | |
| tree | 3c2872c22550ca36e158297e080debc7bfecd425 /src/jni_internal.cc | |
| parent | f3b3bf13247364eb111cd20493a236e8f3ce2164 (diff) | |
| download | android_art-75fe90cdb6e358a09047468b750648c8a3bfac9f.tar.gz android_art-75fe90cdb6e358a09047468b750648c8a3bfac9f.tar.bz2 android_art-75fe90cdb6e358a09047468b750648c8a3bfac9f.zip | |
Improve exception detail with JNI_OnLoad issues
Change-Id: I83c679d0b282f8d9ceb717acf20dda3af2124c66
Diffstat (limited to 'src/jni_internal.cc')
| -rw-r--r-- | src/jni_internal.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/jni_internal.cc b/src/jni_internal.cc index 7c19025f7e..2673074302 100644 --- a/src/jni_internal.cc +++ b/src/jni_internal.cc @@ -2870,7 +2870,8 @@ bool JavaVMExt::LoadNativeLibrary(const std::string& path, ClassLoader* class_lo self->SetClassLoaderOverride(old_class_loader); if (IsBadJniVersion(version)) { - LOG(ERROR) << "Bad JNI version returned from JNI_OnLoad in \"" << path << "\": " << version; + StringAppendF(&detail, "Bad JNI version returned from JNI_OnLoad in \"%s\": %d", + path.c_str(), version); // It's unwise to call dlclose() here, but we can mark it // as bad and ensure that future load attempts will fail. // We don't know how far JNI_OnLoad got, so there could @@ -2878,10 +2879,9 @@ bool JavaVMExt::LoadNativeLibrary(const std::string& path, ClassLoader* class_lo // newly-registered native method calls. We could try to // unregister them, but that doesn't seem worthwhile. result = false; - } else { - VLOG(jni) << "[Returned " << (result ? "successfully" : "failure") - << " from JNI_OnLoad in \"" << path << "\"]"; } + VLOG(jni) << "[Returned " << (result ? "successfully" : "failure") + << " from JNI_OnLoad in \"" << path << "\"]"; } library->SetResult(result); |
