mirror of
https://github.com/openjdk/jdk.git
synced 2026-05-12 14:39:49 +00:00
8212884: Remove the assignments in ifs for vmTestbase/[a-s]
Extract assignments from if statements in vmTestbase Reviewed-by: cjplummer, sspitsyn
This commit is contained in:
parent
162e75f4a8
commit
589b596bec
@ -48,12 +48,14 @@ JNIEXPORT jint JNICALL Agent_OnAttach(JavaVM *vm, char *optionsString, void *res
|
||||
Options* options = NULL;
|
||||
const char* agentName;
|
||||
|
||||
if (!NSK_VERIFY((options = (Options*) nsk_aod_createOptions(optionsString)) != NULL))
|
||||
options = (Options*) nsk_aod_createOptions(optionsString);
|
||||
if (!NSK_VERIFY(options != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
agentName = nsk_aod_getOptionValue(options, NSK_AOD_AGENT_NAME_OPTION);
|
||||
|
||||
if ((jni = (JNIEnv*) nsk_aod_createJNIEnv(vm)) == NULL)
|
||||
jni = (JNIEnv*) nsk_aod_createJNIEnv(vm);
|
||||
if (jni == NULL)
|
||||
return JNI_ERR;
|
||||
|
||||
NSK_DISPLAY1("%s: initialization was done\n", agentName);
|
||||
|
||||
@ -73,8 +73,8 @@ int registerNativeMethods(JNIEnv* jni) {
|
||||
{(char*) "agentGotCapabilities", (char*) "()Z", (void*) Java_nsk_jvmti_AttachOnDemand_attach002_attach002Target_agentGotCapabilities}};
|
||||
jint nativeMethodsNumber = 1;
|
||||
|
||||
if (!NSK_JNI_VERIFY(jni, (appClass =
|
||||
jni->FindClass(ATTACH002_TARGET_APP_CLASS_NAME)) != NULL)) {
|
||||
appClass = jni->FindClass(ATTACH002_TARGET_APP_CLASS_NAME);
|
||||
if (!NSK_JNI_VERIFY(jni, appClass != NULL)) {
|
||||
return NSK_FALSE;
|
||||
}
|
||||
|
||||
@ -187,15 +187,18 @@ Agent_OnAttach(JavaVM *vm, char *optionsString, void *reserved)
|
||||
jvmtiEnv* jvmti = NULL;
|
||||
JNIEnv* jni = NULL;
|
||||
|
||||
if (!NSK_VERIFY((options = (Options*) nsk_aod_createOptions(optionsString)) != NULL))
|
||||
options = (Options*) nsk_aod_createOptions(optionsString);
|
||||
if (!NSK_VERIFY(options != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
agentName = nsk_aod_getOptionValue(options, NSK_AOD_AGENT_NAME_OPTION);
|
||||
|
||||
if ((jni = (JNIEnv*) nsk_aod_createJNIEnv(vm)) == NULL)
|
||||
jni = (JNIEnv*) nsk_aod_createJNIEnv(vm);
|
||||
if (jni == NULL)
|
||||
return NSK_FALSE;
|
||||
|
||||
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved)) != NULL))
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
if (!NSK_VERIFY(registerNativeMethods(jni))) {
|
||||
|
||||
@ -92,15 +92,18 @@ Agent_OnAttach(JavaVM *vm, char *optionsString, void *reserved)
|
||||
jvmtiEnv* jvmti = NULL;
|
||||
JNIEnv* jni = NULL;
|
||||
|
||||
if (!NSK_VERIFY((options = (Options*) nsk_aod_createOptions(optionsString)) != NULL))
|
||||
options = (Options*) nsk_aod_createOptions(optionsString);
|
||||
if (!NSK_VERIFY(options != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
agentName = nsk_aod_getOptionValue(options, NSK_AOD_AGENT_NAME_OPTION);
|
||||
|
||||
if ((jni = (JNIEnv*) nsk_aod_createJNIEnv(vm)) == NULL)
|
||||
jni = (JNIEnv*) nsk_aod_createJNIEnv(vm);
|
||||
if (jni == NULL)
|
||||
return NSK_FALSE;
|
||||
|
||||
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved)) != NULL))
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
memset(&caps, 0, sizeof(caps));
|
||||
|
||||
@ -110,15 +110,18 @@ Agent_OnAttach(JavaVM *vm, char *optionsString, void *reserved)
|
||||
jvmtiEnv* jvmti = NULL;
|
||||
JNIEnv* jni = NULL;
|
||||
|
||||
if (!NSK_VERIFY((options = (Options*) nsk_aod_createOptions(optionsString)) != NULL))
|
||||
options = (Options*) nsk_aod_createOptions(optionsString);
|
||||
if (!NSK_VERIFY(options != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
agentName = nsk_aod_getOptionValue(options, NSK_AOD_AGENT_NAME_OPTION);
|
||||
|
||||
if ((jni = (JNIEnv*) nsk_aod_createJNIEnv(vm)) == NULL)
|
||||
jni = (JNIEnv*) nsk_aod_createJNIEnv(vm);
|
||||
if (jni == NULL)
|
||||
return NSK_FALSE;
|
||||
|
||||
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved)) != NULL))
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
memset(&caps, 0, sizeof(caps));
|
||||
|
||||
@ -128,15 +128,18 @@ Agent_OnAttach(JavaVM *vm, char *optionsString, void *reserved)
|
||||
jvmtiEventCallbacks eventCallbacks;
|
||||
JNIEnv* jni;
|
||||
|
||||
if (!NSK_VERIFY((options = (Options*) nsk_aod_createOptions(optionsString)) != NULL))
|
||||
options = (Options*) nsk_aod_createOptions(optionsString);
|
||||
if (!NSK_VERIFY(options != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
agentName = nsk_aod_getOptionValue(options, NSK_AOD_AGENT_NAME_OPTION);
|
||||
|
||||
if ((jni = (JNIEnv*) nsk_aod_createJNIEnv(vm)) == NULL)
|
||||
jni = (JNIEnv*) nsk_aod_createJNIEnv(vm);
|
||||
if (jni == NULL)
|
||||
return NSK_FALSE;
|
||||
|
||||
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved)) != NULL))
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
memset(&eventCallbacks,0, sizeof(eventCallbacks));
|
||||
|
||||
@ -54,15 +54,18 @@ Agent_OnAttach(JavaVM *vm, char *optionsString, void *reserved)
|
||||
const char* agentName;
|
||||
jvmtiCapabilities caps;
|
||||
|
||||
if (!NSK_VERIFY((options = (Options*) nsk_aod_createOptions(optionsString)) != NULL))
|
||||
options = (Options*) nsk_aod_createOptions(optionsString);
|
||||
if (!NSK_VERIFY(options != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
agentName = nsk_aod_getOptionValue(options, NSK_AOD_AGENT_NAME_OPTION);
|
||||
|
||||
if ((jni = (JNIEnv*) nsk_aod_createJNIEnv(vm)) == NULL)
|
||||
jni = (JNIEnv*) nsk_aod_createJNIEnv(vm);
|
||||
if (jni == NULL)
|
||||
return NSK_FALSE;
|
||||
|
||||
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved)) != NULL))
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->GetPotentialCapabilities(&caps))) {
|
||||
|
||||
@ -91,15 +91,18 @@ Agent_OnAttach(JavaVM *vm, char *optionsString, void *reserved)
|
||||
jvmtiEnv* jvmti = NULL;
|
||||
JNIEnv* jni = NULL;
|
||||
|
||||
if (!NSK_VERIFY((options = (Options*) nsk_aod_createOptions(optionsString)) != NULL))
|
||||
options = (Options*) nsk_aod_createOptions(optionsString);
|
||||
if (!NSK_VERIFY(options != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
agentName = nsk_aod_getOptionValue(options, NSK_AOD_AGENT_NAME_OPTION);
|
||||
|
||||
if ((jni = (JNIEnv*) nsk_aod_createJNIEnv(vm)) == NULL)
|
||||
jni = (JNIEnv*) nsk_aod_createJNIEnv(vm);
|
||||
if (jni == NULL)
|
||||
return NSK_FALSE;
|
||||
|
||||
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved)) != NULL))
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
memset(&eventCallbacks,0, sizeof(eventCallbacks));
|
||||
|
||||
@ -84,15 +84,18 @@ Agent_OnAttach(JavaVM *vm, char *optionsString, void *reserved)
|
||||
jvmtiEnv* jvmti = NULL;
|
||||
JNIEnv* jni = NULL;
|
||||
|
||||
if (!NSK_VERIFY((options = (Options*) nsk_aod_createOptions(optionsString)) != NULL))
|
||||
options = (Options*) nsk_aod_createOptions(optionsString);
|
||||
if (!NSK_VERIFY(options != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
agentName = nsk_aod_getOptionValue(options, NSK_AOD_AGENT_NAME_OPTION);
|
||||
|
||||
if ((jni = (JNIEnv*) nsk_aod_createJNIEnv(vm)) == NULL)
|
||||
jni = (JNIEnv*) nsk_aod_createJNIEnv(vm);
|
||||
if (jni == NULL)
|
||||
return NSK_FALSE;
|
||||
|
||||
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved)) != NULL))
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
memset(&eventCallbacks,0, sizeof(eventCallbacks));
|
||||
|
||||
@ -84,15 +84,18 @@ Agent_OnAttach(JavaVM *vm, char *optionsString, void *reserved)
|
||||
jvmtiEnv* jvmti = NULL;
|
||||
JNIEnv* jni = NULL;
|
||||
|
||||
if (!NSK_VERIFY((options = (Options*) nsk_aod_createOptions(optionsString)) != NULL))
|
||||
options = (Options*) nsk_aod_createOptions(optionsString);
|
||||
if (!NSK_VERIFY(options != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
agentName = nsk_aod_getOptionValue(options, NSK_AOD_AGENT_NAME_OPTION);
|
||||
|
||||
if ((jni = (JNIEnv*) nsk_aod_createJNIEnv(vm)) == NULL)
|
||||
jni = (JNIEnv*) nsk_aod_createJNIEnv(vm);
|
||||
if (jni == NULL)
|
||||
return JNI_ERR;
|
||||
|
||||
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved)) != NULL))
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
memset(&eventCallbacks,0, sizeof(eventCallbacks));
|
||||
|
||||
@ -115,7 +115,8 @@ void JNICALL auxiliaryThreadFunction(jvmtiEnv* jvmti, JNIEnv* jni, void* arg) {
|
||||
int startAuxiliaryThread(jvmtiEnv* jvmti, JNIEnv* jni) {
|
||||
jthread thread;
|
||||
|
||||
if (!NSK_VERIFY((thread = nsk_jvmti_aod_createThread(jni)) != NULL))
|
||||
thread = nsk_jvmti_aod_createThread(jni);
|
||||
if (!NSK_VERIFY(thread != NULL))
|
||||
return NSK_FALSE;
|
||||
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->RunAgentThread(thread, auxiliaryThreadFunction, NULL, JVMTI_THREAD_NORM_PRIORITY))) {
|
||||
@ -145,15 +146,18 @@ Agent_OnAttach(JavaVM *vm, char *optionsString, void *reserved)
|
||||
jvmtiCapabilities caps;
|
||||
JNIEnv* jni;
|
||||
|
||||
if (!NSK_VERIFY((options = (Options*) nsk_aod_createOptions(optionsString)) != NULL))
|
||||
options = (Options*) nsk_aod_createOptions(optionsString);
|
||||
if (!NSK_VERIFY(options != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
agentName = nsk_aod_getOptionValue(options, NSK_AOD_AGENT_NAME_OPTION);
|
||||
|
||||
if ((jni = (JNIEnv*) nsk_aod_createJNIEnv(vm)) == NULL)
|
||||
jni = (JNIEnv*) nsk_aod_createJNIEnv(vm);
|
||||
if (jni == NULL)
|
||||
return JNI_ERR;
|
||||
|
||||
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved)) != NULL))
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("GCFinishMonitor", &gcFinishMonitor))) {
|
||||
|
||||
@ -94,8 +94,8 @@ int registerNativeMethods(JNIEnv* jni) {
|
||||
{(char*) "shutdownAgent", (char*) "()V", (void*) Java_nsk_jvmti_AttachOnDemand_attach021_attach021Target_shutdownAgent}};
|
||||
jint nativeMethodsNumber = 2;
|
||||
|
||||
if (!NSK_JNI_VERIFY(jni, (appClass =
|
||||
jni->FindClass(ATTACH021_TARGET_APP_CLASS_NAME)) != NULL)) {
|
||||
appClass = jni->FindClass(ATTACH021_TARGET_APP_CLASS_NAME);
|
||||
if (!NSK_JNI_VERIFY(jni, appClass != NULL)) {
|
||||
return NSK_FALSE;
|
||||
}
|
||||
|
||||
@ -124,15 +124,18 @@ Agent_OnAttach(JavaVM *vm, char *optionsString, void *reserved)
|
||||
jvmtiCapabilities caps;
|
||||
JNIEnv* jni;
|
||||
|
||||
if (!NSK_VERIFY((options = (Options*) nsk_aod_createOptions(optionsString)) != NULL))
|
||||
options = (Options*) nsk_aod_createOptions(optionsString);
|
||||
if (!NSK_VERIFY(options != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
agentName = nsk_aod_getOptionValue(options, NSK_AOD_AGENT_NAME_OPTION);
|
||||
|
||||
if ((jni = (JNIEnv*) nsk_aod_createJNIEnv(vm)) == NULL)
|
||||
jni = (JNIEnv*) nsk_aod_createJNIEnv(vm);
|
||||
if (jni == NULL)
|
||||
return JNI_ERR;
|
||||
|
||||
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved)) != NULL))
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
if (!NSK_VERIFY(registerNativeMethods(jni))) {
|
||||
|
||||
@ -104,8 +104,8 @@ int registerNativeMethods(JNIEnv* jni) {
|
||||
(void*) Java_nsk_jvmti_AttachOnDemand_attach022_attach022Target_shutdownAgent}};
|
||||
jint nativeMethodsNumber = 1;
|
||||
|
||||
if (!NSK_JNI_VERIFY(jni, (appClass =
|
||||
jni->FindClass(ATTACH022_TARGET_APP_CLASS_NAME)) != NULL)) {
|
||||
appClass = jni->FindClass(ATTACH022_TARGET_APP_CLASS_NAME);
|
||||
if (!NSK_JNI_VERIFY(jni, appClass != NULL)) {
|
||||
return NSK_FALSE;
|
||||
}
|
||||
|
||||
@ -176,15 +176,18 @@ Agent_OnAttach(JavaVM *vm, char *optionsString, void *reserved)
|
||||
jvmtiCapabilities caps;
|
||||
JNIEnv* jni;
|
||||
|
||||
if (!NSK_VERIFY((options = (Options*) nsk_aod_createOptions(optionsString)) != NULL))
|
||||
options = (Options*) nsk_aod_createOptions(optionsString);
|
||||
if (!NSK_VERIFY(options != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
agentName = nsk_aod_getOptionValue(options, NSK_AOD_AGENT_NAME_OPTION);
|
||||
|
||||
if ((jni = (JNIEnv*) nsk_aod_createJNIEnv(vm)) == NULL)
|
||||
jni = (JNIEnv*) nsk_aod_createJNIEnv(vm);
|
||||
if (jni == NULL)
|
||||
return JNI_ERR;
|
||||
|
||||
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved)) != NULL))
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
if (!NSK_VERIFY(registerNativeMethods(jni))) {
|
||||
|
||||
@ -109,15 +109,18 @@ Agent_OnAttach(JavaVM *vm, char *optionsString, void *reserved)
|
||||
jvmtiEnv* jvmti;
|
||||
JNIEnv* jni;
|
||||
|
||||
if (!NSK_VERIFY((options = (Options*) nsk_aod_createOptions(optionsString)) != NULL))
|
||||
options = (Options*) nsk_aod_createOptions(optionsString);
|
||||
if (!NSK_VERIFY(options != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
agentName = nsk_aod_getOptionValue(options, NSK_AOD_AGENT_NAME_OPTION);
|
||||
|
||||
if ((jni = (JNIEnv*) nsk_aod_createJNIEnv(vm)) == NULL)
|
||||
jni = (JNIEnv*) nsk_aod_createJNIEnv(vm);
|
||||
if (jni == NULL)
|
||||
return JNI_ERR;
|
||||
|
||||
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved)) != NULL))
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
memset(&caps, 0, sizeof(caps));
|
||||
|
||||
@ -105,15 +105,18 @@ Agent_OnAttach(JavaVM *vm, char *optionsString, void *reserved)
|
||||
jvmtiEnv* jvmti;
|
||||
JNIEnv* jni;
|
||||
|
||||
if (!NSK_VERIFY((options = (Options*) nsk_aod_createOptions(optionsString)) != NULL))
|
||||
options = (Options*) nsk_aod_createOptions(optionsString);
|
||||
if (!NSK_VERIFY(options != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
agentName = nsk_aod_getOptionValue(options, NSK_AOD_AGENT_NAME_OPTION);
|
||||
|
||||
if ((jni = (JNIEnv*) nsk_aod_createJNIEnv(vm)) == NULL)
|
||||
jni = (JNIEnv*) nsk_aod_createJNIEnv(vm);
|
||||
if (jni == NULL)
|
||||
return JNI_ERR;
|
||||
|
||||
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved)) != NULL))
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
memset(&eventCallbacks,0, sizeof(eventCallbacks));
|
||||
|
||||
@ -65,7 +65,8 @@ void JNICALL startedThreadFunction(jvmtiEnv* jvmti, JNIEnv* jni, void* arg) {
|
||||
int startNewThread(jvmtiEnv* jvmti, JNIEnv* jni) {
|
||||
jthread thread;
|
||||
|
||||
if (!NSK_VERIFY((thread = nsk_jvmti_aod_createThreadWithName(jni, STARTED_THREAD_NAME)) != NULL))
|
||||
thread = nsk_jvmti_aod_createThreadWithName(jni, STARTED_THREAD_NAME);
|
||||
if (!NSK_VERIFY(thread != NULL))
|
||||
return NSK_FALSE;
|
||||
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->RunAgentThread(thread, startedThreadFunction, NULL, JVMTI_THREAD_NORM_PRIORITY))) {
|
||||
@ -140,15 +141,18 @@ Agent_OnAttach(JavaVM *vm, char *optionsString, void *reserved)
|
||||
jvmtiEnv* jvmti;
|
||||
JNIEnv* jni;
|
||||
|
||||
if (!NSK_VERIFY((options = (Options*) nsk_aod_createOptions(optionsString)) != NULL))
|
||||
options = (Options*) nsk_aod_createOptions(optionsString);
|
||||
if (!NSK_VERIFY(options != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
agentName = nsk_aod_getOptionValue(options, NSK_AOD_AGENT_NAME_OPTION);
|
||||
|
||||
if ((jni = (JNIEnv*) nsk_aod_createJNIEnv(vm)) == NULL)
|
||||
jni = (JNIEnv*) nsk_aod_createJNIEnv(vm);
|
||||
if (jni == NULL)
|
||||
return JNI_ERR;
|
||||
|
||||
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved)) != NULL))
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
memset(&eventCallbacks,0, sizeof(eventCallbacks));
|
||||
|
||||
@ -133,15 +133,18 @@ Agent_OnAttach(JavaVM *vm, char *optionsString, void *reserved)
|
||||
jvmtiEnv* jvmti;
|
||||
JNIEnv* jni;
|
||||
|
||||
if (!NSK_VERIFY((options = (Options*) nsk_aod_createOptions(optionsString)) != NULL))
|
||||
options = (Options*) nsk_aod_createOptions(optionsString);
|
||||
if (!NSK_VERIFY(options != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
agentName = nsk_aod_getOptionValue(options, NSK_AOD_AGENT_NAME_OPTION);
|
||||
|
||||
if ((jni = (JNIEnv*) nsk_aod_createJNIEnv(vm)) == NULL)
|
||||
jni = (JNIEnv*) nsk_aod_createJNIEnv(vm);
|
||||
if (jni == NULL)
|
||||
return JNI_ERR;
|
||||
|
||||
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved)) != NULL))
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("threadsCounterMonitor", &threadsCounterMonitor))) {
|
||||
|
||||
@ -159,15 +159,18 @@ Agent_OnAttach(JavaVM *vm, char *optionsString, void *reserved)
|
||||
jvmtiEnv* jvmti;
|
||||
JNIEnv* jni;
|
||||
|
||||
if (!NSK_VERIFY((options = (Options*) nsk_aod_createOptions(optionsString)) != NULL))
|
||||
options = (Options*) nsk_aod_createOptions(optionsString);
|
||||
if (!NSK_VERIFY(options != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
agentName = nsk_aod_getOptionValue(options, NSK_AOD_AGENT_NAME_OPTION);
|
||||
|
||||
if ((jni = (JNIEnv*) nsk_aod_createJNIEnv(vm)) == NULL)
|
||||
jni = (JNIEnv*) nsk_aod_createJNIEnv(vm);
|
||||
if (jni == NULL)
|
||||
return JNI_ERR;
|
||||
|
||||
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved)) != NULL))
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
memset(&eventCallbacks,0, sizeof(eventCallbacks));
|
||||
|
||||
@ -123,15 +123,18 @@ Agent_OnAttach(JavaVM *vm, char *optionsString, void *reserved)
|
||||
jvmtiEnv* jvmti;
|
||||
JNIEnv* jni;
|
||||
|
||||
if (!NSK_VERIFY((options = (Options*) nsk_aod_createOptions(optionsString)) != NULL))
|
||||
options = (Options*) nsk_aod_createOptions(optionsString);
|
||||
if (!NSK_VERIFY(options != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
agentName = nsk_aod_getOptionValue(options, NSK_AOD_AGENT_NAME_OPTION);
|
||||
|
||||
if ((jni = (JNIEnv*) nsk_aod_createJNIEnv(vm)) == NULL)
|
||||
jni = (JNIEnv*) nsk_aod_createJNIEnv(vm);
|
||||
if (jni == NULL)
|
||||
return JNI_ERR;
|
||||
|
||||
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved)) != NULL))
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
memset(&eventCallbacks,0, sizeof(eventCallbacks));
|
||||
|
||||
@ -97,15 +97,18 @@ Agent_OnAttach(JavaVM *vm, char *optionsString, void *reserved)
|
||||
jvmtiEnv* jvmti;
|
||||
JNIEnv* jni;
|
||||
|
||||
if (!NSK_VERIFY((options = (Options*) nsk_aod_createOptions(optionsString)) != NULL))
|
||||
options = (Options*) nsk_aod_createOptions(optionsString);
|
||||
if (!NSK_VERIFY(options != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
agentName = nsk_aod_getOptionValue(options, NSK_AOD_AGENT_NAME_OPTION);
|
||||
|
||||
if ((jni = (JNIEnv*) nsk_aod_createJNIEnv(vm)) == NULL)
|
||||
jni = (JNIEnv*) nsk_aod_createJNIEnv(vm);
|
||||
if (jni == NULL)
|
||||
return JNI_ERR;
|
||||
|
||||
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved)) != NULL))
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("attach045-agent00-eventsCounterMonitor", &eventsCounterMonitor))) {
|
||||
|
||||
@ -108,15 +108,18 @@ Agent_OnAttach(JavaVM *vm, char *optionsString, void *reserved)
|
||||
jvmtiEnv* jvmti;
|
||||
JNIEnv* jni;
|
||||
|
||||
if (!NSK_VERIFY((options = (Options*) nsk_aod_createOptions(optionsString)) != NULL))
|
||||
options = (Options*) nsk_aod_createOptions(optionsString);
|
||||
if (!NSK_VERIFY(options != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
agentName = nsk_aod_getOptionValue(options, NSK_AOD_AGENT_NAME_OPTION);
|
||||
|
||||
if ((jni = (JNIEnv*) nsk_aod_createJNIEnv(vm)) == NULL)
|
||||
jni = (JNIEnv*) nsk_aod_createJNIEnv(vm);
|
||||
if (jni == NULL)
|
||||
return JNI_ERR;
|
||||
|
||||
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved)) != NULL))
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("attach045-agent01-eventsCounterMonitor", &eventsCounterMonitor))) {
|
||||
|
||||
@ -128,15 +128,18 @@ Agent_OnAttach(JavaVM *vm, char *optionsString, void *reserved)
|
||||
jvmtiEnv* jvmti;
|
||||
JNIEnv* jni;
|
||||
|
||||
if (!NSK_VERIFY((options = (Options*) nsk_aod_createOptions(optionsString)) != NULL))
|
||||
options = (Options*) nsk_aod_createOptions(optionsString);
|
||||
if (!NSK_VERIFY(options != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
agentName = nsk_aod_getOptionValue(options, NSK_AOD_AGENT_NAME_OPTION);
|
||||
|
||||
if ((jni = (JNIEnv*) nsk_aod_createJNIEnv(vm)) == NULL)
|
||||
jni = (JNIEnv*) nsk_aod_createJNIEnv(vm);
|
||||
if (jni == NULL)
|
||||
return JNI_ERR;
|
||||
|
||||
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved)) != NULL))
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("attach045-agent02-eventsCounterMonitor", &eventsCounterMonitor))) {
|
||||
|
||||
@ -118,15 +118,18 @@ Agent_OnAttach(JavaVM *vm, char *optionsString, void *reserved)
|
||||
jvmtiCapabilities caps;
|
||||
JNIEnv* jni;
|
||||
|
||||
if (!NSK_VERIFY((options = (Options*) nsk_aod_createOptions(optionsString)) != NULL))
|
||||
options = (Options*) nsk_aod_createOptions(optionsString);
|
||||
if (!NSK_VERIFY(options != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
agentName = nsk_aod_getOptionValue(options, NSK_AOD_AGENT_NAME_OPTION);
|
||||
|
||||
if ((jni = (JNIEnv*) nsk_aod_createJNIEnv(vm)) == NULL)
|
||||
jni = (JNIEnv*) nsk_aod_createJNIEnv(vm);
|
||||
if (jni == NULL)
|
||||
return JNI_ERR;
|
||||
|
||||
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved)) != NULL))
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("attach045-agent03-eventsCounterMonitor", &eventsCounterMonitor))) {
|
||||
|
||||
@ -51,7 +51,8 @@ void JNICALL classLoadHandler(
|
||||
const char* agentName;
|
||||
Options* options;
|
||||
|
||||
if (!NSK_VERIFY((options = nsk_jvmti_aod_getMultiagentsOptions(jvmti)) != NULL)) {
|
||||
options = nsk_jvmti_aod_getMultiagentsOptions(jvmti);
|
||||
if (!NSK_VERIFY(options != NULL)) {
|
||||
NSK_COMPLAIN0("Failed to get agents's options\n");
|
||||
nsk_jvmti_aod_disableEvent(jvmti, JVMTI_EVENT_CLASS_LOAD);
|
||||
// can't call nsk_aod_agentFinished because of without options can't get agent's name
|
||||
@ -100,15 +101,18 @@ Agent_OnAttach(JavaVM *vm, char *optionsString, void *reserved)
|
||||
Options* options;
|
||||
const char* agentName;
|
||||
|
||||
if (!NSK_VERIFY((options = (Options*) nsk_aod_createOptions(optionsString)) != NULL))
|
||||
options = (Options*) nsk_aod_createOptions(optionsString);
|
||||
if (!NSK_VERIFY(options != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
agentName = nsk_aod_getOptionValue(options, NSK_AOD_AGENT_NAME_OPTION);
|
||||
|
||||
if ((jni = (JNIEnv*) nsk_aod_createJNIEnv(vm)) == NULL)
|
||||
jni = (JNIEnv*) nsk_aod_createJNIEnv(vm);
|
||||
if (jni == NULL)
|
||||
return NSK_FALSE;
|
||||
|
||||
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved)) != NULL))
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
memset(&caps, 0, sizeof(caps));
|
||||
|
||||
@ -58,15 +58,18 @@ Agent_OnAttach(JavaVM *vm, char *optionsString, void *reserved)
|
||||
Options* options = NULL;
|
||||
const char* agentName;
|
||||
|
||||
if (!NSK_VERIFY((options = (Options*) nsk_aod_createOptions(optionsString)) != NULL))
|
||||
options = (Options*) nsk_aod_createOptions(optionsString);
|
||||
if (!NSK_VERIFY(options != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
agentName = nsk_aod_getOptionValue(options, NSK_AOD_AGENT_NAME_OPTION);
|
||||
|
||||
if ((jni = (JNIEnv*) nsk_aod_createJNIEnv(vm)) == NULL)
|
||||
jni = (JNIEnv*) nsk_aod_createJNIEnv(vm);
|
||||
if (jni == NULL)
|
||||
return JNI_ERR;
|
||||
|
||||
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved)) != NULL))
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
NSK_DISPLAY1("%s: initialization was done\n", agentName);
|
||||
|
||||
@ -54,15 +54,18 @@ Agent_OnAttach(JavaVM *vm, char *optionsString, void *reserved)
|
||||
Options* options = NULL;
|
||||
const char* agentName;
|
||||
|
||||
if (!NSK_VERIFY((options = (Options*) nsk_aod_createOptions(optionsString)) != NULL))
|
||||
options = (Options*) nsk_aod_createOptions(optionsString);
|
||||
if (!NSK_VERIFY(options != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
agentName = nsk_aod_getOptionValue(options, NSK_AOD_AGENT_NAME_OPTION);
|
||||
|
||||
if ((jni = (JNIEnv*) nsk_aod_createJNIEnv(vm)) == NULL)
|
||||
jni = (JNIEnv*) nsk_aod_createJNIEnv(vm);
|
||||
if (jni == NULL)
|
||||
return JNI_ERR;
|
||||
|
||||
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved)) != NULL))
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
NSK_DISPLAY1("%s: initialization was done\n", agentName);
|
||||
|
||||
@ -126,7 +126,8 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
|
||||
jvmtiCapabilities caps;
|
||||
jvmtiEventCallbacks event_callbacks;
|
||||
|
||||
if(!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved)) != NULL)) {
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL)) {
|
||||
return JNI_ERR;
|
||||
}
|
||||
|
||||
|
||||
@ -585,7 +585,8 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
|
||||
jvmtiCapabilities caps;
|
||||
jvmtiEventCallbacks event_callbacks;
|
||||
|
||||
if(!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved)) != NULL)) {
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL)) {
|
||||
return JNI_ERR;
|
||||
}
|
||||
|
||||
|
||||
@ -268,7 +268,8 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
|
||||
jvmtiCapabilities caps;
|
||||
jvmtiEventCallbacks event_callbacks;
|
||||
|
||||
if(!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved)) != NULL)) {
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL)) {
|
||||
return JNI_ERR;
|
||||
}
|
||||
|
||||
|
||||
@ -529,7 +529,8 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
|
||||
jvmtiEventCallbacks event_callbacks;
|
||||
const char *type;
|
||||
|
||||
if(!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved)) != NULL)) {
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL)) {
|
||||
return JNI_ERR;
|
||||
}
|
||||
|
||||
|
||||
@ -208,7 +208,8 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
|
||||
jvmtiCapabilities caps;
|
||||
jvmtiEventCallbacks event_callbacks;
|
||||
|
||||
if(!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved)) != NULL)) {
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL)) {
|
||||
return JNI_ERR;
|
||||
}
|
||||
|
||||
|
||||
@ -144,7 +144,8 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
|
||||
|
||||
timeout = nsk_jvmti_getWaitTime() * 60 * 1000;
|
||||
|
||||
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved)) != NULL))
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
if (!setCallBacks()) {
|
||||
|
||||
@ -339,17 +339,20 @@ static jthread newThreadObj(JNIEnv* jni) {
|
||||
jmethodID cid;
|
||||
jthread result = NULL;
|
||||
|
||||
if (!NSK_JNI_VERIFY(jni, (thrClass = jni->FindClass("java/lang/Thread")) != NULL)) {
|
||||
thrClass = jni->FindClass("java/lang/Thread");
|
||||
if (!NSK_JNI_VERIFY(jni, thrClass != NULL)) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
return result;
|
||||
}
|
||||
|
||||
if (!NSK_JNI_VERIFY(jni, (cid = jni->GetMethodID(thrClass, "<init>", "()V")) != NULL)) {
|
||||
cid = jni->GetMethodID(thrClass, "<init>", "()V");
|
||||
if (!NSK_JNI_VERIFY(jni, cid != NULL)) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
return result;
|
||||
}
|
||||
|
||||
if (!NSK_JNI_VERIFY(jni, (result = jni->NewObject(thrClass, cid)) != NULL)) {
|
||||
result = jni->NewObject(thrClass, cid);
|
||||
if (!NSK_JNI_VERIFY(jni, result != NULL)) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
return result;
|
||||
}
|
||||
@ -366,7 +369,8 @@ static int prepareToIteration (JNIEnv* jni) {
|
||||
setCounter(&iterationCount, 0);
|
||||
setCounter(&objectCount, 0);
|
||||
|
||||
if (!NSK_VERIFY((threadObj = newThreadObj(jni)) != NULL)) {
|
||||
threadObj = newThreadObj(jni);
|
||||
if (!NSK_VERIFY(threadObj != NULL)) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
return NSK_FALSE;
|
||||
}
|
||||
@ -511,8 +515,8 @@ Java_nsk_jvmti_scenarios_allocation_AP04_ap04t003_runIterateOverObjectsReachable
|
||||
int modified = 0;
|
||||
int found = 0;
|
||||
|
||||
if (!NSK_JNI_VERIFY(jni, (root =
|
||||
jni->GetStaticObjectField(debugeeClass, rootFieldID)) != NULL)) {
|
||||
root = jni->GetStaticObjectField(debugeeClass, rootFieldID);
|
||||
if (!NSK_JNI_VERIFY(jni, root != NULL)) {
|
||||
NSK_COMPLAIN0("GetStaticObjectField returned NULL for 'root' field value\n\n");
|
||||
nsk_jvmti_setFailStatus();
|
||||
return;
|
||||
@ -556,12 +560,13 @@ agentProc(jvmtiEnv* jvmti, JNIEnv* jni, void* arg) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!NSK_JNI_VERIFY(jni, (debugeeClass = (jclass)jni->NewGlobalRef(debugeeClass)) != NULL))
|
||||
debugeeClass = (jclass) jni->NewGlobalRef(debugeeClass);
|
||||
if (!NSK_JNI_VERIFY(jni, debugeeClass != NULL))
|
||||
return;
|
||||
|
||||
NSK_DISPLAY1("Find ID of 'root' field: %s\n", ROOT_SIGNATURE);
|
||||
if (!NSK_JNI_VERIFY(jni, (rootFieldID =
|
||||
jni->GetStaticFieldID(debugeeClass, "root", ROOT_SIGNATURE)) != NULL)) {
|
||||
rootFieldID = jni->GetStaticFieldID(debugeeClass, "root", ROOT_SIGNATURE);
|
||||
if (!NSK_JNI_VERIFY(jni, rootFieldID != NULL)) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
return;
|
||||
}
|
||||
@ -602,8 +607,8 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
|
||||
return JNI_ERR;
|
||||
|
||||
/* create JVMTI environment */
|
||||
if (!NSK_VERIFY((jvmti =
|
||||
nsk_jvmti_createJVMTIEnv(jvm, reserved)) != NULL))
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("counterMonitor", &counterMonitor_ptr))) {
|
||||
|
||||
@ -52,14 +52,15 @@ Java_nsk_jvmti_scenarios_bcinstr_BI01_bi01t001_setNewByteCode(JNIEnv *jni_env,
|
||||
jbyte* elements;
|
||||
jboolean isCopy;
|
||||
|
||||
if (!NSK_JNI_VERIFY(jni_env, (newClassSize = jni_env->GetArrayLength(byteCode)) > 0)) {
|
||||
newClassSize = jni_env->GetArrayLength(byteCode);
|
||||
if (!NSK_JNI_VERIFY(jni_env, newClassSize > 0)) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
return NSK_FALSE;
|
||||
}
|
||||
NSK_DISPLAY1("\t... got array size: %d\n", newClassSize);
|
||||
|
||||
if (!NSK_JNI_VERIFY(jni_env, (elements =
|
||||
jni_env->GetByteArrayElements(byteCode, &isCopy)) != NULL)) {
|
||||
elements = jni_env->GetByteArrayElements(byteCode, &isCopy);
|
||||
if (!NSK_JNI_VERIFY(jni_env, elements != NULL)) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
return NSK_FALSE;
|
||||
}
|
||||
@ -94,8 +95,8 @@ JNIEXPORT void JNICALL
|
||||
Java_nsk_jvmti_scenarios_bcinstr_BI01_bi01t001_setClass(JNIEnv *jni_env,
|
||||
jobject o, jclass cls) {
|
||||
|
||||
if (!NSK_JNI_VERIFY(jni_env, (oldClassDef.klass = (jclass)
|
||||
jni_env->NewGlobalRef(cls)) != NULL)) {
|
||||
oldClassDef.klass = (jclass) jni_env->NewGlobalRef(cls);
|
||||
if (!NSK_JNI_VERIFY(jni_env, oldClassDef.klass != NULL)) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
}
|
||||
}
|
||||
@ -242,7 +243,8 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
|
||||
|
||||
timeout = nsk_jvmti_getWaitTime() * 60 * 1000;
|
||||
|
||||
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved)) != NULL))
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
{
|
||||
|
||||
@ -54,14 +54,15 @@ Java_nsk_jvmti_scenarios_bcinstr_BI01_bi01t002_setNewByteCode(JNIEnv *jni_env,
|
||||
jbyte* elements;
|
||||
jboolean isCopy;
|
||||
|
||||
if (!NSK_JNI_VERIFY(jni_env, (newClassSize[ind] = jni_env->GetArrayLength(byteCode)) > 0)) {
|
||||
newClassSize[ind] = jni_env->GetArrayLength(byteCode);
|
||||
if (!NSK_JNI_VERIFY(jni_env, newClassSize[ind] > 0)) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
return NSK_FALSE;
|
||||
}
|
||||
NSK_DISPLAY1("\t... got array size: %d\n", newClassSize[ind]);
|
||||
|
||||
if (!NSK_JNI_VERIFY(jni_env, (elements =
|
||||
jni_env->GetByteArrayElements(byteCode, &isCopy)) != NULL)) {
|
||||
elements = jni_env->GetByteArrayElements(byteCode, &isCopy);
|
||||
if (!NSK_JNI_VERIFY(jni_env, elements != NULL)) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
return NSK_FALSE;
|
||||
}
|
||||
@ -96,8 +97,8 @@ JNIEXPORT void JNICALL
|
||||
Java_nsk_jvmti_scenarios_bcinstr_BI01_bi01t002_setClass(JNIEnv *jni_env,
|
||||
jobject o, jint ind, jclass cls) {
|
||||
|
||||
if (!NSK_JNI_VERIFY(jni_env, (oldClassDef[ind].klass = (jclass)
|
||||
jni_env->NewGlobalRef(cls)) != NULL)) {
|
||||
oldClassDef[ind].klass = (jclass) jni_env->NewGlobalRef(cls);
|
||||
if (!NSK_JNI_VERIFY(jni_env, oldClassDef[ind].klass != NULL)) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
}
|
||||
}
|
||||
@ -255,7 +256,8 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
|
||||
|
||||
timeout = nsk_jvmti_getWaitTime() * 60 * 1000;
|
||||
|
||||
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved)) != NULL))
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
{
|
||||
|
||||
@ -97,13 +97,14 @@ agentProc(jvmtiEnv* jvmti, JNIEnv* jni, void* arg) {
|
||||
return;
|
||||
|
||||
NSK_DISPLAY1("Find class: %s\n", TESTED_CLASS_NAME);
|
||||
if (!NSK_JNI_VERIFY(jni, (classDef.klass = jni->FindClass(TESTED_CLASS_NAME)) != NULL)) {
|
||||
classDef.klass = jni->FindClass(TESTED_CLASS_NAME);
|
||||
if (!NSK_JNI_VERIFY(jni, classDef.klass != NULL)) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!NSK_JNI_VERIFY(jni, (classDef.klass = (jclass)
|
||||
jni->NewGlobalRef(classDef.klass)) != NULL)) {
|
||||
classDef.klass = (jclass) jni->NewGlobalRef(classDef.klass);
|
||||
if (!NSK_JNI_VERIFY(jni, classDef.klass != NULL)) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
return;
|
||||
}
|
||||
@ -150,7 +151,8 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
|
||||
|
||||
timeout = nsk_jvmti_getWaitTime() * 60 * 1000;
|
||||
|
||||
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved)) != NULL))
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
{
|
||||
|
||||
@ -141,7 +141,8 @@ threadEventHandler(jvmtiEvent event, jvmtiEnv* jvmti_env, JNIEnv* jni_env,
|
||||
jvmtiPhase phase;
|
||||
|
||||
|
||||
if (!NSK_JNI_VERIFY(jni_env, (classObject = jni_env->GetObjectClass(thread)) != NULL)) {
|
||||
classObject = jni_env->GetObjectClass(thread);
|
||||
if (!NSK_JNI_VERIFY(jni_env, classObject != NULL)) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
return;
|
||||
}
|
||||
@ -428,7 +429,8 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
|
||||
timeout = nsk_jvmti_getWaitTime() * 60 * 1000;
|
||||
classLoaderCount = nsk_jvmti_findOptionIntValue(CLASS_LOADER_COUNT_PARAM, 10);
|
||||
|
||||
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved)) != NULL))
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("_syncLock", &syncLock))) {
|
||||
|
||||
@ -65,20 +65,21 @@ Java_nsk_jvmti_scenarios_events_EM01_em01t002_loadClass(JNIEnv *jni_env,
|
||||
jmethodID methodID;
|
||||
jclass loadedClass;
|
||||
|
||||
if (!NSK_JNI_VERIFY(jni_env, (klass = jni_env->GetObjectClass(loader)) != NULL)) {
|
||||
klass = jni_env->GetObjectClass(loader);
|
||||
if (!NSK_JNI_VERIFY(jni_env, klass != NULL)) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!NSK_JNI_VERIFY(jni_env,
|
||||
(methodID = jni_env->GetMethodID(
|
||||
klass, "loadClass", "(Ljava/lang/String;)Ljava/lang/Class;")) != NULL)) {
|
||||
methodID = jni_env->GetMethodID(
|
||||
klass, "loadClass", "(Ljava/lang/String;)Ljava/lang/Class;");
|
||||
if (!NSK_JNI_VERIFY(jni_env, methodID != NULL)) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!NSK_JNI_VERIFY(jni_env, (loadedClass = (jclass)
|
||||
jni_env->CallObjectMethod(loader, methodID, className)) != NULL)) {
|
||||
loadedClass = (jclass) jni_env->CallObjectMethod(loader, methodID, className);
|
||||
if (!NSK_JNI_VERIFY(jni_env, loadedClass != NULL)) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
return NULL;
|
||||
}
|
||||
@ -96,8 +97,8 @@ Java_nsk_jvmti_scenarios_events_EM01_em01t002_prepareClass(JNIEnv *jni_env,
|
||||
jobject o, jclass klass) {
|
||||
jfieldID fieldID;
|
||||
|
||||
if (!NSK_JNI_VERIFY(jni_env, (fieldID =
|
||||
jni_env->GetStaticFieldID(klass, "toProvokePreparation", "I")) != NULL)) {
|
||||
fieldID = jni_env->GetStaticFieldID(klass, "toProvokePreparation", "I");
|
||||
if (!NSK_JNI_VERIFY(jni_env, fieldID != NULL)) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
return NSK_FALSE;
|
||||
}
|
||||
@ -116,13 +117,14 @@ Java_nsk_jvmti_scenarios_events_EM01_em01t002_startThread(JNIEnv *jni_env,
|
||||
jclass klass;
|
||||
jmethodID methodID;
|
||||
|
||||
if (!NSK_JNI_VERIFY(jni_env, (klass = jni_env->GetObjectClass(thread)) != NULL)) {
|
||||
klass = jni_env->GetObjectClass(thread);
|
||||
if (!NSK_JNI_VERIFY(jni_env, klass != NULL)) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
return NSK_FALSE;
|
||||
}
|
||||
|
||||
if (!NSK_JNI_VERIFY(jni_env, (methodID =
|
||||
jni_env->GetMethodID(klass, "start", "()V")) != NULL)) {
|
||||
methodID = jni_env->GetMethodID(klass, "start", "()V");
|
||||
if (!NSK_JNI_VERIFY(jni_env, methodID != NULL)) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
return NSK_FALSE;
|
||||
}
|
||||
@ -228,7 +230,8 @@ threadEventHandler(jvmtiEvent event, jvmtiEnv* jvmti_env, JNIEnv* jni_env,
|
||||
jvmtiPhase phase;
|
||||
|
||||
|
||||
if (!NSK_JNI_VERIFY(jni_env, (classObject = jni_env->GetObjectClass(thread)) != NULL)) {
|
||||
classObject = jni_env->GetObjectClass(thread);
|
||||
if (!NSK_JNI_VERIFY(jni_env, classObject != NULL)) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
return;
|
||||
}
|
||||
@ -521,7 +524,8 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
|
||||
timeout = nsk_jvmti_getWaitTime() * 60 * 1000;
|
||||
classLoaderCount = nsk_jvmti_findOptionIntValue(CLASS_LOADER_COUNT_PARAM, 10);
|
||||
|
||||
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved)) != NULL))
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("_syncLock", &syncLock))) {
|
||||
|
||||
@ -105,11 +105,12 @@ getStaticObjField(const char* className, const char* objFieldName,
|
||||
jfieldID fieldID;
|
||||
jclass klass = NULL;
|
||||
|
||||
if (!NSK_JNI_VERIFY(jni, (klass = jni->FindClass(className)) != NULL))
|
||||
klass = jni->FindClass(className);
|
||||
if (!NSK_JNI_VERIFY(jni, klass != NULL))
|
||||
return NULL;
|
||||
|
||||
if (!NSK_JNI_VERIFY(jni, (fieldID =
|
||||
jni->GetStaticFieldID(klass, objFieldName, signature)) != NULL))
|
||||
fieldID = jni->GetStaticFieldID(klass, objFieldName, signature);
|
||||
if (!NSK_JNI_VERIFY(jni, fieldID != NULL))
|
||||
return NULL;
|
||||
|
||||
return jni->GetStaticObjectField(klass, fieldID);
|
||||
@ -119,42 +120,46 @@ getStaticObjField(const char* className, const char* objFieldName,
|
||||
|
||||
static int prepare() {
|
||||
|
||||
if (!NSK_VERIFY((mainThread = findThread(MAIN_THREAD_NAME))!= NULL)) {
|
||||
mainThread = findThread(MAIN_THREAD_NAME);
|
||||
if (!NSK_VERIFY(mainThread != NULL)) {
|
||||
NSK_COMPLAIN1("<%s> thread not found\n", MAIN_THREAD_NAME);
|
||||
return NSK_FALSE;
|
||||
}
|
||||
|
||||
/* make thread accessable for a long time */
|
||||
if (!NSK_JNI_VERIFY(jni, (mainThread = jni->NewGlobalRef(mainThread)) != NULL))
|
||||
mainThread = jni->NewGlobalRef(mainThread);
|
||||
if (!NSK_JNI_VERIFY(jni, mainThread != NULL))
|
||||
return NSK_FALSE;
|
||||
|
||||
if (!NSK_VERIFY((startObject =
|
||||
getStaticObjField(DEBUGEE_CLASS_NAME, START_FIELD_NAME,
|
||||
OBJECT_FIELD_SIG)) != NULL))
|
||||
startObject = getStaticObjField(DEBUGEE_CLASS_NAME, START_FIELD_NAME, OBJECT_FIELD_SIG);
|
||||
if (!NSK_VERIFY(startObject != NULL))
|
||||
return NSK_FALSE;
|
||||
|
||||
/*make object accessable for a long time*/
|
||||
if (!NSK_JNI_VERIFY(jni, (startObject = jni->NewGlobalRef(startObject)) != NULL))
|
||||
startObject = jni->NewGlobalRef(startObject);
|
||||
if (!NSK_JNI_VERIFY(jni, startObject != NULL))
|
||||
return NSK_FALSE;
|
||||
|
||||
|
||||
if (!NSK_VERIFY((endObject =
|
||||
getStaticObjField(DEBUGEE_CLASS_NAME, END_FIELD_NAME,
|
||||
OBJECT_FIELD_SIG)) != NULL))
|
||||
endObject = getStaticObjField(DEBUGEE_CLASS_NAME, END_FIELD_NAME, OBJECT_FIELD_SIG);
|
||||
if (!NSK_VERIFY(endObject != NULL))
|
||||
return NSK_FALSE;
|
||||
|
||||
/*make object accessable for a long time*/
|
||||
if (!NSK_JNI_VERIFY(jni, (endObject = jni->NewGlobalRef(endObject)) != NULL))
|
||||
endObject = jni->NewGlobalRef(endObject);
|
||||
if (!NSK_JNI_VERIFY(jni, endObject != NULL))
|
||||
return NSK_FALSE;
|
||||
|
||||
|
||||
if (!NSK_VERIFY((debuggeeThread =
|
||||
(jthread)getStaticObjField(DEBUGEE_CLASS_NAME, THREAD_FIELD_NAME,
|
||||
THREAD_FIELD_SIG)) != NULL))
|
||||
debuggeeThread = (jthread) getStaticObjField(DEBUGEE_CLASS_NAME,
|
||||
THREAD_FIELD_NAME,
|
||||
THREAD_FIELD_SIG);
|
||||
if (!NSK_VERIFY(debuggeeThread != NULL))
|
||||
return NSK_FALSE;
|
||||
|
||||
/* make thread accessable for a long time */
|
||||
if (!NSK_JNI_VERIFY(jni, (debuggeeThread = jni->NewGlobalRef(debuggeeThread)) != NULL))
|
||||
debuggeeThread = jni->NewGlobalRef(debuggeeThread);
|
||||
if (!NSK_JNI_VERIFY(jni, debuggeeThread != NULL))
|
||||
return NSK_FALSE;
|
||||
|
||||
return NSK_TRUE;
|
||||
@ -751,7 +756,8 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
|
||||
|
||||
timeout = nsk_jvmti_getWaitTime() * 60 * 1000;
|
||||
|
||||
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved)) != NULL))
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("_syncLock", &syncLock))) {
|
||||
|
||||
@ -509,7 +509,8 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
|
||||
|
||||
timeout = nsk_jvmti_getWaitTime() * 60 * 1000;
|
||||
|
||||
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved)) != NULL))
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("_syncLock", &syncLock))) {
|
||||
|
||||
@ -548,7 +548,8 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
|
||||
|
||||
timeout = nsk_jvmti_getWaitTime() * 60 * 1000;
|
||||
|
||||
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved)) != NULL))
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("_syncLock", &syncLock))) {
|
||||
|
||||
@ -554,7 +554,8 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
|
||||
|
||||
timeout = nsk_jvmti_getWaitTime() * 60 * 1000;
|
||||
|
||||
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved)) != NULL))
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("_syncLock", &syncLock))) {
|
||||
|
||||
@ -534,7 +534,8 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
|
||||
|
||||
timeout = nsk_jvmti_getWaitTime() * 60 * 1000;
|
||||
|
||||
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved)) != NULL))
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
|
||||
|
||||
@ -485,7 +485,8 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
|
||||
|
||||
timeout = nsk_jvmti_getWaitTime() * 60 * 1000;
|
||||
|
||||
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved)) != NULL))
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("_syncLock", &syncLock))) {
|
||||
|
||||
@ -521,7 +521,8 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
|
||||
|
||||
timeout = nsk_jvmti_getWaitTime() * 60 * 1000;
|
||||
|
||||
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved)) != NULL))
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("_syncLock", &syncLock))) {
|
||||
|
||||
@ -533,7 +533,8 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
|
||||
|
||||
timeout = nsk_jvmti_getWaitTime() * 60 * 1000;
|
||||
|
||||
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved)) != NULL))
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("_syncLock", &syncLock))) {
|
||||
|
||||
@ -540,7 +540,8 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
|
||||
|
||||
timeout = nsk_jvmti_getWaitTime() * 60 * 1000;
|
||||
|
||||
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved)) != NULL))
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("_syncLock", &syncLock))) {
|
||||
|
||||
@ -459,15 +459,16 @@ agentProc(jvmtiEnv* jvmti, JNIEnv* agentJNI, void* arg) {
|
||||
if (!nsk_jvmti_waitForSync(timeout))
|
||||
return;
|
||||
|
||||
if (!NSK_JNI_VERIFY(agentJNI, (cls = agentJNI->FindClass(CLASS_NAME)) != NULL))
|
||||
cls = agentJNI->FindClass(CLASS_NAME);
|
||||
if (!NSK_JNI_VERIFY(agentJNI, cls != NULL))
|
||||
return;
|
||||
|
||||
if (!NSK_JNI_VERIFY(agentJNI, (field_accID =
|
||||
agentJNI->GetStaticFieldID(cls, FIELD_ACC_NAME, "I")) != NULL))
|
||||
field_accID = agentJNI->GetStaticFieldID(cls, FIELD_ACC_NAME, "I");
|
||||
if (!NSK_JNI_VERIFY(agentJNI, field_accID != NULL))
|
||||
return;
|
||||
|
||||
if (!NSK_JNI_VERIFY(agentJNI, (field_modID =
|
||||
agentJNI->GetStaticFieldID(cls, FIELD_MOD_NAME, "I")) != NULL))
|
||||
field_modID = agentJNI->GetStaticFieldID(cls, FIELD_MOD_NAME, "I");
|
||||
if (!NSK_JNI_VERIFY(agentJNI, field_modID != NULL))
|
||||
return;
|
||||
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->SetFieldModificationWatch(cls, field_modID)))
|
||||
@ -521,7 +522,8 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
|
||||
|
||||
timeout = nsk_jvmti_getWaitTime() * 60 * 1000;
|
||||
|
||||
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved)) != NULL))
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("_syncLock", &syncLock))) {
|
||||
|
||||
@ -444,11 +444,12 @@ agentProc(jvmtiEnv* jvmti, JNIEnv* agentJNI, void* arg) {
|
||||
if (!nsk_jvmti_waitForSync(timeout))
|
||||
return;
|
||||
|
||||
if (!NSK_JNI_VERIFY(agentJNI, (cls = agentJNI->FindClass(CLASS_NAME)) != NULL))
|
||||
cls = agentJNI->FindClass(CLASS_NAME);
|
||||
if (!NSK_JNI_VERIFY(agentJNI, cls != NULL))
|
||||
return;
|
||||
|
||||
if (!NSK_JNI_VERIFY(agentJNI, (methodID =
|
||||
agentJNI->GetStaticMethodID(cls, METHOD_NAME, "()I")) != NULL))
|
||||
methodID = agentJNI->GetStaticMethodID(cls, METHOD_NAME, "()I");
|
||||
if (!NSK_JNI_VERIFY(agentJNI, methodID != NULL))
|
||||
return;
|
||||
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->SetBreakpoint(methodID, 0)))
|
||||
@ -499,7 +500,8 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
|
||||
|
||||
timeout = nsk_jvmti_getWaitTime() * 60 * 1000;
|
||||
|
||||
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved)) != NULL))
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("_syncLock", &syncLock))) {
|
||||
|
||||
@ -52,7 +52,8 @@ Java_nsk_jvmti_scenarios_events_EM02_em02t012_setThread(JNIEnv *jni_env,
|
||||
jobject o, jthread thrd) {
|
||||
|
||||
/* make thread accessable for a long time */
|
||||
NSK_JNI_VERIFY(jni_env, (testedThread = jni_env->NewGlobalRef(thrd)) != NULL);
|
||||
testedThread = jni_env->NewGlobalRef(thrd);
|
||||
NSK_JNI_VERIFY(jni_env, testedThread != NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -502,7 +503,8 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
|
||||
|
||||
timeout = nsk_jvmti_getWaitTime() * 60 * 1000;
|
||||
|
||||
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved)) != NULL))
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("_syncLock", &syncLock))) {
|
||||
|
||||
@ -199,10 +199,12 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
|
||||
|
||||
timeout = nsk_jvmti_getWaitTime() * 60 * 1000;
|
||||
|
||||
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved)) != NULL))
|
||||
jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved);
|
||||
if (!NSK_VERIFY(jvmti != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
if (!NSK_VERIFY((plist = (const void *)nsk_list_create()) != NULL))
|
||||
plist = (const void *)nsk_list_create();
|
||||
if (!NSK_VERIFY(plist != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
NSK_DISPLAY1("plist = 0x%p\n", plist);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user