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
--- 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