davsclaus commented on code in PR #17091:
URL: https://github.com/apache/camel/pull/17091#discussion_r1947927395
##########
components/camel-csv/src/main/java/org/apache/camel/dataformat/csv/CsvMarshaller.java:
##########
@@ -53,15 +53,15 @@ protected CsvMarshaller(CSVFormat format) {
public static CsvMarshaller create(CSVFormat format, CsvDataFormat
dataFormat) {
org.apache.camel.util.ObjectHelper.notNull(format, "CSV format");
org.apache.camel.util.ObjectHelper.notNull(dataFormat, "CSV data
format");
+ // Get header columns before potential clearing
+ String[] headers = format.getHeader();
// If we don't want the header record, clear it
if (format.getSkipHeaderRecord()) {
format = format.withHeader((String[]) null);
}
- String header = dataFormat.getHeader();
- if (header != null && !header.isEmpty()) {
- String[] columns = header.split(",");
- return new FixedColumnsMarshaller(format, columns);
+ if (headers != null && headers .length != 0) {
Review Comment:
There is a space here that should be removed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]