Skip to content

Commit 0671a21

Browse files
authored
CAMEL-23031: Fix regression with csvFormat initialization (#21535)
1 parent 1bc7f2f commit 0671a21

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

components/camel-csv/src/main/java/org/apache/camel/dataformat/csv/CsvDataFormat.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,16 @@ public Object unmarshal(Exchange exchange, Object body) throws Exception {
104104
@Override
105105
protected void doInit() throws Exception {
106106
super.doInit();
107-
marshaller = marshallerFactory.create(getActiveFormat(), this);
108-
unmarshaller = CsvUnmarshaller.create(getActiveFormat(), this);
109107

110108
if (csvFormat == null && format != null) {
111109
csvFormat = CSVFormat.valueOf(format);
112110
}
113111
if (csvFormat == null) {
114112
csvFormat = CSVFormat.DEFAULT;
115113
}
114+
115+
marshaller = marshallerFactory.create(getActiveFormat(), this);
116+
unmarshaller = CsvUnmarshaller.create(getActiveFormat(), this);
116117
}
117118

118119
@Override
@@ -229,6 +230,10 @@ public CSVFormat getCsvFormat() {
229230
return csvFormat;
230231
}
231232

233+
public void setCsvFormat(CSVFormat csvFormat) {
234+
this.csvFormat = csvFormat;
235+
}
236+
232237
public String getFormat() {
233238
return format;
234239
}

0 commit comments

Comments
 (0)