8171417: post jigsaw review cleanup in the jtreg jvmti tests
authorsspitsyn
Sun, 18 Dec 2016 20:54:26 -0800
changeset 42868 9c9281518887
parent 42865 b9f19a575020
child 42869 32e49f36d795
8171417: post jigsaw review cleanup in the jtreg jvmti tests Summary: fix the function throw_exc() in several jvmti tests to return void Reviewed-by: dsamersoff, hseigel
hotspot/test/serviceability/jvmti/AddModuleExportsAndOpens/libAddModuleExportsAndOpensTest.c
hotspot/test/serviceability/jvmti/AddModuleReads/libAddModuleReadsTest.c
hotspot/test/serviceability/jvmti/AddModuleUsesAndProvides/libAddModuleUsesAndProvidesTest.c
--- a/hotspot/test/serviceability/jvmti/AddModuleExportsAndOpens/libAddModuleExportsAndOpensTest.c	Sun Dec 18 22:07:31 2016 -0500
+++ b/hotspot/test/serviceability/jvmti/AddModuleExportsAndOpens/libAddModuleExportsAndOpensTest.c	Sun Dec 18 20:54:26 2016 -0800
@@ -82,14 +82,18 @@
 }
 
 static
-jint throw_exc(JNIEnv *env, char *msg) {
+void throw_exc(JNIEnv *env, char *msg) {
     jclass exc_class = JNI_ENV_PTR(env)->FindClass(JNI_ENV_ARG(env, EXC_CNAME));
+    jint rt = JNI_OK;
 
     if (exc_class == NULL) {
         printf("throw_exc: Error in FindClass(env, %s)\n", EXC_CNAME);
-        return -1;
+        return;
     }
-    return JNI_ENV_PTR(env)->ThrowNew(JNI_ENV_ARG(env, exc_class), msg);
+    rt = JNI_ENV_PTR(env)->ThrowNew(JNI_ENV_ARG(env, exc_class), msg);
+    if (rt == JNI_ERR) {
+        printf("throw_exc: Error in JNI ThrowNew(env, %s)\n", msg);
+    }
 }
 
 static
--- a/hotspot/test/serviceability/jvmti/AddModuleReads/libAddModuleReadsTest.c	Sun Dec 18 22:07:31 2016 -0500
+++ b/hotspot/test/serviceability/jvmti/AddModuleReads/libAddModuleReadsTest.c	Sun Dec 18 20:54:26 2016 -0800
@@ -81,14 +81,18 @@
 }
 
 static
-jint throw_exc(JNIEnv *env, char *msg) {
+void throw_exc(JNIEnv *env, char *msg) {
     jclass exc_class = JNI_ENV_PTR(env)->FindClass(JNI_ENV_ARG(env, EXC_CNAME));
+    jint rt = JNI_OK;
 
     if (exc_class == NULL) {
         printf("throw_exc: Error in FindClass(env, %s)\n", EXC_CNAME);
-        return -1;
+        return;
     }
-    return JNI_ENV_PTR(env)->ThrowNew(JNI_ENV_ARG(env, exc_class), msg);
+    rt = JNI_ENV_PTR(env)->ThrowNew(JNI_ENV_ARG(env, exc_class), msg);
+    if (rt == JNI_ERR) {
+        printf("throw_exc: Error in JNI ThrowNew(env, %s)\n", msg);
+    }
 }
 
 static
--- a/hotspot/test/serviceability/jvmti/AddModuleUsesAndProvides/libAddModuleUsesAndProvidesTest.c	Sun Dec 18 22:07:31 2016 -0500
+++ b/hotspot/test/serviceability/jvmti/AddModuleUsesAndProvides/libAddModuleUsesAndProvidesTest.c	Sun Dec 18 20:54:26 2016 -0800
@@ -82,14 +82,18 @@
 }
 
 static
-jint throw_exc(JNIEnv *env, char *msg) {
+void throw_exc(JNIEnv *env, char *msg) {
     jclass exc_class = JNI_ENV_PTR(env)->FindClass(JNI_ENV_ARG(env, EXC_CNAME));
+    jint rt = JNI_OK;
 
     if (exc_class == NULL) {
         printf("throw_exc: Error in FindClass(env, %s)\n", EXC_CNAME);
-        return -1;
+        return;
     }
-    return JNI_ENV_PTR(env)->ThrowNew(JNI_ENV_ARG(env, exc_class), msg);
+    rt = JNI_ENV_PTR(env)->ThrowNew(JNI_ENV_ARG(env, exc_class), msg);
+    if (rt == JNI_ERR) {
+        printf("throw_exc: Error in JNI ThrowNew(env, %s)\n", msg);
+    }
 }
 
 static