[PATCH] BedHeightSingleParser: fix no-data-line detection

Wald Commits scm-commit at wald.intevation.org
Wed Oct 23 09:59:56 CEST 2013


# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1382515186 -7200
# Node ID cf8d37ed4d34b2f20e9fe2ad10075498b74eb395
# Parent  f26e7d386d8ca97f8fe3c04e00e9f60d3de7c5cd
BedHeightSingleParser: fix no-data-line detection.

diff -r f26e7d386d8c -r cf8d37ed4d34 backend/src/main/java/org/dive4elements/river/importer/parsers/BedHeightSingleParser.java
--- a/backend/src/main/java/org/dive4elements/river/importer/parsers/BedHeightSingleParser.java	Wed Oct 23 08:20:11 2013 +0200
+++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/BedHeightSingleParser.java	Wed Oct 23 09:59:46 2013 +0200
@@ -62,9 +62,14 @@
         }
 
         // Handle gaps like "10,0;;;;;".
-        if (values.length == 1) {
+        if (values.length <= 2) {
             // Do not import line without useful data
-            return;
+            if (values.length < 2) {
+                return;
+            }
+            if (values[1].length() == 0) {
+                return;
+            }
         }
 
         Double height = null;


More information about the Dive4elements-commits mailing list