Fix exception throwing to support no detail message.
(The empty string as a detail message is distinct from a NULL detail message,
and is treated differently by Throwable.printStackTrace.)
Change-Id: I8c65deac9f18c5782dcf6e72e4c37e6dd4174fe9
diff --git a/src/java_lang_reflect_Field.cc b/src/java_lang_reflect_Field.cc
index 185fabc..8e09adb 100644
--- a/src/java_lang_reflect_Field.cc
+++ b/src/java_lang_reflect_Field.cc
@@ -66,7 +66,7 @@
// Never okay.
break;
}
- Thread::Current()->ThrowNewException("Ljava/lang/IllegalArgumentException;",
+ Thread::Current()->ThrowNewExceptionF("Ljava/lang/IllegalArgumentException;",
"Not a primitive field: %s", PrettyField(f).c_str());
return false;
}
@@ -165,7 +165,7 @@
// Else fall through to report an error.
case Class::kPrimVoid:
// Never okay.
- Thread::Current()->ThrowNewException("Ljava/lang/IllegalArgumentException;",
+ Thread::Current()->ThrowNewExceptionF("Ljava/lang/IllegalArgumentException;",
"Not a primitive field: %s", PrettyField(f).c_str());
return;
}