changeset 8638:3c78fc83fc6d

(issue1755) Do not treat empty values as part of the result
author Andre Heinecke <andre.heinecke@intevation.de>
date Fri, 27 Mar 2015 17:25:30 +0100
parents 5a5331dd3e8d
children 97d60b0afe24
files artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedQualityResult.java artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedQualityResultValue.java
diffstat 2 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedQualityResult.java	Fri Mar 27 16:55:58 2015 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedQualityResult.java	Fri Mar 27 17:25:30 2015 +0100
@@ -40,6 +40,9 @@
     }
 
     public void add(BedQualityResultValue value) {
+        if (value.isEmpty()) {
+            return;
+        }
         /* Add first is here to mimic the result sorting before
          * a refactorization.*/
         values.addFirst(value);
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedQualityResultValue.java	Fri Mar 27 16:55:58 2015 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedQualityResultValue.java	Fri Mar 27 17:25:30 2015 +0100
@@ -70,6 +70,10 @@
         return name;
     }
 
+    public boolean isEmpty() {
+        return data == null || data.length < 2 || data[0].length == 0;
+    }
+
     public void setName(String name) {
         this.name = name;
     }

http://dive4elements.wald.intevation.org