On Thu, 29 Jun 2023 18:51:26 GMT, Alex Menkov <[email protected]> wrote:
>> test/hotspot/jtreg/serviceability/jvmti/vthread/GetThreadStateMountedTest/GetThreadStateMountedTest.java
>> line 62:
>>
>>> 60: TestStatus status = new
>>> TestStatus("JVMTI_THREAD_STATE_RUNNABLE");
>>> 61: CountDownLatch ready = new CountDownLatch(1);
>>> 62: final boolean[] stopFlag = new boolean[1];
>>
>> Q: It is not clear why an array is needed instead of non-final local. The
>> same question for `waiting()` method below. I'm thinking if reverting the
>> flag to something like `needContinue` would simplify code a little bit.
>
> It's used in lambda, so must be final
> I think both "flag to stop" and "flag to continue" are clear, I prefer "flag
> to stop" as it does not require additional initialization
Okay, I see why an array is needed.
It is really minor and up to you. Just wanted to get rid of one negation. :)
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14622#discussion_r1247319839