Merge "Emit the same detail message as dalvik for ArrayStoreException from code." into dalvik-dev
diff --git a/src/compiler/codegen/arm/ArchUtility.cc b/src/compiler/codegen/arm/ArchUtility.cc
index 52fb018..5e8fa20 100644
--- a/src/compiler/codegen/arm/ArchUtility.cc
+++ b/src/compiler/codegen/arm/ArchUtility.cc
@@ -455,7 +455,7 @@
// Dump mapping table
if (cUnit->mappingTable.size() > 0) {
- std::string line(StringPrintf("\n MappingTable %s%s_%s_mappingTable[%d] = {",
+ std::string line(StringPrintf("\n MappingTable %s%s_%s_mappingTable[%zu] = {",
descriptor.c_str(), name.c_str(), signature.c_str(), cUnit->mappingTable.size()));
std::replace(line.begin(), line.end(), ';', '_');
LOG(INFO) << line;
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();