comparison flys-backend/src/main/java/de/intevation/flys/importer/parsers/BedHeightParser.java @ 5327:5376aa576604

Allow empty years in bed height parser.
author Sascha L. Teichmann <teichmann@intevation.de>
date Fri, 15 Mar 2013 19:35:46 +0100
parents 3ddf5843ede3
children 765013c837b1
comparison
equal deleted inserted replaced
5326:555835611acd 5327:5376aa576604
201 protected boolean handleMetaYear(ImportBedHeight obj, String line) { 201 protected boolean handleMetaYear(ImportBedHeight obj, String line) {
202 Matcher m = META_YEAR.matcher(line); 202 Matcher m = META_YEAR.matcher(line);
203 203
204 if (m.matches()) { 204 if (m.matches()) {
205 String tmp = m.group(1); 205 String tmp = m.group(1);
206 206 if (tmp.length() > 0) {
207 try { 207 obj.setYear(Integer.parseInt(tmp));
208 obj.setYear(Integer.valueOf(tmp)); 208 }
209 return true; 209 else {
210 } 210 log.warn("BHP: No year given.");
211 catch (NumberFormatException e) { 211 }
212 log.warn("BHP: Error while parsing year!", e); 212 return true;
213 }
214 } 213 }
215 214
216 return false; 215 return false;
217 } 216 }
218 217

http://dive4elements.wald.intevation.org