< prev index next >
test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetLocalVariable/setlocal002/setlocal002.cpp
Print this page
rev 51716 : 8210665: Clean up JNI_ENV_ARG and factorize the macros for vmTestbase/jvmti[R-U] tests
Summary: Remove JNI_ENV macros from the tests
Reviewed-by:
@@ -25,25 +25,12 @@
#include <string.h>
#include "jvmti.h"
#include "agent_common.h"
#include "JVMTITools.h"
-#ifdef __cplusplus
extern "C" {
-#endif
-
-#ifndef JNI_ENV_ARG
-
-#ifdef __cplusplus
-#define JNI_ENV_ARG(x, y) y
-#define JNI_ENV_PTR(x) x
-#else
-#define JNI_ENV_ARG(x,y) x, y
-#define JNI_ENV_PTR(x) (*x)
-#endif
-#endif
#define PASSED 0
#define STATUS_FAILED 2
static jvmtiEnv *jvmti = NULL;
@@ -68,12 +55,11 @@
if (options != NULL && strcmp(options, "printdump") == 0) {
printdump = JNI_TRUE;
}
- res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
- JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
}
@@ -120,12 +106,12 @@
if (!caps.can_access_local_variables) {
return result;
}
- mid = JNI_ENV_PTR(env)->GetStaticMethodID(JNI_ENV_ARG(env, cls),
- "run", "([Ljava/lang/String;Ljava/io/PrintStream;)I");
+ mid = env->GetStaticMethodID(
+ cls, "run", "([Ljava/lang/String;Ljava/io/PrintStream;)I");
if (mid == NULL) {
printf("Cannot find method \"run\"\n");
return STATUS_FAILED;
}
@@ -297,8 +283,6 @@
}
return result;
}
-#ifdef __cplusplus
}
-#endif
< prev index next >