[Lada-commits] [PATCH] Persist errors intended to be shown to the user

Wald Commits scm-commit at wald.intevation.org
Thu Oct 27 15:59:23 CEST 2016


# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1477576745 -7200
# Node ID 628e0da7435a8f8d0be30027d0d7f163060452d9
# Parent  91dc1f0aceba28fc6270c3cd811421d89c85901d
Persist errors intended to be shown to the user.

The subsequent currentErrors.clear() actually deleted the errors.

diff -r 91dc1f0aceba -r 628e0da7435a src/main/java/de/intevation/lada/importer/laf/LafObjectListener.java
--- 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"


More information about the Lada-commits mailing list