changeset 7485:47905b570eaf

Merged
author Sascha L. Teichmann <teichmann@intevation.de>
date Thu, 31 Oct 2013 18:34:10 +0100
parents 8b614d152a79 (diff) bdb12632c5f5 (current diff)
children 6b278187ed9d
files
diffstat 4 files changed, 17 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/CollectionMonitor.java	Thu Oct 31 15:25:31 2013 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/CollectionMonitor.java	Thu Oct 31 18:34:10 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;
     }
 
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/MainValuesQFacet.java	Thu Oct 31 15:25:31 2013 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/MainValuesQFacet.java	Thu Oct 31 18:34:10 2013 +0100
@@ -58,6 +58,11 @@
      * Employ linear interpolation.
      */
     protected static void setHitPoint(WQDay wqday, StickyAxisAnnotation annotation) {
+
+        if (wqday.size() == 0) {
+            return;
+        }
+
         int idx = 0;
         float q = annotation.getPos();
         boolean qIncreases = wqday.getQ(0) < wqday.getQ(wqday.size()-1);
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/MainValuesWFacet.java	Thu Oct 31 15:25:31 2013 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/MainValuesWFacet.java	Thu Oct 31 18:34:10 2013 +0100
@@ -54,6 +54,11 @@
      * Employ linear interpolation.
      */
     protected static void setHitPoint(WQDay wqday, StickyAxisAnnotation annotation) {
+
+        if (wqday.size() == 0) {
+            return;
+        }
+
         int idx = 0;
         float w = annotation.getPos();
         boolean wIncreases = wqday.getW(0) < wqday.getW(wqday.size()-1);
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/WQDay.java	Thu Oct 31 15:25:31 2013 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/WQDay.java	Thu Oct 31 18:34:10 2013 +0100
@@ -44,10 +44,7 @@
 
 
     public boolean isIncreasing() {
-        int lo = getDay(0);
-        int hi = getDay(size()-1);
-
-        return lo < hi;
+        return size() == 0 || getDay(0) < getDay(size()-1);
     }
 
 

http://dive4elements.wald.intevation.org