8263895: Test nsk/jvmti/GetThreadGroupChildren/getthrdgrpchld001/getthrdgrpchld001.cpp uses incorrect indices

Reviewed-by: amenkov, kevinw
This commit is contained in:
Leonid Mesnik 2021-03-22 17:56:54 +00:00
parent f84b52b84d
commit f62b1008ed

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2021, 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
@ -351,16 +351,16 @@ static jthreadGroup findThreadGroupByName(jvmtiEnv* jvmti, JNIEnv* jni, const ch
for (j = 0; j < groupsCount; j++) {
jvmtiThreadGroupInfo info;
if (groups[i] != NULL) {
if (groups[j] != NULL) {
if (!NSK_JVMTI_VERIFY(
jvmti->GetThreadGroupInfo(groups[i], &info))) {
jvmti->GetThreadGroupInfo(groups[j], &info))) {
nsk_jvmti_setFailStatus();
continue;
}
if (info.name != 0 && strcmp(info.name, name) == 0) {
foundGroup = groups[i];
foundGroup = groups[j];
break;
}
}