} else if (dvmIsInterfaceClass(clazz)) {
Method* meth = dvmFindInterfaceMethodHierByDescriptor(clazz, name, sig);
if (meth == NULL) {
- dvmThrowExceptionFmt("Ljava/lang/NoSuchMethodError;",
+ dvmThrowExceptionFmtByClass(gDvm.exNoSuchMethodError,
"no method with name='%s' signature='%s' in interface %s",
name, sig, clazz->descriptor);
}
meth = NULL;
}
if (meth == NULL) {
- dvmThrowExceptionFmt("Ljava/lang/NoSuchMethodError;",
+ dvmThrowExceptionFmtByClass(gDvm.exNoSuchMethodError,
"no method with name='%s' signature='%s' in class %s",
name, sig, clazz->descriptor);
} else {
} else {
id = (jfieldID) dvmFindInstanceFieldHier(clazz, name, sig);
if (id == NULL) {
- dvmThrowExceptionFmt("Ljava/lang/NoSuchFieldError;",
+ dvmThrowExceptionFmtByClass(gDvm.exNoSuchFieldError,
"no field with name='%s' signature='%s' in class %s",
name, sig, clazz->descriptor);
}
id = (jmethodID) meth;
if (id == NULL) {
- dvmThrowExceptionFmt("Ljava/lang/NoSuchMethodError;",
+ dvmThrowExceptionFmtByClass(gDvm.exNoSuchMethodError,
"no static method with name='%s' signature='%s' in class %s",
name, sig, clazz->descriptor);
}
} else {
id = (jfieldID) dvmFindStaticField(clazz, name, sig);
if (id == NULL) {
- dvmThrowExceptionFmt("Ljava/lang/NoSuchFieldError;",
+ dvmThrowExceptionFmtByClass(gDvm.exNoSuchFieldError,
"no static field with name='%s' signature='%s' in class %s",
name, sig, clazz->descriptor);
}
int err = errno;
LOGE("Unable to open trace file '%s': %s\n",
traceFileName, strerror(err));
- dvmThrowExceptionFmt("Ljava/lang/RuntimeException;",
+ dvmThrowExceptionFmtByClass(gDvm.exRuntimeException,
"Unable to open trace file '%s': %s",
traceFileName, strerror(err));
goto fail;
int err = errno;
LOGE("trace fwrite(%d) failed: %s\n",
finalCurOffset, strerror(err));
- dvmThrowExceptionFmt("Ljava/lang/RuntimeException;",
+ dvmThrowExceptionFmtByClass(gDvm.exRuntimeException,
"Trace data write failed: %s", strerror(err));
}
}
size_t totalSize = elementSize + headerSize;
if (elementSize >> elementShift != length || totalSize < elementSize) {
char *descriptor = dvmHumanReadableDescriptor(arrayClass->descriptor);
- dvmThrowExceptionFmt("Ljava/lang/OutOfMemoryError;",
+ dvmThrowExceptionFmtByClass(gDvm.exOutOfMemoryError,
"%s of length %zd exceeds the VM limit",
descriptor, length);
free(descriptor);