changeset 1113:628e0da7435a

Persist errors intended to be shown to the user. The subsequent currentErrors.clear() actually deleted the errors.
author Tom Gottfried <tom@intevation.de>
date Thu, 27 Oct 2016 15:59:05 +0200
parents 91dc1f0aceba
children ccd077c29f72
files src/main/java/de/intevation/lada/importer/laf/LafObjectListener.java
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/de/intevation/lada/importer/laf/LafObjectListener.java	Thu Oct 27 15:49:53 2016 +0200
+++ b/src/main/java/de/intevation/lada/importer/laf/LafObjectListener.java	Thu Oct 27 15:59:05 2016 +0200
@@ -17,7 +17,7 @@
     LafRawData.Probe currentProbe;
     LafRawData.Messung currentMessung;
     Map<String, List<ReportItem>> errors;
-    List<ReportItem> currentErrors;
+    ArrayList<ReportItem> currentErrors;
 
     private boolean hasDatenbasis = false;
     private boolean hasMessprogramm = false;
@@ -94,8 +94,9 @@
                 identifier = identifier == null
                     ? "not identified"
                     : identifier;
-                errors.put(identifier, currentErrors);
+                errors.put(identifier, (ArrayList)currentErrors.clone());
             }
+
             currentErrors.clear();
             currentProbe = null;
             hasDatenbasis = false;
@@ -134,7 +135,7 @@
                 ? currentProbe.getAttributes().get("HAUPTPROBENNUMMER")
                 : identifier;
             identifier = identifier == null ? "not identified" : identifier;
-            errors.put(identifier, currentErrors);
+            errors.put(identifier, (ArrayList)currentErrors.clone());
         }
         currentErrors.clear();
         currentProbe = null;
@@ -1475,7 +1476,7 @@
             err.setKey(ctx.getChild(0).toString());
             err.setValue(value);
             err.setCode(670);
-            currentErrors.add(err);;
+            currentErrors.add(err);
             return;
         }
         // TODO: Add to "ursprungsort"
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)