This is an automated email from the ASF dual-hosted git repository. davsclaus 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 19dc26b5222 CAMEL-20688: Add support for array types for @PropertyInject using a separator 19dc26b5222 is described below commit 19dc26b52226a5f1b3240e42ae924ddf99b27fd5 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Thu Apr 18 21:30:28 2024 +0200 CAMEL-20688: Add support for array types for @PropertyInject using a separator --- .../camel/main/injection/AnnotationDependencyInjection.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/injection/AnnotationDependencyInjection.java b/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/injection/AnnotationDependencyInjection.java index 4e5edf2a880..6229d612068 100644 --- a/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/injection/AnnotationDependencyInjection.java +++ b/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/injection/AnnotationDependencyInjection.java @@ -222,7 +222,8 @@ public final class AnnotationDependencyInjection { Value value = field.getAnnotation(Value.class); if (value != null) { ReflectionHelper.setField(field, bean, - helper.getInjectionPropertyValue(field.getType(), value.value(), null, null, bean, beanName)); + helper.getInjectionPropertyValue(field.getType(), field.getGenericType(), value.value(), null, null, + null, bean, beanName)); } } @@ -288,8 +289,13 @@ public final class AnnotationDependencyInjection { } ConfigProperty cp = field.getAnnotation(ConfigProperty.class); if (cp != null) { + String df = cp.defaultValue(); + if (ConfigProperty.UNCONFIGURED_VALUE.equals(df)) { + df = null; + } ReflectionHelper.setField(field, bean, - helper.getInjectionPropertyValue(field.getType(), cp.name(), cp.defaultValue(), null, bean, beanName)); + helper.getInjectionPropertyValue(field.getType(), field.getGenericType(), cp.name(), df, null, null, + bean, beanName)); } }