void (@NotNull final DebuggerContextImpl newContext, DebuggerSession.Event event) { if (event == DebuggerSession.Event.PAUSE || event == DebuggerSession.Event.CONTEXT || event == DebuggerSession.Event.REFRESH || event == DebuggerSession.Event.REFRESH_WITH_STACK && myJavaSession.isPaused()) { final SuspendContextImpl newSuspendContext = newContext.getSuspendContext(); if (newSuspendContext != null && (shouldApplyContext(newContext) || event == DebuggerSession.Event.REFRESH_WITH_STACK)) { process.getManagerThread().schedule(new SuspendContextCommandImpl(newSuspendContext) { @Override public void contextAction(@NotNull SuspendContextImpl suspendContext) { ThreadReferenceProxyImpl threadProxy = newContext.getThreadProxy(); newSuspendContext.initExecutionStacks(threadProxy); Pair<Breakpoint, Event> item = ContainerUtil.getFirstItem(DebuggerUtilsEx.getEventDescriptors(newSuspendContext)); if (item != null) { XBreakpoint xBreakpoint = item.getFirst().getXBreakpoint(); Event second = item.getSecond(); if (xBreakpoint != null && second instanceof LocatableEvent && threadProxy != null && ((LocatableEvent)second).thread() == threadProxy.getThreadReference()) { ((XDebugSessionImpl)getSession()).breakpointReachedNoProcessing(xBreakpoint, newSuspendContext); unsetPausedIfNeeded(newContext); SourceCodeChecker.checkSource(newContext); return; } } getSession().positionReached(newSuspendContext); unsetPausedIfNeeded(newContext); SourceCodeChecker.checkSource(newContext); } }); } } else if (event == DebuggerSession.Event.ATTACHED) { getSession().rebuildViews(); // to refresh variables views message } }