void (@NotNull AnActionEvent e) { final DebuggerContextImpl debuggerContext = DebuggerAction.getDebuggerContext(e.getDataContext()); DebugProcessImpl process = debuggerContext.getDebugProcess(); if (process == null) { return; } process.getManagerThread().schedule(new DebuggerContextCommandImpl(debuggerContext) { @Override public void threadAction(@NotNull SuspendContextImpl suspendContext) { List<SuspendContextImpl> pausedContexts = process.getSuspendManager().getPausedContexts(); if (pausedContexts.size() > 1) { int currentIndex = pausedContexts.indexOf(debuggerContext.getSuspendContext()); int newIndex = (currentIndex + 1) % pausedContexts.size(); process.getManagerThread().schedule(new SuspendContextCommandImpl(pausedContexts.get(newIndex)) { @Override public void contextAction(@NotNull SuspendContextImpl suspendContext) { DebuggerSession.switchContext(suspendContext); } }); } } }); }