OpenJDK / jdk / jdk
changeset 42868:9c9281518887
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
author | sspitsyn |
---|---|
date | Sun, 18 Dec 2016 20:54:26 -0800 |
parents | b9f19a575020 |
children | 32e49f36d795 |
files | hotspot/test/serviceability/jvmti/AddModuleExportsAndOpens/libAddModuleExportsAndOpensTest.c hotspot/test/serviceability/jvmti/AddModuleReads/libAddModuleReadsTest.c hotspot/test/serviceability/jvmti/AddModuleUsesAndProvides/libAddModuleUsesAndProvidesTest.c |
diffstat | 3 files changed, 21 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- 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