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 2019/12/07 20:54:24 UTC

[camel] 08/08: CAMEL-14263: camel-zookeeper should use source code generated configurer to avoid reflection configuration.

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

commit ce7e7fbcd1d4bdf518d4b4634bda426413c8c174
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sat Dec 7 21:53:44 2019 +0100

    CAMEL-14263: camel-zookeeper should use source code generated configurer to avoid reflection configuration.
---
 .../apache/camel/component/zookeeper/ZooKeeperComponent.java   | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperComponent.java b/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperComponent.java
index 04f37ed..2483993 100644
--- a/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperComponent.java
+++ b/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperComponent.java
@@ -33,7 +33,7 @@ import org.apache.camel.support.DefaultComponent;
 public class ZooKeeperComponent extends DefaultComponent {
 
     @Metadata(label = "advanced")
-    private ZooKeeperConfiguration configuration;
+    private ZooKeeperConfiguration configuration = new ZooKeeperConfiguration();
 
     public ZooKeeperComponent() {
     }
@@ -50,9 +50,10 @@ public class ZooKeeperComponent extends DefaultComponent {
 
         ZooKeeperConfiguration config = getConfiguration().copy();
         extractConfigFromUri(uri, config);
-        setProperties(config, parameters);
 
-        return new ZooKeeperEndpoint(uri, this, config);
+        Endpoint endpoint = new ZooKeeperEndpoint(uri, this, config);
+        setProperties(endpoint, parameters);
+        return endpoint;
     }
 
     private void extractConfigFromUri(String remaining, ZooKeeperConfiguration config) throws URISyntaxException {
@@ -65,9 +66,6 @@ public class ZooKeeperComponent extends DefaultComponent {
     }
 
     public ZooKeeperConfiguration getConfiguration() {
-        if (configuration == null) {
-            configuration = new ZooKeeperConfiguration();
-        }
         return configuration;
     }