提交 f18b43e7 编写于 作者: K ksrini

8068033: JNI exception pending in jdk/src/share/bin/java.c

Reviewed-by: mchung, serb
上级 08a34890
/* /*
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -1068,6 +1068,7 @@ JVMInit(InvocationFunctions* ifn, jlong threadStackSize, ...@@ -1068,6 +1068,7 @@ JVMInit(InvocationFunctions* ifn, jlong threadStackSize,
void PostJVMInit(JNIEnv *env, jstring mainClass, JavaVM *vm) { void PostJVMInit(JNIEnv *env, jstring mainClass, JavaVM *vm) {
jvmInstance = vm; jvmInstance = vm;
SetMainClassForAWT(env, mainClass); SetMainClassForAWT(env, mainClass);
CHECK_EXCEPTION_RETURN();
ShowSplashScreen(); ShowSplashScreen();
} }
......
/* /*
* Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -459,6 +459,7 @@ JavaMain(void * _args) ...@@ -459,6 +459,7 @@ JavaMain(void * _args)
* of the application class. * of the application class.
*/ */
PostJVMInit(env, appClass, vm); PostJVMInit(env, appClass, vm);
CHECK_EXCEPTION_LEAVE(1);
/* /*
* The LoadMainClass not only loads the main class, it will also ensure * The LoadMainClass not only loads the main class, it will also ensure
* that the main method's signature is correct, therefore further checking * that the main method's signature is correct, therefore further checking
......
/* /*
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -256,6 +256,13 @@ typedef struct { ...@@ -256,6 +256,13 @@ typedef struct {
#define NULL_CHECK(NC_check_pointer) \ #define NULL_CHECK(NC_check_pointer) \
NULL_CHECK_RETURN_VALUE(NC_check_pointer, ) NULL_CHECK_RETURN_VALUE(NC_check_pointer, )
#define CHECK_EXCEPTION_RETURN() \
do { \
if ((*env)->ExceptionOccurred(env)) { \
return; \
} \
} while (JNI_FALSE)
/* /*
* For JNI calls : * For JNI calls :
* - check for thrown exceptions * - check for thrown exceptions
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册