X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=runtime%2Forg.argeo.slc.core%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fcore%2Fexecution%2FDefaultExecutionFlowDescriptorConverter.java;h=2d2d28babbddb5cd8f84ad1d8b361299a275504f;hb=16b2efa4ed3c8531ea539961c9dfaa326a8b164f;hp=1ff50e0db9c0f1c7caf8d54f0993ba7458197798;hpb=006e9a660a4edb4b3815f5a96e4366f80dbcc3ea;p=gpl%2Fargeo-slc.git diff --git a/runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/DefaultExecutionFlowDescriptorConverter.java b/runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/DefaultExecutionFlowDescriptorConverter.java index 1ff50e0db..2d2d28bab 100644 --- a/runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/DefaultExecutionFlowDescriptorConverter.java +++ b/runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/DefaultExecutionFlowDescriptorConverter.java @@ -218,9 +218,17 @@ public class DefaultExecutionFlowDescriptorConverter implements Comparator { public int compare(ExecutionFlowDescriptor o1, ExecutionFlowDescriptor o2) { + // TODO: write unit tests for this if (StringUtils.hasText(o1.getPath()) && StringUtils.hasText(o2.getPath())) { - return o1.getPath().compareTo(o2.getPath()); + if (o1.getPath().equals(o2.getPath())) + return o1.getName().compareTo(o2.getName()); + else if (o1.getPath().startsWith(o2.getPath())) + return -1; + else if (o2.getPath().startsWith(o1.getPath())) + return 1; + else + return o1.getPath().compareTo(o2.getPath()); } else if (!StringUtils.hasText(o1.getPath()) && StringUtils.hasText(o2.getPath())) { return 1;