]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/DefaultExecutionFlowDescriptorConverter.java
Add resource as stdin
[gpl/argeo-slc.git] / runtime / org.argeo.slc.core / src / main / java / org / argeo / slc / core / execution / DefaultExecutionFlowDescriptorConverter.java
index 1ff50e0db9c0f1c7caf8d54f0993ba7458197798..a692279b816eef47d409464ea3651055a14e4b5e 100644 (file)
@@ -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<ExecutionFlowDescriptor> {
                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;