This is an automated email from the ASF dual-hosted git repository.
jeremyross pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 88c6b22 CAMEL-17336: camel-jackson: useList has no effect (#6540)
88c6b22 is described below
commit 88c6b2239df5d36c955ed10b141d1fc92de5b02c
Author: Jeremy Ross <[email protected]>
AuthorDate: Tue Dec 14 12:35:24 2021 -0600
CAMEL-17336: camel-jackson: useList has no effect (#6540)
If an ObjectMapper from the registry is used, useList=true has no
effect.
---
.../apache/camel/component/jackson/AbstractJacksonDataFormat.java | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git
a/components/camel-jackson/src/main/java/org/apache/camel/component/jackson/AbstractJacksonDataFormat.java
b/components/camel-jackson/src/main/java/org/apache/camel/component/jackson/AbstractJacksonDataFormat.java
index 67f838d6..b338ca9 100644
---
a/components/camel-jackson/src/main/java/org/apache/camel/component/jackson/AbstractJacksonDataFormat.java
+++
b/components/camel-jackson/src/main/java/org/apache/camel/component/jackson/AbstractJacksonDataFormat.java
@@ -533,6 +533,10 @@ public abstract class AbstractJacksonDataFormat extends
ServiceSupport
@Override
protected void doStart() throws Exception {
+ if (useList) {
+ setCollectionType(ArrayList.class);
+ }
+
boolean objectMapperFoundRegistry = false;
if (objectMapper == null) {
// lookup if there is a single default mapper we can use
@@ -559,9 +563,6 @@ public abstract class AbstractJacksonDataFormat extends
ServiceSupport
}
if (!objectMapperFoundRegistry) {
- if (useList) {
- setCollectionType(ArrayList.class);
- }
if (include != null) {
JsonInclude.Include inc
=
getCamelContext().getTypeConverter().mandatoryConvertTo(JsonInclude.Include.class,
include);