8028785: [parfait] warnings from b116 for hotspot.src.share.vm.prims: JNI exception pending

Added JNI exception pending check in several files under src/share/vm/prims directory

Reviewed-by: coleenp, minqi
This commit is contained in:
Calvin Cheung 2014-02-12 12:01:45 -08:00
parent a752b0b503
commit afe8f1c904
4 changed files with 56 additions and 5 deletions

View file

@ -858,6 +858,11 @@ static inline void throw_new(JNIEnv *env, const char *ename) {
strcpy(buf, "java/lang/");
strcat(buf, ename);
jclass cls = env->FindClass(buf);
if (env->ExceptionCheck()) {
env->ExceptionClear();
tty->print_cr("Unsafe: cannot throw %s because FindClass has failed", buf);
return;
}
char* msg = NULL;
env->ThrowNew(cls, msg);
}