Skip to content

Commit 6d1c3c6

Browse files
committed
8210689: Remove the multi-line old C style for string literals
Remove the multi-line old C style and prefer C++ multi-line Backport-of: 64099fc
1 parent 9a1fce0 commit 6d1c3c6

File tree

34 files changed

+386
-253
lines changed

34 files changed

+386
-253
lines changed

test/hotspot/jtreg/vmTestbase/nsk/jvmti/Breakpoint/breakpoint001/breakpoint001.cpp

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,10 @@ ClassLoad(jvmtiEnv *jvmti_env, JNIEnv *env, jthread thread, jclass klass) {
9494
"failed to obtain a class signature\n");
9595

9696
if (sig != NULL && (strcmp(sig, CLASS_SIG) == 0)) {
97-
NSK_DISPLAY1("ClassLoad event received for the class \"%s\"\n\
98-
\tsetting breakpoints ...\n",
99-
sig);
97+
NSK_DISPLAY1(
98+
"ClassLoad event received for the class \"%s\"\n"
99+
"\tsetting breakpoints ...\n",
100+
sig);
100101
setBP(jvmti_env, env, klass);
101102
}
102103
}
@@ -126,8 +127,9 @@ Breakpoint(jvmtiEnv *jvmti_env, JNIEnv* jni_env, jthread thread,
126127
strcmp(thr_info.name,THREAD_NAME) != 0 ||
127128
thr_info.is_daemon==JNI_TRUE) {
128129
result = checkStatus = STATUS_FAILED;
129-
NSK_COMPLAIN2("TEST FAILED: Breakpoint event with unexpected thread info:\n\
130-
\tname: \"%s\"\ttype: %s thread\n\n",
130+
NSK_COMPLAIN2(
131+
"TEST FAILED: Breakpoint event with unexpected thread info:\n"
132+
"\tname: \"%s\"\ttype: %s thread\n\n",
131133
(thr_info.name == NULL)?"NULL":thr_info.name,
132134
(thr_info.is_daemon==JNI_TRUE)?"deamon":"user");
133135
}
@@ -161,9 +163,10 @@ Breakpoint(jvmtiEnv *jvmti_env, JNIEnv* jni_env, jthread thread,
161163
if (clsSig == NULL ||
162164
strcmp(clsSig,CLASS_SIG) != 0) {
163165
result = checkStatus = STATUS_FAILED;
164-
NSK_COMPLAIN1("TEST FAILED: Breakpoint event with unexpected class signature:\n\
165-
\t\"%s\"\n\n",
166-
(clsSig == NULL)?"NULL":clsSig);
166+
NSK_COMPLAIN1(
167+
"TEST FAILED: Breakpoint event with unexpected class signature:\n"
168+
"\t\"%s\"\n\n",
169+
(clsSig == NULL) ? "NULL" : clsSig);
167170
}
168171
else
169172
NSK_DISPLAY1("CHECK PASSED: class signature: \"%s\"\n",
@@ -220,8 +223,10 @@ Java_nsk_jvmti_Breakpoint_breakpoint001_check(
220223
for (i=0; i<METH_NUM; i++) {
221224
if (bpEvents[i] != 1) {
222225
result = STATUS_FAILED;
223-
NSK_COMPLAIN3("TEST FAILED: wrong number of Breakpoint events\n\
224-
\tfor the method \"%s %s\":\n\t\tgot: %d\texpected: 1\n",
226+
NSK_COMPLAIN3(
227+
"TEST FAILED: wrong number of Breakpoint events\n"
228+
"\tfor the method \"%s %s\":\n"
229+
"\t\tgot: %d\texpected: 1\n",
225230
METHODS[i][0], METHODS[i][1], bpEvents[i]);
226231
}
227232
else

test/hotspot/jtreg/vmTestbase/nsk/jvmti/ClassLoad/classload001/classload001.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,9 @@ ClassLoad(jvmtiEnv *jvmti_env, JNIEnv *env, jthread thread, jclass klass) {
133133
else if ((i = findSig(sig, 0)) != -1) {
134134
result = STATUS_FAILED;
135135
primClsEvents[i]++;
136-
NSK_COMPLAIN1("TEST FAILED: JVMTI_EVENT_CLASS_LOAD event received for\n\
137-
\t a primitive class/array of primitive types with the signature \"%s\"\n",
136+
NSK_COMPLAIN1(
137+
"TEST FAILED: JVMTI_EVENT_CLASS_LOAD event received for\n"
138+
"\t a primitive class/array of primitive types with the signature \"%s\"\n",
138139
sig);
139140
}
140141

test/hotspot/jtreg/vmTestbase/nsk/jvmti/GarbageCollectionStart/gcstart001/gcstart001.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ GarbageCollectionStart(jvmtiEnv *jvmti_env) {
5252

5353
if (gcstart != (gcfinish+1)) {
5454
result = STATUS_FAILED;
55-
NSK_COMPLAIN2("TEST FAILED: GarbageCollectionStart event has no a matched pair GarbageCollectionFinish:\n\
56-
\t%d GarbageCollectionStart events\t%d GarbageCollectionFinish events\n\n",
55+
NSK_COMPLAIN2(
56+
"TEST FAILED: GarbageCollectionStart event has no a matched pair GarbageCollectionFinish:\n"
57+
"\t%d GarbageCollectionStart events\t%d GarbageCollectionFinish events\n\n",
5758
gcstart, gcfinish);
5859
}
5960
else
@@ -68,8 +69,9 @@ GarbageCollectionFinish(jvmtiEnv *jvmti_env) {
6869

6970
if (gcstart != gcfinish) {
7071
result = STATUS_FAILED;
71-
NSK_COMPLAIN2("TEST FAILED: GarbageCollectionFinish event has no a matched pair GarbageCollectionStart:\n\
72-
\t%d GarbageCollectionStart events\t%d GarbageCollectionFinish events\n\n",
72+
NSK_COMPLAIN2(
73+
"TEST FAILED: GarbageCollectionFinish event has no a matched pair GarbageCollectionStart:\n"
74+
"\t%d GarbageCollectionStart events\t%d GarbageCollectionFinish events\n\n",
7375
gcstart, gcfinish);
7476
}
7577
else
@@ -81,8 +83,9 @@ VMDeath(jvmtiEnv *jvmti_env, JNIEnv *env) {
8183
NSK_DISPLAY0("VMDeath event received\n");
8284

8385
if (gcstart != gcfinish || result == STATUS_FAILED) {
84-
NSK_COMPLAIN2("TEST FAILED: some GarbageCollectionFinish events have no a matched pair GarbageCollectionStart:\n\
85-
\t%d GarbageCollectionStart events\t%d GarbageCollectionFinish events\n\n",
86+
NSK_COMPLAIN2(
87+
"TEST FAILED: some GarbageCollectionFinish events have no a matched pair GarbageCollectionStart:\n"
88+
"\t%d GarbageCollectionStart events\t%d GarbageCollectionFinish events\n\n",
8689
gcstart, gcfinish);
8790

8891
exit(95 + STATUS_FAILED);

test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetClassSignature/getclsig006/getclsig006.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,12 @@ static int checkSig(JNIEnv *jni_env, jclass testedCls, int idx) {
6969

7070
if (strcmp(class_sig[idx][1], sign) != 0 ||
7171
strcmp(class_sig[idx][2], (gen_sign==NULL)?"NULL":gen_sign) != 0) {
72-
NSK_COMPLAIN5("TEST FAILED: class: \"%s\" \
73-
has\n\tsignature: \"%s\"\n\tgeneric signature: \"%s\"\n\n\tExpected: \"%s\"\n\t\"%s\"\n\n",
72+
NSK_COMPLAIN5(
73+
"TEST FAILED: class: \"%s\" has\n"
74+
"\tsignature: \"%s\"\n"
75+
"\tgeneric signature: \"%s\"\n\n"
76+
"\tExpected: \"%s\"\n"
77+
"\t\"%s\"\n\n",
7478
class_sig[idx][0],
7579
sign, (gen_sign==NULL)?"NULL":gen_sign,
7680
class_sig[idx][1], class_sig[idx][2]);

test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetFieldName/getfldnm005/getfldnm005.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,12 @@ static int checkSig(JNIEnv *jni_env, jclass testedCls,
103103

104104
if (strcmp(fld_sig[idx][2], sign) != 0 ||
105105
strcmp(fld_sig[idx][3], (gen_sign==NULL)?"NULL":gen_sign) != 0) {
106-
NSK_COMPLAIN6("TEST FAILED: %s field \"%s\" \
107-
has\n\tsignature: \"%s\"\n\tgeneric signature: \"%s\"\n\n\tExpected: \"%s\"\n\t\t\"%s\"\n\n",
106+
NSK_COMPLAIN6(
107+
"TEST FAILED: %s field \"%s\" has\n"
108+
"\tsignature: \"%s\"\n"
109+
"\tgeneric signature: \"%s\"\n\n"
110+
"\tExpected: \"%s\"\n"
111+
"\t\t\"%s\"\n\n",
108112
(instance==0)?"instance":"static",
109113
fld_sig[idx][0],
110114
sign, (gen_sign==NULL)?"NULL":gen_sign,

test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetJNIFunctionTable/getjniftab002/getjniftab002.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,12 @@ Java_nsk_jvmti_GetJNIFunctionTable_getjniftab002_check(JNIEnv *env, jobject obj)
8080
only since JDK 1.2 */
8181
if (verbose)
8282
printf("\nb) Checking the function with the detached thread ...\n\ndetaching the main thread ...\n");
83-
if ((err = vm->DetachCurrentThread()) != 0)
84-
printf("(%s,%d): Warning: DetachCurrentThread() returns: %d\n\
85-
\tcheck with the detached main thread skipped\n",
83+
if ((err = vm->DetachCurrentThread()) != 0) {
84+
printf(
85+
"(%s,%d): Warning: DetachCurrentThread() returns: %d\n"
86+
"\tcheck with the detached main thread skipped\n",
8687
__FILE__, __LINE__, err);
87-
else {
88+
} else {
8889
redirect(env, JVMTI_ERROR_UNATTACHED_THREAD);
8990

9091
if (verbose)

test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetLocalVariableTable/localtab004/localtab004.cpp

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,7 @@ static int checkAttr(JNIEnv *jni_env, jclass testedCls) {
107107
jni_env, testedCls,
108108
methInfo[i].m_name, methInfo[i].m_sign);
109109
if (methInfo[i].mid == NULL) {
110-
NSK_COMPLAIN3("TEST FAILURE: unable to get the method ID for the %s method\
111-
\"%s\", signature \"%s\"\n\n",
110+
NSK_COMPLAIN3("TEST FAILURE: unable to get the method ID for the %s method \"%s\", signature \"%s\"\n\n",
112111
methInfo[i].inst?"instance":"static",
113112
methInfo[i].m_name, methInfo[i].m_sign);
114113
return STATUS_FAILED;
@@ -124,8 +123,9 @@ static int checkAttr(JNIEnv *jni_env, jclass testedCls) {
124123
} else {
125124
if (count != methInfo[i].vcount) {
126125
totRes = STATUS_FAILED;
127-
NSK_COMPLAIN5("TEST FAILED: %s method \"%s\", signature \"%s\":\
128-
found %d vars in the LocalVariableTable, expected %d\n\tHere are the found vars:\n",
126+
NSK_COMPLAIN5(
127+
"TEST FAILED: %s method \"%s\", signature \"%s\": found %d vars in the LocalVariableTable, expected %d\n"
128+
"\tHere are the found vars:\n",
129129
methInfo[i].inst?"instance":"static",
130130
methInfo[i].m_name, methInfo[i].m_sign,
131131
count, methInfo[i].vcount);
@@ -136,18 +136,21 @@ static int checkAttr(JNIEnv *jni_env, jclass testedCls) {
136136

137137
continue;
138138
}
139-
else
140-
NSK_DISPLAY4("Checking vars in the LocalVariableTable of the %s method \"%s\",\
141-
signature \"%s\" ...\n\tfound %d local vars as expected\n",
139+
else {
140+
NSK_DISPLAY4(
141+
"Checking vars in the LocalVariableTable of the %s method \"%s\", signature \"%s\" ...\n"
142+
"\tfound %d local vars as expected\n",
142143
methInfo[i].inst?"instance":"static",
143144
methInfo[i].m_name, methInfo[i].m_sign, count);
145+
}
144146

145147
for (j=0; j<count; j++) {
146148
for (k=0; k<count; k++) {
147149
if (strcmp(lv_table[j].name, methInfo[i].vars[k].v_name) == 0) {
148150
if (strcmp(lv_table[j].signature, methInfo[i].vars[k].v_sign) != 0) {
149-
NSK_COMPLAIN6("TEST FAILED: %s method: \"%s\", signature: \"%s\": var \"%s\"\
150-
has signature \"%s\" in the LocalVariableTable, expected \"%s\"\n\n",
151+
NSK_COMPLAIN6(
152+
"TEST FAILED: %s method: \"%s\", signature: \"%s\": var \"%s\" "
153+
"has signature \"%s\" in the LocalVariableTable, expected \"%s\"\n\n",
151154
methInfo[i].inst?"instance":"static",
152155
methInfo[i].m_name, methInfo[i].m_sign,
153156
lv_table[j].name, lv_table[j].signature,

test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetLocalVariableTable/localtab005/localtab005.cpp

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,7 @@ static int checkAttr(JNIEnv *jni_env, jclass testedCls) {
115115
jni_env, testedCls,
116116
methInfo[i].m_name, methInfo[i].m_sign);
117117
if (methInfo[i].mid == NULL) {
118-
NSK_COMPLAIN3("TEST FAILURE: unable to get the method ID for the %s method\
119-
\"%s\", signature \"%s\"\n\n",
118+
NSK_COMPLAIN3("TEST FAILURE: unable to get the method ID for the %s method \"%s\", signature \"%s\"\n\n",
120119
methInfo[i].inst?"instance":"static",
121120
methInfo[i].m_name, methInfo[i].m_sign);
122121
return STATUS_FAILED;
@@ -132,8 +131,10 @@ static int checkAttr(JNIEnv *jni_env, jclass testedCls) {
132131
} else {
133132
if (count != methInfo[i].vcount) {
134133
totRes = STATUS_FAILED;
135-
NSK_COMPLAIN5("TEST FAILED: %s method \"%s\", signature \"%s\":\
136-
found %d vars in the LocalVariableTable, expected %d\n\tHere are the found vars:\n",
134+
NSK_COMPLAIN5(
135+
"TEST FAILED: %s method \"%s\", signature \"%s\":"
136+
"found %d vars in the LocalVariableTable, expected %d\n"
137+
"\tHere are the found vars:\n",
137138
methInfo[i].inst?"instance":"static",
138139
methInfo[i].m_name, methInfo[i].m_sign,
139140
count, methInfo[i].vcount);
@@ -146,20 +147,26 @@ static int checkAttr(JNIEnv *jni_env, jclass testedCls) {
146147

147148
continue;
148149
}
149-
else
150-
NSK_DISPLAY4(">>> Checking vars in the LocalVariableTable of the %s method \"%s\",\
151-
signature \"%s\" ...\n\t%d local vars as expected\n",
150+
else {
151+
NSK_DISPLAY4(
152+
">>> Checking vars in the LocalVariableTable of the %s method \"%s\","
153+
"signature \"%s\" ...\n"
154+
"\t%d local vars as expected\n",
152155
methInfo[i].inst?"instance":"static",
153156
methInfo[i].m_name, methInfo[i].m_sign, count);
157+
}
154158

155159
for (j=0; j<count; j++) {
156160
for (k=0; k<count; k++) {
157161
if (strcmp(lv_table[j].name, methInfo[i].vars[k].v_name) == 0) {
158162
if ((strcmp(lv_table[j].signature, methInfo[i].vars[k].v_sign) != 0) ||
159163
(strcmp((lv_table[j].generic_signature==NULL)?"NULL":lv_table[j].generic_signature,
160164
methInfo[i].vars[k].v_gen_sign) != 0)) {
161-
NSK_COMPLAIN8("TEST FAILED: %s method: \"%s\" \"%s\":\n\tvar \"%s\"\
162-
has signature \"%s\",\n\tgeneric signature \"%s\"\n\n\tExpected: \"%s\"\n\t\t\"%s\"\n\n",
165+
NSK_COMPLAIN8(
166+
"TEST FAILED: %s method: \"%s\" \"%s\":\n"
167+
"\tvar \"%s\" has signature \"%s\",\n"
168+
"\tgeneric signature \"%s\"\n\n"
169+
"\tExpected: \"%s\"\n\t\t\"%s\"\n\n",
163170
methInfo[i].inst?"instance":"static",
164171
methInfo[i].m_name, methInfo[i].m_sign,
165172
lv_table[j].name, lv_table[j].signature,

test/hotspot/jtreg/vmTestbase/nsk/jvmti/NativeMethodBind/nativemethbind001/nativemethbind001.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,9 @@ NativeMethodBind(jvmtiEnv *jvmti_env, JNIEnv* jni_env, jthread thread,
110110
(strcmp(methSig,METHODS[i][1]) == 0)) {
111111
bindEv[i][0]++;
112112

113-
NSK_DISPLAY1("CHECK PASSED: NativeMethodBind event received for the method:\n\
114-
\t\"%s\" as expected\n",
113+
NSK_DISPLAY1(
114+
"CHECK PASSED: NativeMethodBind event received for the method:\n"
115+
"\t\"%s\" as expected\n",
115116
methNam);
116117
break;
117118
}
@@ -163,8 +164,8 @@ Java_nsk_jvmti_NativeMethodBind_nativemethbind001_nativeMethod(
163164
meth.signature = (char *) METHODS[1][1];
164165
meth.fnPtr = (void *) &anotherNativeMethod;
165166

166-
NSK_DISPLAY3("Calling RegisterNatives() with \"%s %s\"\n\
167-
\tfor class \"%s\" ...\n",
167+
NSK_DISPLAY3("Calling RegisterNatives() with \"%s %s\"\n"
168+
"\tfor class \"%s\" ...\n",
168169
METHODS[1][0], METHODS[1][1], CLASS_SIG);
169170
if (!NSK_JNI_VERIFY_VOID(env, (NSK_CPP_STUB4(RegisterNatives,
170171
env, testedCls, &meth, 1)) != 0)) {
@@ -187,8 +188,9 @@ Java_nsk_jvmti_NativeMethodBind_nativemethbind001_check(
187188
}
188189
else {
189190
result = STATUS_FAILED;
190-
NSK_COMPLAIN3("TEST FAILED: wrong number of NativeMethodBind events for the method \"%s\":\n\
191-
got: %d\texpected: %d\n\n",
191+
NSK_COMPLAIN3(
192+
"TEST FAILED: wrong number of NativeMethodBind events for the method \"%s\":\n"
193+
"got: %d\texpected: %d\n\n",
192194
METHODS[i][0], bindEv[i][0], bindEv[i][1]);
193195
}
194196

test/hotspot/jtreg/vmTestbase/nsk/jvmti/NativeMethodBind/nativemethbind002/nativemethbind002.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,9 @@ NativeMethodBind(jvmtiEnv *jvmti_env, JNIEnv* jni_env, jthread thread,
6767
if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPhase,
6868
jvmti_env, &phase))) {
6969
result = STATUS_FAILED;
70-
NSK_COMPLAIN0("TEST FAILED: unable to obtain phase of the VM execution\n\
71-
\tduring NativeMethodBind callback\n\n");
70+
NSK_COMPLAIN0(
71+
"TEST FAILED: unable to obtain phase of the VM execution\n"
72+
"\tduring NativeMethodBind callback\n\n");
7273
unlock(jvmti_env, jni_env);
7374
return;
7475
}
@@ -103,10 +104,12 @@ void JNICALL
103104
VMDeath(jvmtiEnv *jvmti_env, JNIEnv *env) {
104105
NSK_DISPLAY0("VMDeath event received\n");
105106

106-
if (wrongBindEv != 0)
107-
NSK_COMPLAIN1("TEST FAILED: there are %d NativeMethodBind events\n\
108-
sent during non-start or non-live phase of the VM execution\n",
107+
if (wrongBindEv != 0) {
108+
NSK_COMPLAIN1(
109+
"TEST FAILED: there are %d NativeMethodBind events\n"
110+
"sent during non-start or non-live phase of the VM execution\n",
109111
wrongBindEv);
112+
}
110113

111114
if (result == STATUS_FAILED)
112115
exit(95 + STATUS_FAILED);

0 commit comments

Comments
 (0)