Skip to content

Commit 7d45f2c

Browse files
lucapfmbenhassine
authored andcommitted
Use isQuoteCharacter instead of direct char comparison in DelimitedLineTokenizer
Issue #682
1 parent 98fba4a commit 7d45f2c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/transform/DelimitedLineTokenizer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2006-2018 the original author or authors.
2+
* Copyright 2006-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -222,7 +222,7 @@ private String substringWithTrimmedWhitespaceAndQuotesIfQuotesPresent(String lin
222222

223223
String value;
224224

225-
if ((line.length() >= 2) && (line.charAt(start) == quoteCharacter) && (line.charAt(start + len - 1) == quoteCharacter)) {
225+
if ((line.length() >= 2) && isQuoteCharacter(line.charAt(start)) && isQuoteCharacter(line.charAt(start + len - 1))) {
226226
int beginIndex = start + 1;
227227
int endIndex = len - 2;
228228
value = line.substring(beginIndex, beginIndex + endIndex);

0 commit comments

Comments
 (0)