IDEA-43728 - fixed incorrect commands postponing while evaluation in progress

This commit is contained in:
Egor.Ushakov
2016-01-20 18:40:36 +03:00
parent 758dd6c2da
commit e9b25e08d6
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2015 JetBrains s.r.o.
* Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -66,12 +66,6 @@ public abstract class DebuggerContextCommandImpl extends SuspendContextCommandIm
@Override
public final void contextAction() throws Exception {
// with custom thread we have the right context already
if (myCustomThread != null) {
threadAction();
return;
}
SuspendManager suspendManager = myDebuggerContext.getDebugProcess().getSuspendManager();
boolean isSuspendedByContext;
try {
@@ -89,8 +83,9 @@ public abstract class DebuggerContextCommandImpl extends SuspendContextCommandIm
threadAction();
}
else {
// there are no suspend context currently registered
SuspendContextImpl suspendContextForThread = SuspendManagerUtil.findContextByThread(suspendManager, getThread());
// no suspend context currently available
SuspendContextImpl suspendContextForThread = myCustomThread != null ? getSuspendContext() :
SuspendManagerUtil.findContextByThread(suspendManager, getThread());
if (suspendContextForThread != null) {
suspendContextForThread.postponeCommand(this);
}