show suspended threads on top of the trheads list webstorm/142.3253
authorEgor.Ushakov <egor.ushakov@jetbrains.com>
Wed, 15 Jul 2015 10:47:18 +0000 (13:47 +0300)
committerEgor.Ushakov <egor.ushakov@jetbrains.com>
Wed, 15 Jul 2015 11:39:31 +0000 (14:39 +0300)
java/debugger/impl/src/com/intellij/debugger/engine/SuspendContextImpl.java

index 4a2c806cff57dac171253aed8ece03d4ae15ed1a..6345d879ba97c692285656b3795cf4b8d0a6757c 100644 (file)
@@ -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<JavaExecutionStack> THREADS_COMPARATOR = new Comparator<JavaExecutionStack>() {
     @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;
     }
   };
 }