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 de8e3ef  CAMEL-13846: Make PropertyBindingSupport a fluent builder only
de8e3ef is described below

commit de8e3ef72ef75cd6aa3a93b0016ed5bd5aca54f4
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Fri Aug 9 16:27:46 2019 +0200

    CAMEL-13846: Make PropertyBindingSupport a fluent builder only
---
 .../java/org/apache/camel/support/PropertyBindingSupport.java    | 9 ++++-----
 1 file changed, 4 insertions(+), 5 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 eec9564..5edf7f4 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
@@ -18,6 +18,7 @@ package org.apache.camel.support;
 
 import java.lang.reflect.Method;
 import java.util.Collections;
+import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.LinkedHashMap;
@@ -60,8 +61,6 @@ public final class PropertyBindingSupport {
      */
     public static class Builder {
 
-        // TODO: add fluent for camel context, target, properties map, 
property key/value
-
         private CamelContext camelContext;
         private Object target;
         private Map<String, Object> properties;
@@ -253,10 +252,10 @@ public final class PropertyBindingSupport {
             org.apache.camel.util.ObjectHelper.notNull(key, "key");
             org.apache.camel.util.ObjectHelper.notNull(value, "value");
 
-            Map<String, Object> properties = Collections.singletonMap(key, 
value);
+            Map<String, Object> properties = new HashMap<>(1);
+            properties.put(key, value);
 
-            // do not remove parameters as this is a single property
-            return doBindProperties(camelContext, target, properties, 
optionPrefix, ignoreCase, false, mandatory,
+            return doBindProperties(camelContext, target, properties, 
optionPrefix, ignoreCase, removeParameters, mandatory,
                     nesting, deepNesting, fluentBuilder, allowPrivateSetter, 
reference, placeholder);
         }
 

Reply via email to