changeset 316:2adf28ac7fe0

Stop parsing as soon as posible if laf content is not valid.
author Raimund Renkert <rrenkert@intevation.de>
date Wed, 21 Aug 2013 08:59:39 +0200
parents 79cbc672d8e4
children b73c16f2b87c
files src/main/java/de/intevation/lada/data/importer/LAFParser.java
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/de/intevation/lada/data/importer/LAFParser.java	Wed Aug 21 08:58:28 2013 +0200
+++ b/src/main/java/de/intevation/lada/data/importer/LAFParser.java	Wed Aug 21 08:59:39 2013 +0200
@@ -45,6 +45,9 @@
     public boolean parse(String laf)
     throws LAFParserException
     {
+        if (!laf.startsWith("%PROBE%\n")) {
+            throw new LAFParserException("No %PROBE% at the begining.");
+        }
         boolean parsed = false;
         while (laf.startsWith("%PROBE%\n")) {
             parsed = true;
@@ -69,9 +72,6 @@
                 producer.reset();
             }
         }
-        if (!parsed) {
-            throw new LAFParserException("No %PROBE% at the begining.");
-        }
         return parsed;
     }
 
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)