This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch ctr-mandatory in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/ctr-mandatory by this push: new 5fc072bcf28 CAMEL-19792: camel-core - PropertyBinding - Constructor args for beans should be mandatory lookup 5fc072bcf28 is described below commit 5fc072bcf28b7957016578e78b7376627e345c30 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Mon Aug 28 10:43:43 2023 +0200 CAMEL-19792: camel-core - PropertyBinding - Constructor args for beans should be mandatory lookup --- .../java/org/apache/camel/support/PropertyBindingSupportTest.java | 1 - .../java/org/apache/camel/support/PropertyBindingSupport.java | 8 +++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/core/camel-core/src/test/java/org/apache/camel/support/PropertyBindingSupportTest.java b/core/camel-core/src/test/java/org/apache/camel/support/PropertyBindingSupportTest.java index 569c10cb938..5c21ba511f4 100644 --- a/core/camel-core/src/test/java/org/apache/camel/support/PropertyBindingSupportTest.java +++ b/core/camel-core/src/test/java/org/apache/camel/support/PropertyBindingSupportTest.java @@ -26,7 +26,6 @@ import org.apache.camel.NoSuchBeanException; import org.apache.camel.PropertyBindingException; import org.apache.camel.spi.Injector; import org.apache.camel.spi.PropertiesComponent; -import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.*; diff --git a/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java b/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java index 222e3525e3c..3f2617fd6c2 100644 --- a/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java +++ b/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java @@ -1294,13 +1294,15 @@ public final class PropertyBindingSupport { } } } - if (val == null) { - val = camelContext.getTypeConverter().convertTo(paramType, param); - } // unquote text if (val instanceof String) { val = StringHelper.removeLeadingAndEndingQuotes((String) val); } + if (val != null) { + val = camelContext.getTypeConverter().tryConvertTo(paramType, val); + } else { + val = camelContext.getTypeConverter().convertTo(paramType, param); + } arr[i] = val; } return found.newInstance(arr);