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/06/26 20:45:56 UTC

[camel] 01/02: CAMEL-13683: Fixed issue in PropertyBindingSupport

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 8394722164b1fc363ad2826e46e27c6175ef0876
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Wed Jun 26 18:23:37 2019 +0200

    CAMEL-13683: Fixed issue in PropertyBindingSupport
---
 .../apache/camel/support/PropertyBindingSupport.java    | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

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 0d32d91..f41d860 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
@@ -464,15 +464,16 @@ public final class PropertyBindingSupport {
      * @param ignoreCase    whether to ignore case for property keys
      */
     public static void bindMandatoryProperty(CamelContext camelContext, Object target, String name, Object value, boolean ignoreCase) {
-        try {
-            if (target != null && name != null) {
-                boolean bound = setProperty(camelContext, target, name, value, true, ignoreCase, true, true, true, true, true, true);
-                if (!bound) {
-                    throw new PropertyBindingException(target, name);
-                }
+        boolean bound;
+        if (target != null && name != null) {
+            try {
+                bound = setProperty(camelContext, target, name, value, true, ignoreCase, true, true, true, true, true, true);
+            } catch (Exception e) {
+                throw new PropertyBindingException(target, name, e);
+            }
+            if (!bound) {
+                throw new PropertyBindingException(target, name);
             }
-        } catch (Exception e) {
-            throw new PropertyBindingException(target, name, e);
         }
     }