RESOLVED - issue BATCH-376: Problem with DelimitedLineTokenizer and empty quoted value

http://jira.springframework.org/browse/BATCH-376
This commit is contained in:
robokaso
2008-02-22 10:57:41 +00:00
parent 54bbd4752d
commit 455bfe2fab
2 changed files with 191 additions and 179 deletions

View File

@@ -164,7 +164,12 @@ public class DelimitedLineTokenizer extends AbstractLineTokenizer {
String value = string.trim();
if (isQuoted(value)) {
value = StringUtils.replace(value, "" + quoteCharacter + quoteCharacter, "" + quoteCharacter);
string = value.substring(1, value.length() - 1);
int endLength = value.length() - 1;
// used to deal with empty quoted values
if(endLength == 0) {
endLength = 1;
}
string = value.substring(1, endLength);
}
return string;
}