void (@NotNull MethodBreakpointBase breakpoint, @NotNull DebugProcessImpl debugProcess, @NotNull ReferenceType baseType) { DebuggerManagerThreadImpl.assertIsManagerThread(); RequestManagerImpl requestsManager = debugProcess.getRequestsManager(); ClassPrepareRequest request = requestsManager.createClassPrepareRequest((debuggerProcess, referenceType) -> { if (DebuggerUtilsImpl.instanceOf(referenceType, baseType)) { createRequestForPreparedClassEmulated(breakpoint, debugProcess, referenceType, false); } }, null); if (request != null) { requestsManager.registerRequest(breakpoint, request); request.enable(); } ProgressWindow indicator = new ProgressWindow(true, false, debugProcess.getProject(), JavaDebuggerBundle.message("cancel.emulation")); indicator.setDelayInMillis(2000); AtomicBoolean changed = new AtomicBoolean(); XBreakpointListener<XBreakpoint<?>> listener = new XBreakpointListener<XBreakpoint<?>>() { void changed(@NotNull XBreakpoint b) { if (b == breakpoint.getXBreakpoint()) { changed.set(true); indicator.cancel(); } } @Override public void breakpointRemoved(@NotNull XBreakpoint b) { changed(b); } @Override public void breakpointChanged(@NotNull XBreakpoint b) { changed(b); } }; debugProcess.getProject().getMessageBus().connect(indicator).subscribe(XBreakpointListener.TOPIC, listener); ProgressManager.getInstance().executeProcessUnderProgress( () -> processPreparedSubTypes(baseType, (subType, classesByName) -> createRequestForPreparedClassEmulated(breakpoint, debugProcess, subType, classesByName, false), indicator), indicator); if (indicator.isCanceled() && !changed.get()) { breakpoint.disableEmulation(); } }