From e5f84100c8e22ee686be64efcecb68d09ef03cd1 Mon Sep 17 00:00:00 2001 From: Eugene Zhuravlev Date: Sun, 3 Nov 2013 15:32:16 +0100 Subject: [PATCH] fix "not resumed" assertion --- .../events/SuspendContextCommandImpl.java | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/events/SuspendContextCommandImpl.java b/java/debugger/impl/src/com/intellij/debugger/engine/events/SuspendContextCommandImpl.java index f3ad39594d3a..739c96270cca 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/events/SuspendContextCommandImpl.java +++ b/java/debugger/impl/src/com/intellij/debugger/engine/events/SuspendContextCommandImpl.java @@ -67,16 +67,23 @@ public abstract class SuspendContextCommandImpl extends DebuggerCommandImpl { } finally{ suspendContext.myInProgress = false; - SuspendContextCommandImpl postponed = suspendContext.pollPostponedCommand(); - if (postponed != null) { - final Stack stack = new Stack(); - while (postponed != null) { - stack.push(postponed); - postponed = suspendContext.pollPostponedCommand(); + if (suspendContext.isResumed()) { + for (SuspendContextCommandImpl postponed = suspendContext.pollPostponedCommand(); postponed != null; postponed = suspendContext.pollPostponedCommand()) { + postponed.notifyCancelled(); } - final DebuggerManagerThreadImpl managerThread = suspendContext.getDebugProcess().getManagerThread(); - while (!stack.isEmpty()) { - managerThread.pushBack(stack.pop()); + } + else { + SuspendContextCommandImpl postponed = suspendContext.pollPostponedCommand(); + if (postponed != null) { + final Stack stack = new Stack(); + while (postponed != null) { + stack.push(postponed); + postponed = suspendContext.pollPostponedCommand(); + } + final DebuggerManagerThreadImpl managerThread = suspendContext.getDebugProcess().getManagerThread(); + while (!stack.isEmpty()) { + managerThread.pushBack(stack.pop()); + } } } }