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 @@ -509,14 +509,13 @@ public void setCodec(ObjectCodec c) {
509
509
}
510
510
511
511
@ Override
512
- public void setSchema (FormatSchema schema )
512
+ public void setSchema (final FormatSchema schema )
513
513
{
514
514
if (schema instanceof CsvSchema ) {
515
515
_schema = (CsvSchema ) schema ;
516
- String str = _schema .getNullValueString ();
517
- _nullValue = str ;
516
+ _nullValue = _schema .getNullValueString ();
518
517
} else if (schema == null ) {
519
- schema = EMPTY_SCHEMA ;
518
+ _schema = EMPTY_SCHEMA ;
520
519
} else {
521
520
super .setSchema (schema );
522
521
}
@@ -931,7 +930,7 @@ protected void _readHeaderLine() throws IOException {
931
930
int newColumnCount = newSchema .size ();
932
931
if (newColumnCount < 2 ) { // 1 just because we may get 'empty' header name
933
932
String first = (newColumnCount == 0 ) ? "" : newSchema .columnName (0 ).trim ();
934
- if (first .length () == 0 ) {
933
+ if (first .isEmpty () ) {
935
934
_reportCsvMappingError ("Empty header line: can not bind data" );
936
935
}
937
936
}
@@ -1475,9 +1474,6 @@ protected boolean _isNullValue(String value) {
1475
1474
if (_cfgEmptyStringAsNull && value .isEmpty ()) {
1476
1475
return true ;
1477
1476
}
1478
- if (_cfgEmptyUnquotedStringAsNull && value .isEmpty () && !_reader .isCurrentTokenQuoted ()) {
1479
- return true ;
1480
- }
1481
- return false ;
1477
+ return _cfgEmptyUnquotedStringAsNull && value .isEmpty () && !_reader .isCurrentTokenQuoted ();
1482
1478
}
1483
1479
}
You can’t perform that action at this time.
0 commit comments