On Thu, 3 Dec 2026 19:46:44 GMT, Chris Plummer <[email protected]> wrote:

>> Shiv Shah has updated the pull request with a new target base due to a merge 
>> or a rebase. The incremental webrev excludes the unrelated changes brought 
>> in by the merge/rebase. The pull request contains three additional commits 
>> since the last revision:
>> 
>>  - Merge branch 'master' into JDK-8372536
>>  - Skip collected threads explicitly in the other-thread check
>>  - 8372536: Add testing of JDI 
>> ThreadStartRequest.addPlatformThreadsOnlyFilter() API
>
> test/jdk/com/sun/jdi/PlatformThreadsOnlyFilterTest.java line 183:
> 
>> 181:             boolean filtered = filteredStart.equals(event.request()) || 
>> filteredDeath.equals(event.request());
>> 182:             boolean counted = workers.stream().anyMatch(worker -> 
>> worker.thread().equals(event.thread()));
>> 183:             if (filtered && !counted && isVirtual(event.thread())) {
> 
> Theoretically this event could have been on a virtual thread outside the 
> control of the test, and that thread is now collected. You swallow the 
> ObjectCollectedException in isVirtual(), leading to isVirtual() returning 
> false, even if the thread was virtual. Perhaps you should should just call 
> ObjectReference.isVirtual() directly, and be explicit about the skipping of 
> collected threads rather than rely on the implicit skipping when the test 
> version of isVirtual() returns false.

Fixed. The loop calls `isVirtual()` itself and prints a line when a thread was 
collected and gets skipped.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/34069#discussion_r4792889852

Reply via email to