From 22554874b9c2163750ecc316d566081cab2fbcc2 Mon Sep 17 00:00:00 2001 From: "Egor.Ushakov" Date: Wed, 15 Jul 2015 13:47:18 +0300 Subject: [PATCH] show suspended threads on top of the trheads list --- .../com/intellij/debugger/engine/SuspendContextImpl.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/SuspendContextImpl.java b/java/debugger/impl/src/com/intellij/debugger/engine/SuspendContextImpl.java index 4a2c806cff57..6345d879ba97 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/SuspendContextImpl.java +++ b/java/debugger/impl/src/com/intellij/debugger/engine/SuspendContextImpl.java @@ -24,6 +24,7 @@ import com.intellij.debugger.impl.DebuggerUtilsEx; import com.intellij.debugger.jdi.StackFrameProxyImpl; import com.intellij.debugger.jdi.ThreadReferenceProxyImpl; import com.intellij.openapi.diagnostic.Logger; +import com.intellij.openapi.util.Comparing; import com.intellij.util.containers.HashSet; import com.intellij.xdebugger.frame.XExecutionStack; import com.intellij.xdebugger.frame.XSuspendContext; @@ -266,7 +267,11 @@ public abstract class SuspendContextImpl extends XSuspendContext implements Susp private static final Comparator THREADS_COMPARATOR = new Comparator() { @Override public int compare(JavaExecutionStack th1, JavaExecutionStack th2) { - return th1.getDisplayName().compareToIgnoreCase(th2.getDisplayName()); + int res = Comparing.compare(th2.getThreadProxy().isSuspended(), th1.getThreadProxy().isSuspended()); + if (res == 0) { + return th1.getDisplayName().compareToIgnoreCase(th2.getDisplayName()); + } + return res; } }; } -- 2.32.0