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/monitor.cc b/src/monitor.cc
index 4e71e45..6bd309d 100644
--- a/src/monitor.cc
+++ b/src/monitor.cc
@@ -367,7 +367,7 @@
}
void ThrowIllegalMonitorStateException(const char* msg) {
- Thread::Current()->ThrowNewException("Ljava/lang/IllegalMonitorStateException;", "%s", msg);
+ Thread::Current()->ThrowNewException("Ljava/lang/IllegalMonitorStateException;", msg);
}
bool Monitor::Unlock(Thread* self) {
@@ -469,7 +469,7 @@
// Enforce the timeout range.
if (ms < 0 || ns < 0 || ns > 999999) {
- Thread::Current()->ThrowNewException("Ljava/lang/IllegalArgumentException;",
+ Thread::Current()->ThrowNewExceptionF("Ljava/lang/IllegalArgumentException;",
"timeout arguments out of range: ms=%lld ns=%d", ms, ns);
return;
}
@@ -582,7 +582,7 @@
*/
self->interrupted_ = false;
if (interruptShouldThrow) {
- Thread::Current()->ThrowNewException("Ljava/lang/InterruptedException;", "%s", "");
+ Thread::Current()->ThrowNewException("Ljava/lang/InterruptedException;", NULL);
}
}
}