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=a692279b816eef47d409464ea3651055a14e4b5e;hb=5a2ccf5f49cbda95891436c1ce8e9bdd419c0b41;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..a692279b8 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 @@ -46,7 +46,7 @@ public class DefaultExecutionFlowDescriptorConverter implements ExecutionSpec executionSpec = executionFlowDescriptor .getExecutionSpec(); - if (executionSpec == null) + if (executionSpec == null && log.isTraceEnabled()) log.warn("Execution spec is null for " + executionFlowDescriptor); if (values != null && executionSpec != null) { @@ -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;