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/08 19:05:09 UTC

[camel] branch master updated (d6ac2b3 -> da9e4bd)

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

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


    from d6ac2b3  Camel-Hazelcast: Fixed Hazelcast-seda configuration test
     new 306fcbd  CAMEL-14263: camel-hazelcast should use source code generated configurer to avoid reflection configuration.
     new 6a8b8f8  CAMEL-14273: Binding properties using source code generated configurer classes should deal with if the setter method threw exception.
     new da9e4bd  Add ignite to git ignore folder

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../hazelcast/HazelcastDefaultComponent.java       |  2 ++
 components/camel-ignite/.gitignore                 |  1 +
 .../sql/stored/ProducerBatchInvalidTest.java       |  5 ++++-
 .../camel/support/PropertyBindingSupport.java      | 24 +++++++++++-----------
 4 files changed, 19 insertions(+), 13 deletions(-)
 create mode 100644 components/camel-ignite/.gitignore


[camel] 01/03: CAMEL-14263: camel-hazelcast should use source code generated configurer to avoid reflection configuration.

Posted by da...@apache.org.
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 306fcbdc3d4490deeeb0aa65446ad84420ac812e
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sun Dec 8 14:34:47 2019 +0100

    CAMEL-14263: camel-hazelcast should use source code generated configurer to avoid reflection configuration.
---
 .../org/apache/camel/component/hazelcast/HazelcastDefaultComponent.java | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/HazelcastDefaultComponent.java b/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/HazelcastDefaultComponent.java
index 54ec94a..300e7a0 100644
--- a/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/HazelcastDefaultComponent.java
+++ b/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/HazelcastDefaultComponent.java
@@ -81,6 +81,8 @@ public abstract class HazelcastDefaultComponent extends DefaultComponent {
             endpoint.setDefaultOperation(HazelcastOperation.getHazelcastOperation(defaultOperation));
         }
 
+        setProperties(endpoint, parameters);
+
         return endpoint;
     }
 


[camel] 02/03: CAMEL-14273: Binding properties using source code generated configurer classes should deal with if the setter method threw exception.

Posted by da...@apache.org.
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 6a8b8f83b32b46f6a017eecdb4608383d605492b
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sun Dec 8 15:00:03 2019 +0100

    CAMEL-14273: Binding properties using source code generated configurer classes should deal with if the setter method threw exception.
---
 .../sql/stored/ProducerBatchInvalidTest.java       |  5 ++++-
 .../camel/support/PropertyBindingSupport.java      | 24 +++++++++++-----------
 2 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/components/camel-sql/src/test/java/org/apache/camel/component/sql/stored/ProducerBatchInvalidTest.java b/components/camel-sql/src/test/java/org/apache/camel/component/sql/stored/ProducerBatchInvalidTest.java
index bf7fc6c..37fe02c 100644
--- a/components/camel-sql/src/test/java/org/apache/camel/component/sql/stored/ProducerBatchInvalidTest.java
+++ b/components/camel-sql/src/test/java/org/apache/camel/component/sql/stored/ProducerBatchInvalidTest.java
@@ -17,6 +17,7 @@
 package org.apache.camel.component.sql.stored;
 
 import org.apache.camel.FailedToCreateRouteException;
+import org.apache.camel.PropertyBindingException;
 import org.apache.camel.ResolveEndpointFailedException;
 import org.apache.camel.TypeConversionException;
 import org.apache.camel.builder.RouteBuilder;
@@ -69,7 +70,9 @@ public class ProducerBatchInvalidTest extends CamelTestSupport {
             fail("Should throw exception");
         } catch (FailedToCreateRouteException e) {
             ResolveEndpointFailedException refe = assertIsInstanceOf(ResolveEndpointFailedException.class, e.getCause());
-            TypeConversionException pbe = assertIsInstanceOf(TypeConversionException.class, refe.getCause());
+            PropertyBindingException pbe = assertIsInstanceOf(PropertyBindingException.class, refe.getCause());
+            assertEquals("batch", pbe.getPropertyName());
+            TypeConversionException tce = assertIsInstanceOf(TypeConversionException.class, pbe.getCause());
             assertEquals("[true, true]", pbe.getValue().toString());
         }
     }
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 d9c3b21..4d101c1 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
@@ -486,21 +486,21 @@ public final class PropertyBindingSupport {
                     valid = key.indexOf('.') == -1;
                 }
                 if (valid) {
-                    // GeneratedPropertyConfigurer works by invoking the methods directly but it does
-                    // not resolve property placeholders eventually defined in the value before invoking
-                    // the setter.
-                    if (value instanceof String) {
-                        value = camelContext.resolvePropertyPlaceholders((String) value);
-                    }
                     try {
+                        // GeneratedPropertyConfigurer works by invoking the methods directly but it does
+                        // not resolve property placeholders eventually defined in the value before invoking
+                        // the setter.
+                        if (value instanceof String) {
+                            value = camelContext.resolvePropertyPlaceholders((String) value);
+                        }
                         value = resolveValue(camelContext, target, key, value, ignoreCase, fluentBuilder, allowPrivateSetter);
+                        boolean hit = gen.configure(camelContext, target, key, value, ignoreCase);
+                        if (removeParameter && hit) {
+                            iter.remove();
+                            rc = true;
+                        }
                     } catch (Exception e) {
-                        throw new PropertyBindingException(target, e);
-                    }
-                    boolean hit = gen.configure(camelContext, target, key, value, ignoreCase);
-                    if (removeParameter && hit) {
-                        iter.remove();
-                        rc = true;
+                        throw new PropertyBindingException(target, key, value, e);
                     }
                 }
             }


[camel] 03/03: Add ignite to git ignore folder

Posted by da...@apache.org.
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 da9e4bd34ae73e899aeed76559526dd639f4ec7e
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sun Dec 8 19:09:27 2019 +0100

    Add ignite to git ignore folder
---
 components/camel-ignite/.gitignore | 1 +
 1 file changed, 1 insertion(+)

diff --git a/components/camel-ignite/.gitignore b/components/camel-ignite/.gitignore
new file mode 100644
index 0000000..25f33bd6
--- /dev/null
+++ b/components/camel-ignite/.gitignore
@@ -0,0 +1 @@
+ignite