Skip to content

Commit 5206b2a

Browse files
committed
[CSV-169] The null string should be case-sensitive when reading records. Also simplify branch test.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1725358 13f79535-47bb-0310-9956-ffa450edef68
1 parent 446eaf8 commit 5206b2a

2 files changed

Lines changed: 2 additions & 5 deletions

File tree

src/changes/changes.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
<release version="1.3" date="2015-MM-DD" description="Feature and bug fix release">
4242
<action issue="CSV-153" type="update" dev="britter" due-to="Wren">CSVPrinter doesn't skip creation of header record if skipHeaderRecord is set to true</action>
4343
<action issue="CSV-159" type="add" dev="ggregory" due-to="Yamil Medina">Add IgnoreCase option for accessing header names</action>
44+
<action issue="CSV-169" type="add" dev="ggregory" due-to="Gary Gregory">The null string should be case-sensitive when reading records</action>
4445
</release>
4546
<release version="1.2" date="2015-08-24" description="Feature and bug fix release">
4647
<action issue="CSV-145" type="fix" dev="ggregory" due-to="Frank Ulbricht">CSVFormat.with* methods clear the header comments</action>

src/main/java/org/apache/commons/csv/CSVParser.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -289,11 +289,7 @@ public CSVParser(final Reader reader, final CSVFormat format, final long charact
289289
private void addRecordValue() {
290290
final String input = this.reusableToken.content.toString();
291291
final String nullString = this.format.getNullString();
292-
if (nullString == null) {
293-
this.record.add(input);
294-
} else {
295-
this.record.add(input.equalsIgnoreCase(nullString) ? null : input);
296-
}
292+
this.record.add(input.equals(nullString) ? null : input);
297293
}
298294

299295
/**

0 commit comments

Comments
 (0)