You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2020/08/06 15:00:07 UTC

[camel] branch master updated: Revert "camel-core - Avoid using reflection when setting properties."

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

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


The following commit(s) were added to refs/heads/master by this push:
     new d4a8b27  Revert "camel-core - Avoid using reflection when setting properties."
d4a8b27 is described below

commit d4a8b27b3b9e70e412d5525ad8ff3ec6883b5d22
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Aug 6 16:59:30 2020 +0200

    Revert "camel-core - Avoid using reflection when setting properties."
    
    This reverts commit f4282960bda946540bec0597b0830158d9f68bd3.
---
 .../main/java/org/apache/camel/component/cron/CronComponent.java | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/components/camel-cron/src/main/java/org/apache/camel/component/cron/CronComponent.java b/components/camel-cron/src/main/java/org/apache/camel/component/cron/CronComponent.java
index ae67825..c48356c 100644
--- a/components/camel-cron/src/main/java/org/apache/camel/component/cron/CronComponent.java
+++ b/components/camel-cron/src/main/java/org/apache/camel/component/cron/CronComponent.java
@@ -45,13 +45,16 @@ public class CronComponent extends DefaultComponent {
     public Endpoint createEndpoint(String uri, String remaining, Map<String, Object> properties) throws Exception {
         CamelCronConfiguration configuration = new CamelCronConfiguration();
         configuration.setName(remaining);
+        setProperties(configuration, properties);
+        validate(configuration);
 
         Endpoint delegate = this.service.createEndpoint(configuration);
         CronEndpoint cronEndpoint = new CronEndpoint(uri, this, delegate, configuration);
-        setProperties(cronEndpoint, properties);
 
-        // validate after options has been set
-        validate(configuration);
+        if (properties.size() > 0) {
+            // Additional endpoint properties present
+            setProperties(cronEndpoint, properties);
+        }
 
         return cronEndpoint;
     }