ThreadReferenceProxyImpl (@Nullable ThreadReference thread, boolean forceCache) { DebuggerManagerThreadImpl.assertIsManagerThread(); if (thread == null) { return null; } ThreadReferenceProxyImpl proxy = myAllThreads.computeIfAbsent(thread, t -> { // do not cache virtual threads if (!forceCache && thread instanceof ThreadReferenceImpl && ((ThreadReferenceImpl)thread).isVirtual()) { return null; } return new ThreadReferenceProxyImpl(this, t); }); if (proxy == null) { // not cached proxy = new ThreadReferenceProxyImpl(this, thread); } return proxy; }