Skip to content

Commit bf32161

Browse files
committed
Merge branch '2.18'
2 parents 8de137d + 3e04a3f commit bf32161

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

csv/src/main/java/tools/jackson/dataformat/csv/CsvParser.java

+4-8
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,7 @@ protected void _readHeaderLine() throws JacksonException {
811811
int newColumnCount = newSchema.size();
812812
if (newColumnCount < 2) { // 1 just because we may get 'empty' header name
813813
String first = (newColumnCount == 0) ? "" : newSchema.columnName(0).trim();
814-
if (first.length() == 0) {
814+
if (first.isEmpty()) {
815815
_reportCsvReadError("Empty header line: can not bind data");
816816
}
817817
}
@@ -1320,11 +1320,10 @@ public JacksonException _wrapIOFailure(IOException e) {
13201320
protected void _setSchema(CsvSchema schema)
13211321
{
13221322
if (schema == null) {
1323-
schema = EMPTY_SCHEMA;
1323+
_schema = EMPTY_SCHEMA;
13241324
} else {
13251325
_schema = schema;
1326-
String str = _schema.getNullValueString();
1327-
_nullValue = str;
1326+
_nullValue = _schema.getNullValueString();
13281327
}
13291328
_columnCount = _schema.size();
13301329
_reader.setSchema(_schema);
@@ -1370,9 +1369,6 @@ protected boolean _isNullValue(String value) {
13701369
if (_cfgEmptyStringAsNull && value.isEmpty()) {
13711370
return true;
13721371
}
1373-
if (_cfgEmptyUnquotedStringAsNull && value.isEmpty() && !_reader.isCurrentTokenQuoted()) {
1374-
return true;
1375-
}
1376-
return false;
1372+
return _cfgEmptyUnquotedStringAsNull && value.isEmpty() && !_reader.isCurrentTokenQuoted();
13771373
}
13781374
}

release-notes/CREDITS-2.x

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ text dataformats project, version 2.x
55
(note: for older credits, check out release notes for 1.x versions)
66

77
* Jonas Konrad (@yawkat): author of TOML module
8-
* Tatu Saloranta, [email protected]: author of CSV, Properties and YAML modules
8+
* Tatu Saloranta (@cowtowncoder): author of CSV, Properties and YAML modules
9+
* PJ Fanning (@pjfanning): active contributor to most modules
910

1011
--------------------------------------------------------------------------------
1112
Credits for specific contributions
@@ -197,6 +198,7 @@ PJ Fanning (pjfanning@github)
197198
(2.14.0)
198199
#390: (yaml) Upgrade to Snakeyaml 2.0 (resolves CVE-2022-1471)
199200
(2.15.0)
201+
... and many, many more not listed here
200202

201203
Falk Hanisch (mrpiggi@github)
202204
#288: Caching conflict when creating CSV schemas with different views

release-notes/VERSION-2.x

+5
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ Active Maintainers:
2222
fields (foo,,bar vs. foo,"",bar)
2323
(contributed by David P)
2424

25+
2.17.2 (not yet released)
26+
27+
#481: (csv) Fix issue in `setSchema()`
28+
(contributed by @pjfanning)
29+
2530
2.17.1 (04-May-2024)
2631

2732
No changes since 2.17.0

0 commit comments

Comments
 (0)