changeset 354:97aa76c9c2d3

Handle NULL probeId to avoid NULL key in importer response.
author Raimund Renkert <rrenkert@intevation.de>
date Thu, 05 Sep 2013 13:12:23 +0200
parents eefa5e465c2c
children 490dc50365e7
files src/main/java/de/intevation/lada/data/importer/LAFProducer.java
diffstat 1 files changed, 15 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/de/intevation/lada/data/importer/LAFProducer.java	Wed Sep 04 10:40:56 2013 +0200
+++ b/src/main/java/de/intevation/lada/data/importer/LAFProducer.java	Thu Sep 05 13:12:23 2013 +0200
@@ -103,9 +103,10 @@
                 this.zusatzwerte.add(zusatzWert);
             }
             else {
-                List<ReportData> err = this.errors.get(probe.getProbeId());
+                String ekey = probe.getProbeId() == null ? "probeId" : probe.getProbeId();
+                List<ReportData> err = this.errors.get(ekey);
                 if (err == null) {
-                    this.errors.put(probe.getProbeId(), mapper.getErrors());
+                    this.errors.put(ekey, mapper.getErrors());
                 }
                 else {
                     err.addAll(mapper.getErrors());
@@ -122,9 +123,10 @@
                 this.zusatzwerte.add(zusatzWert);
             }
             else {
-                List<ReportData> err = this.errors.get(probe.getProbeId());
+                String ekey = probe.getProbeId() == null ? "probeId" : probe.getProbeId();
+                List<ReportData> err = this.errors.get(ekey);
                 if (err == null) {
-                    this.errors.put(probe.getProbeId(), mapper.getErrors());
+                    this.errors.put(ekey, mapper.getErrors());
                 }
                 else {
                     err.addAll(mapper.getErrors());
@@ -144,9 +146,10 @@
                 this.messwerte.add(wert);
             }
             else {
-                List<ReportData> err = this.errors.get(probe.getProbeId());
+                String ekey = probe.getProbeId() == null ? "probeId" : probe.getProbeId();
+                List<ReportData> err = this.errors.get(ekey);
                 if (err == null) {
-                    this.errors.put(probe.getProbeId(), mapper.getErrors());
+                    this.errors.put(ekey, mapper.getErrors());
                 }
                 else {
                     err.addAll(mapper.getErrors());
@@ -277,9 +280,10 @@
         if (this.probe == null) {
             return this.warnings;
         }
-        List<ReportData> warn = this.warnings.get(probe.getProbeId());
+        String key = probe.getProbeId() == null ? "probeId" : probe.getProbeId();
+        List<ReportData> warn = this.warnings.get(key);
         if (warn == null) {
-            this.warnings.put(probe.getProbeId(), mapper.getWarnings());
+            this.warnings.put(key, mapper.getWarnings());
         }
         else {
             warn.addAll(mapper.getWarnings());
@@ -294,9 +298,10 @@
         if (this.probe == null) {
             return this.errors;
         }
-        List<ReportData> err = this.errors.get(this.probe.getProbeId());
+        String key = probe.getProbeId() == null ? "probeId" : probe.getProbeId();
+        List<ReportData> err = this.errors.get(key);
         if (err == null) {
-            this.errors.put(probe.getProbeId(), mapper.getErrors());
+            this.errors.put(key, mapper.getErrors());
         }
         else {
             err.addAll(mapper.getErrors());
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)