Emit the same detail messages as dalvik for ArrayStoreExceptions from System.arraycopy.
Change-Id: I9b5e923fbd8eb92258de8a6639a129b0d180f286
diff --git a/src/java_lang_System.cc b/src/java_lang_System.cc
index 985e753..78100cf 100644
--- a/src/java_lang_System.cc
+++ b/src/java_lang_System.cc
@@ -107,7 +107,7 @@
void ThrowArrayStoreException_NotAnArray(const char* identifier, Object* array) {
std::string actualType(PrettyTypeOf(array));
Thread::Current()->ThrowNewExceptionF("Ljava/lang/ArrayStoreException;",
- "%s is not an array: %s", identifier, actualType.c_str());
+ "%s of type %s is not an array", identifier, actualType.c_str());
}
void System_arraycopy(JNIEnv* env, jclass, jobject javaSrc, jint srcPos, jobject javaDst, jint dstPos, jint length) {
@@ -128,11 +128,11 @@
Object* srcObject = Decode<Object*>(env, javaSrc);
Object* dstObject = Decode<Object*>(env, javaDst);
if (!srcObject->IsArrayInstance()) {
- ThrowArrayStoreException_NotAnArray("src", srcObject);
+ ThrowArrayStoreException_NotAnArray("source", srcObject);
return;
}
if (!dstObject->IsArrayInstance()) {
- ThrowArrayStoreException_NotAnArray("dst", dstObject);
+ ThrowArrayStoreException_NotAnArray("destination", dstObject);
return;
}
Array* srcArray = srcObject->AsArray();