[Lada-commits] [PATCH 1 of 3] Fixed size of main descriptor fields and return 'null' instead of "" for empty

Wald Commits scm-commit at wald.intevation.org
Mon Sep 14 10:32:21 CEST 2015


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1442219444 -7200
# Node ID 83acc3b633548b26df9689e943adb65dbf7deced
# Parent  a7bbe976274933b0aa03d8c19d71377a2f335fe0
Fixed size of main descriptor fields and return 'null' instead of "" for empty
Umwelt in factory.

diff -r a7bbe9762749 -r 83acc3b63354 src/main/java/de/intevation/lada/factory/ProbeFactory.java
--- a/src/main/java/de/intevation/lada/factory/ProbeFactory.java	Fri Sep 11 14:54:14 2015 +0200
+++ b/src/main/java/de/intevation/lada/factory/ProbeFactory.java	Mon Sep 14 10:30:44 2015 +0200
@@ -439,9 +439,9 @@
             return "";
         }
 
-        int size = 1;
+        int size = 2;
         if (isZebs) {
-            size = 2;
+            size = 3;
         }
         for (int i = size; i >= 0; i--) {
             if (media.get(i) == -1) {
@@ -454,7 +454,7 @@
         @SuppressWarnings("unchecked")
         List<DeskriptorUmwelt> data = (List<DeskriptorUmwelt>)response.getData();
         if (data.isEmpty()) {
-            return "";
+            return null;
         }
 
         boolean unique = isUnique(data);
@@ -511,7 +511,7 @@
                     return data.get(found).getUmwId();
                 }
             }
-            return "";
+            return null;
         }
     }
 
diff -r a7bbe9762749 -r 83acc3b63354 src/main/java/de/intevation/lada/validation/rules/probe/DeskriptorToUmwelt.java
--- a/src/main/java/de/intevation/lada/validation/rules/probe/DeskriptorToUmwelt.java	Fri Sep 11 14:54:14 2015 +0200
+++ b/src/main/java/de/intevation/lada/validation/rules/probe/DeskriptorToUmwelt.java	Mon Sep 14 10:30:44 2015 +0200
@@ -108,9 +108,9 @@
             return violation;
         }
 
-        int size = 3;
+        int size = 2;
         if (isZebs) {
-            size = 1;
+            size = 3;
         }
         for (int i = size; i >= 0; i--) {
             if (media.get(i) == -1) {


More information about the Lada-commits mailing list