ahgittin commented on a change in pull request #1265:
URL: https://github.com/apache/brooklyn-server/pull/1265#discussion_r735545491



##########
File path: 
rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/EntityResource.java
##########
@@ -173,46 +174,57 @@ public int compare(Task<?> o1, Task<?> o2) {
             if (!Objects.equal(o1.isSubmitted(), o2.isSubmitted())) {
                 return o1.isSubmitted() ? -1 : 1;
             }
-
-            // big pref for top-level tasks (manual operations), where 
submitter null
-            int weight = 0;
-            Task<?> o1s = o1.getSubmittedByTask();
-            Task<?> o2s = o2.getSubmittedByTask();
-            if ("start".equals(o1.getDisplayName()) 
||"start".equals(o2.getDisplayName())) {
-                weight = 0;
+            // followed by absolute pref for active items
+            if (!Objects.equal(o1.isDone(), o2.isDone())) {
+                return !o1.isDone() ? -1 : 1;

Review comment:
       normally i would but for comparators i like the RHS being `? 
<goes-before> : <goes-after>`

##########
File path: 
utils/common/src/main/java/org/apache/brooklyn/util/guava/Functionals.java
##########
@@ -20,6 +20,8 @@
 
 import java.util.concurrent.Callable;
 
+import java.util.regex.Matcher;

Review comment:
       possibly not any more - TY, will update




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to