void (final Value value, final ThreadReferenceProxyImpl thread, final DebugProcessImpl debugProcess, @Nullable final DialogWrapper dialog) { debugProcess.getManagerThread().schedule(new DebuggerCommandImpl() { @Override protected void action() { try { debugProcess.startWatchingMethodReturn(thread); thread.forceEarlyReturn(value); } catch (Exception e) { showError(debugProcess.getProject(), JavaDebuggerBundle.message("error.early.return", e.getLocalizedMessage())); return; } SwingUtilities.invokeLater(() -> { if (dialog != null) { dialog.close(DialogWrapper.OK_EXIT_CODE); } debugProcess.getSession().stepInto(true, null); }); } }); }