This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch 13557 in repository https://gitbox.apache.org/repos/asf/camel.git
commit 4e5a84b9b8fc93a69b0b0dd884ff6ec3ea2bfd07 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Thu May 23 06:17:11 2019 +0200 CAMEL-13557: Add property binding support to make it convenient to configure components and whatnot. --- .../src/main/java/org/apache/camel/support/IntrospectionSupport.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/camel-support/src/main/java/org/apache/camel/support/IntrospectionSupport.java b/core/camel-support/src/main/java/org/apache/camel/support/IntrospectionSupport.java index 8e4ea5f..3585940 100644 --- a/core/camel-support/src/main/java/org/apache/camel/support/IntrospectionSupport.java +++ b/core/camel-support/src/main/java/org/apache/camel/support/IntrospectionSupport.java @@ -197,8 +197,9 @@ public final class IntrospectionSupport { // is it a setXXX method boolean validName = name.startsWith("set") && name.length() >= 4 && Character.isUpperCase(name.charAt(3)); - if (validName) { - return parameterCount == 1 && type.equals(Void.TYPE); + if (validName && parameterCount == 1) { + // a setXXX can also be a builder pattern so check for its return type is itself + return type.equals(Void.TYPE) || allowBuilderPattern && method.getDeclaringClass().isAssignableFrom(type); } // or if its a builder method if (allowBuilderPattern && parameterCount == 1 && method.getDeclaringClass().isAssignableFrom(type)) {