8039118: Windows build failure (j2pcsc.dll : fatal error unresolved external symbol throwByName)
authorchegar
Wed, 02 Apr 2014 23:23:00 +0100
changeset 23709 9f7652fb03b2
parent 23708 fea03b9ae8af
child 23710 ba5c381e8a4e
child 23711 95fb268275e3
8039118: Windows build failure (j2pcsc.dll : fatal error unresolved external symbol throwByName) Reviewed-by: mullan, mchung, alanb
jdk/src/share/native/sun/security/smartcardio/pcsc.c
--- a/jdk/src/share/native/sun/security/smartcardio/pcsc.c	Wed Apr 02 11:03:10 2014 -0400
+++ b/jdk/src/share/native/sun/security/smartcardio/pcsc.c	Wed Apr 02 23:23:00 2014 +0100
@@ -64,10 +64,12 @@
 
 #define J2PCSC_EXCEPTION_NAME "sun/security/smartcardio/PCSCException"
 
-extern void throwByName(JNIEnv *, const char *, const char *);
+void throwOutOfMemoryError(JNIEnv *env, const char *msg) {
+    jclass cls = (*env)->FindClass(env, "java/lang/OutOfMemoryError");
 
-void throwOutOfMemoryError(JNIEnv *env, const char *msg) {
-    throwByName(env, "java/lang/OutOfMemoryError", msg);
+    if (cls != NULL) /* Otherwise an exception has already been thrown */
+        (*env)->ThrowNew(env, cls, msg);
+
 }
 
 void throwPCSCException(JNIEnv* env, LONG code) {