8212824: Remove unnecessary spaces before/after comparison in vmTestbase

Remove extra spaces around comparisons

Reviewed-by: phh, amenkov
This commit is contained in:
Jean Christophe Beyler 2019-01-14 15:40:22 -08:00
parent 244768cbab
commit 6029814c30
11 changed files with 30 additions and 50 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -69,8 +69,7 @@ ClassFileLoadHook(jvmtiEnv *jvmti_env, JNIEnv *jni_env,
}
if (!NSK_JNI_VERIFY(jni_env, (*new_class_data = (unsigned char*)
jni_env->GetByteArrayElements(classBytes, NULL))
!= NULL)) {
jni_env->GetByteArrayElements(classBytes, NULL)) != NULL)) {
nsk_jvmti_setFailStatus();
return;
}
@ -97,8 +96,7 @@ static int prepare(jvmtiEnv* jvmti, JNIEnv* jni) {
return NSK_FALSE;
if (!NSK_JNI_VERIFY(jni, (classBytes = (jbyteArray)
jni->GetStaticObjectField(debugeeClass, field))
!= NULL))
jni->GetStaticObjectField(debugeeClass, field)) != NULL))
return NSK_FALSE;
if (!NSK_JNI_VERIFY(jni, (classBytes = (jbyteArray)jni->NewGlobalRef(classBytes)) != NULL))

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -63,8 +63,7 @@ static int prepare(jvmtiEnv* jvmti, JNIEnv* jni) {
return NSK_FALSE;
if (!NSK_JNI_VERIFY(jni, (classBytes = (jbyteArray)
jni->GetStaticObjectField(debugeeClass, field))
!= NULL))
jni->GetStaticObjectField(debugeeClass, field)) != NULL))
return NSK_FALSE;
if (!NSK_JNI_VERIFY(jni, (classBytes = (jbyteArray)jni->NewGlobalRef(classBytes)) != NULL))
@ -91,8 +90,7 @@ static int redefine(jvmtiEnv* jvmti, JNIEnv* jni) {
return NSK_TRUE;
if (!NSK_JNI_VERIFY(jni, (class_def.class_bytes = (unsigned char*)
jni->GetByteArrayElements(classBytes, NULL))
!= NULL))
jni->GetByteArrayElements(classBytes, NULL)) != NULL))
return NSK_TRUE;
class_def.klass = testedClass;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -69,8 +69,7 @@ ClassFileLoadHook(jvmtiEnv *jvmti_env, JNIEnv *jni_env,
}
if (!NSK_JNI_VERIFY(jni_env, (*new_class_data = (unsigned char*)
jni_env->GetByteArrayElements(classBytes, NULL))
!= NULL)) {
jni_env->GetByteArrayElements(classBytes, NULL)) != NULL)) {
nsk_jvmti_setFailStatus();
return;
}
@ -97,8 +96,7 @@ static int prepare(jvmtiEnv* jvmti, JNIEnv* jni) {
return NSK_FALSE;
if (!NSK_JNI_VERIFY(jni, (classBytes = (jbyteArray)
jni->GetStaticObjectField(debugeeClass, field))
!= NULL))
jni->GetStaticObjectField(debugeeClass, field)) != NULL))
return NSK_FALSE;
if (!NSK_JNI_VERIFY(jni, (classBytes = (jbyteArray)jni->NewGlobalRef(classBytes)) != NULL))

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -63,8 +63,7 @@ static int prepare(jvmtiEnv* jvmti, JNIEnv* jni) {
return NSK_FALSE;
if (!NSK_JNI_VERIFY(jni, (classBytes = (jbyteArray)
jni->GetStaticObjectField(debugeeClass, field))
!= NULL))
jni->GetStaticObjectField(debugeeClass, field)) != NULL))
return NSK_FALSE;
if (!NSK_JNI_VERIFY(jni, (classBytes = (jbyteArray)jni->NewGlobalRef(classBytes)) != NULL))
@ -91,8 +90,7 @@ static int redefine(jvmtiEnv* jvmti, JNIEnv* jni) {
return NSK_TRUE;
if (!NSK_JNI_VERIFY(jni, (class_def.class_bytes = (unsigned char*)
jni->GetByteArrayElements(classBytes, NULL))
!= NULL))
jni->GetByteArrayElements(classBytes, NULL)) != NULL))
return NSK_TRUE;
class_def.klass = testedClass;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -190,9 +190,7 @@ callbackClassLoad(jvmtiEnv *jvmti_env, JNIEnv* jni_env, jthread thread,
return;
}
if (strcmp(className, EXPECTED_CLASS_SIGN)
== 0) {
if (strcmp(className, EXPECTED_CLASS_SIGN) == 0) {
NSK_DISPLAY1("\n\n>>>> Class loaded: %s", className);
NSK_DISPLAY0(", activating breakpoint\n");
setBreakPoint(jvmti_env, jni_env, klass);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -190,9 +190,7 @@ callbackClassLoad(jvmtiEnv *jvmti_env, JNIEnv* jni_env, jthread thread,
return;
}
if (strcmp(className, EXPECTED_CLASS_SIGN)
== 0) {
if (strcmp(className, EXPECTED_CLASS_SIGN) == 0) {
NSK_DISPLAY1("\n\n>>>> Class loaded: %s", className);
NSK_DISPLAY0(", activating breakpoint\n");
setBreakPoint(jvmti_env, jni_env, klass);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -116,8 +116,7 @@ void JNICALL callbackBreakpoint(jvmtiEnv *jvmti_env,
jlocation location) {
jvmtiError err;
err = JVMTI_ERROR_NONE;
if (nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_SINGLE_STEP, NULL)
== NSK_TRUE) {
if (nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_SINGLE_STEP, NULL) == NSK_TRUE) {
nsk_printf(" Enabled.. notification event ..");
}
err= jvmti->SetEventNotificationMode(JVMTI_DISABLE,

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -155,10 +155,8 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
nsk_printf("#error Agent :: while setting event callbacks.\n");
return JNI_ERR;
}
if ((nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_CLASS_PREPARE, NULL)
== NSK_TRUE) &&
(nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_FIELD_ACCESS, NULL)
== NSK_TRUE)) {
if ((nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_CLASS_PREPARE, NULL) == NSK_TRUE) &&
(nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_FIELD_ACCESS, NULL) == NSK_TRUE)) {
nsk_printf(" Agent :: Notifications are enabled.\n");
} else {
nsk_printf("#error Agent :: Eanableing Notifications.\n");

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -533,7 +533,7 @@ static int registerLocal(jint frame_id, jlocation location, jint slot, jlong tag
for (idx = 1; idx <= curr_local_idx; idx++) {
loc = &locDesc[idx];
if (loc->frame_id == frame_id &&
loc->slot == slot) {
loc->slot == slot) {
if (first_followref) {
/* Do this check on the first FollowReferences call only */
FrameDesc *fr = &frameDesc[frame_id];

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -486,20 +486,15 @@ extern "C" {
jstring stateName;
jint state;
if (!NSK_VERIFY(
env->GetJavaVM(&vm) == 0)) {
if (!NSK_VERIFY(env->GetJavaVM(&vm) == 0)) {
return NULL;
}
if (!NSK_VERIFY(
vm->GetEnv((void **)&jvmti, JVMTI_VERSION_1)
== JNI_OK)) {
if (!NSK_VERIFY(vm->GetEnv((void **)&jvmti, JVMTI_VERSION_1) == JNI_OK)) {
return NULL;
}
if (!NSK_VERIFY(
jvmti->GetThreadState((jthread)thread, &state)
== JVMTI_ERROR_NONE)) {
if (!NSK_VERIFY(jvmti->GetThreadState((jthread)thread, &state) == JVMTI_ERROR_NONE)) {
return NULL;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -166,7 +166,7 @@ jthread nsk_jvmti_aod_createThread(JNIEnv *jni) {
return NULL;
}
if (!NSK_JNI_VERIFY(jni,
(threadConstructor = jni->GetMethodID(klass, "<init>", "()V")) != NULL)) {
(threadConstructor = jni->GetMethodID(klass, "<init>", "()V")) != NULL)) {
NSK_COMPLAIN0("Failed to get java.lang.Thread constructor\n");
return NULL;
}
@ -199,7 +199,7 @@ jthread nsk_jvmti_aod_createThreadWithName(JNIEnv *jni, const char* threadName)
return NULL;
}
if (!NSK_JNI_VERIFY(jni,
(threadConstructor = jni->GetMethodID(klass, "<init>", "(Ljava/lang/String;)V")) != NULL)) {
(threadConstructor = jni->GetMethodID(klass, "<init>", "(Ljava/lang/String;)V")) != NULL)) {
NSK_COMPLAIN0("Failed to get java.lang.Thread constructor\n");
return NULL;
}