Also print class for NoSuchFieldException
Example message:
Caused by: java.lang.NoSuchFieldException: No field value in class Ljava/lang/String;
Added test.
(cherry picked from commit 3beb245da9392818e3154d47593f82cf0ef69aac)
Bug: 20881251
Bug: 21027454
Change-Id: I4043cbf26c3077952b6c151da0d0edd980da26b1
diff --git a/runtime/native/java_lang_Class.cc b/runtime/native/java_lang_Class.cc
index a779e97..795a0ea 100644
--- a/runtime/native/java_lang_Class.cc
+++ b/runtime/native/java_lang_Class.cc
@@ -252,7 +252,7 @@
std::string name_str = name_string->ToModifiedUtf8();
// We may have a pending exception if we failed to resolve.
if (!soa.Self()->IsExceptionPending()) {
- soa.Self()->ThrowNewException("Ljava/lang/NoSuchFieldException;", name_str.c_str());
+ ThrowNoSuchFieldException(DecodeClass(soa, javaThis), name_str.c_str());
}
return nullptr;
}