This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch CAMEL-15224
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 0c3c289a6a598b007a718f05aac15c801e1ffa27
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Mon Jun 22 13:35:29 2020 +0200

    CAMEL-15224: camel-api-component - Avoid reflection when configured nested 
configuration classes.
---
 .../apache/camel/support/component/ApiMethodPropertiesHelper.java | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git 
a/core/camel-support/src/main/java/org/apache/camel/support/component/ApiMethodPropertiesHelper.java
 
b/core/camel-support/src/main/java/org/apache/camel/support/component/ApiMethodPropertiesHelper.java
index 3c87502..8a5449e 100644
--- 
a/core/camel-support/src/main/java/org/apache/camel/support/component/ApiMethodPropertiesHelper.java
+++ 
b/core/camel-support/src/main/java/org/apache/camel/support/component/ApiMethodPropertiesHelper.java
@@ -99,6 +99,14 @@ public abstract class ApiMethodPropertiesHelper<C> {
         if (configurer instanceof PropertyConfigurerGetter) {
             PropertyConfigurerGetter getter = (PropertyConfigurerGetter) 
configurer;
             names = getter.getAllOptions(endpointConfiguration).keySet();
+            for (String name : names) {
+                Object value = getter.getOptionValue(endpointConfiguration, 
name, true);
+                if (value != null) {
+                    // lower case the first letter which is what the 
properties map expects
+                    String key = Character.toLowerCase(name.charAt(0)) + 
name.substring(1);
+                    properties.put(key, value);
+                }
+            }
         } else {
             
context.adapt(ExtendedCamelContext.class).getBeanIntrospection().getProperties(endpointConfiguration,
 properties, null, false);
             names = properties.keySet();

Reply via email to