comparison backend/src/main/java/org/dive4elements/river/importer/parsers/WaterlevelDifferencesParser.java @ 6753:e032e9e6d09e

issue1433: Include trailing empty strings in stringsplit, this prevents emission of false warnings.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Tue, 06 Aug 2013 11:06:25 +0200
parents f275aae00c55
children ad2fdc34910a
comparison
equal deleted inserted replaced
6752:f275aae00c55 6753:e032e9e6d09e
201 201
202 /** Handle one line of data, add one value for all columns. 202 /** Handle one line of data, add one value for all columns.
203 * @param line the line to parse 203 * @param line the line to parse
204 */ 204 */
205 private void handleDataLine(String line) { 205 private void handleDataLine(String line) {
206 String[] cols = line.split(SEPERATOR_CHAR); 206 // Split by separator, do not exclude trailing empty string.
207 String[] cols = line.split(SEPERATOR_CHAR, -1);
207 208
208 if (cols == null || cols.length < 2) { 209 if (cols == null || cols.length < 2) {
209 log.warn("skip invalid waterlevel-diff line: '" + line + "'"); 210 log.warn("skip invalid waterlevel-diff line: '" + line + "'");
210 return; 211 return;
211 } 212 }

http://dive4elements.wald.intevation.org