File tree 1 file changed +5
-9
lines changed
csv/src/main/java/com/fasterxml/jackson/dataformat/csv
1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -498,14 +498,13 @@ public void setCodec(ObjectCodec c) {
498
498
}
499
499
500
500
@ Override
501
- public void setSchema (FormatSchema schema )
501
+ public void setSchema (final FormatSchema schema )
502
502
{
503
503
if (schema instanceof CsvSchema ) {
504
504
_schema = (CsvSchema ) schema ;
505
- String str = _schema .getNullValueString ();
506
- _nullValue = str ;
505
+ _nullValue = _schema .getNullValueString ();
507
506
} else if (schema == null ) {
508
- schema = EMPTY_SCHEMA ;
507
+ _schema = EMPTY_SCHEMA ;
509
508
} else {
510
509
super .setSchema (schema );
511
510
}
@@ -924,7 +923,7 @@ protected void _readHeaderLine() throws IOException {
924
923
int newColumnCount = newSchema .size ();
925
924
if (newColumnCount < 2 ) { // 1 just because we may get 'empty' header name
926
925
String first = (newColumnCount == 0 ) ? "" : newSchema .columnName (0 ).trim ();
927
- if (first .length () == 0 ) {
926
+ if (first .isEmpty () ) {
928
927
_reportCsvMappingError ("Empty header line: can not bind data" );
929
928
}
930
929
}
@@ -1468,9 +1467,6 @@ protected boolean _isNullValue(String value) {
1468
1467
if (_cfgEmptyStringAsNull && value .isEmpty ()) {
1469
1468
return true ;
1470
1469
}
1471
- if (_cfgEmptyUnquotedStringAsNull && value .isEmpty () && !_reader .isCurrentTokenQuoted ()) {
1472
- return true ;
1473
- }
1474
- return false ;
1470
+ return _cfgEmptyUnquotedStringAsNull && value .isEmpty () && !_reader .isCurrentTokenQuoted ();
1475
1471
}
1476
1472
}
You can’t perform that action at this time.
0 commit comments