changeset 7482:f8e1af4e2f69

Datacage recommendations: Sort outs to to generate consistent cache keys.
author Sascha L. Teichmann <teichmann@intevation.de>
date Thu, 31 Oct 2013 18:25:26 +0100
parents 2a2e89c01588
children f206f6049b2b
files artifacts/src/main/java/org/dive4elements/river/artifacts/CollectionMonitor.java
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/CollectionMonitor.java	Thu Oct 31 13:11:03 2013 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/CollectionMonitor.java	Thu Oct 31 18:25:26 2013 +0100
@@ -8,6 +8,7 @@
 
 package org.dive4elements.river.artifacts;
 
+import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -134,8 +135,8 @@
      */
     private static final String [] extractOutputNames(
         D4EArtifact flys,
-        CallContext  context)
-    {
+        CallContext context
+    ) {
         if (flys instanceof ChartArtifact) {
             return new String[0];
         }
@@ -150,6 +151,9 @@
             names[i] = outs.get(i).getName();
         }
 
+        // Sort them to make cache key generation consistent.
+        Arrays.sort(names);
+
         return names;
     }
 

http://dive4elements.wald.intevation.org