changeset 356:3f03e954c04d

Fixed reset for errors and warnings.
author Raimund Renkert <rrenkert@intevation.de>
date Thu, 05 Sep 2013 13:14:39 +0200
parents 490dc50365e7
children e0bbb54f2f7c
files src/main/java/de/intevation/lada/data/importer/LAFParser.java
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/de/intevation/lada/data/importer/LAFParser.java	Thu Sep 05 13:13:43 2013 +0200
+++ b/src/main/java/de/intevation/lada/data/importer/LAFParser.java	Thu Sep 05 13:14:39 2013 +0200
@@ -54,6 +54,7 @@
                     this.errors.putAll(producer.getErrors());
                     writeAll(auth);
                     this.producer.reset();
+                    this.writer.reset();
                 }
                 catch (LAFParserException lpe) {
                     Map<String, List<ReportData>> pErr = producer.getErrors();
@@ -78,6 +79,7 @@
                     this.errors.putAll(producer.getErrors());
                     writeAll(auth);
                     this.producer.reset();
+                    this.writer.reset();
                     laf = "";
                 }
                 catch (LAFParserException lpe) {
@@ -102,7 +104,7 @@
     }
 
     private void writeAll(AuthenticationResponse auth) {
-        String probeId = producer.getProbe().getProbeId();
+        String probeId = producer.getProbe().getProbeId() == null ? "probeId" : producer.getProbe().getProbeId();
         boolean p = writer.writeProbe(auth, producer.getProbe());
         if (!p) {
             this.errors.put(probeId, writer.getErrors());
@@ -263,7 +265,7 @@
 
     public void reset() {
         producer.reset();
-        this.errors.clear();
-        this.warnings.clear();
+        this.errors = new HashMap<String, List<ReportData>>();
+        this.warnings = new HashMap<String, List<ReportData>>();
     }
 }
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)