On Wed, 18 Mar 2026 07:11:01 GMT, David Holmes <[email protected]> wrote:
>> test/hotspot/jtreg/serviceability/threads/ThreadInfoTest.java line 141:
>>
>>> 139: while (true) {
>>> 140: if (replacing) {
>>> 141: int replaced = replaceThreads(ids, infos);
>>
>> The return value is unused and serves no purpose.
>
> And surely this whole loop can simplify to:
>
> while (true) {
> if (count < 10) {
> replaceThreads(ids, infos);
> }
> goSleep(1);
> }
I removed unused return value `replaced`.
The simplified version is not equivalent - e.g. when `10 <= count <= 20`, the
behavior depends on early `replacing` value.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/30105#discussion_r2954296860