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 5aaa02dda44f774240fb7a02e2e8e52ff0c38077 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Mon Jun 17 05:18:09 2019 +0200 Regen --- .../apache/camel/support/IntrospectionSupport.java | 20 +++++++++++++------- .../src/main/resources/application.properties | 2 +- 2 files changed, 14 insertions(+), 8 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 c2770e3..e82255f 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 @@ -750,6 +750,10 @@ public final class IntrospectionSupport { public static Set<Method> findSetterMethods(Class<?> clazz, String name, boolean allowBuilderPattern) { Set<Method> candidates = new LinkedHashSet<>(); + boolean allowPrivate = name.startsWith("#private#"); + if (allowPrivate) { + name = name.substring(9); + } // Build the method name String builderName = "with" + StringHelper.capitalize(name, true); String builderName2 = StringHelper.capitalize(name, true); @@ -759,15 +763,17 @@ public final class IntrospectionSupport { // Since Object.class.isInstance all the objects, // here we just make sure it will be add to the bottom of the set. Method objectSetMethod = null; - Method[] methods = clazz.getMethods(); + Method[] methods = allowPrivate ? clazz.getDeclaredMethods() : clazz.getMethods(); for (Method method : methods) { boolean validName = method.getName().equals(setName) || allowBuilderPattern && method.getName().equals(builderName) || allowBuilderPattern && method.getName().equals(builderName2); - if (validName && isSetter(method, allowBuilderPattern)) { - Class<?>[] params = method.getParameterTypes(); - if (params[0].equals(Object.class)) { - objectSetMethod = method; - } else { - candidates.add(method); + if (validName) { + if (isSetter(method, allowBuilderPattern)) { + Class<?>[] params = method.getParameterTypes(); + if (params[0].equals(Object.class)) { + objectSetMethod = method; + } else { + candidates.add(method); + } } } } diff --git a/examples/camel-example-main/src/main/resources/application.properties b/examples/camel-example-main/src/main/resources/application.properties index 334af88..cd2942e 100644 --- a/examples/camel-example-main/src/main/resources/application.properties +++ b/examples/camel-example-main/src/main/resources/application.properties @@ -43,7 +43,7 @@ camel.component.quartz2.start-delayed-seconds = 3 ### camel.component.properties.environment-variable-mode=1 camel.component.jms.configuration.connectionFactory=#class:org.apache.activemq.artemis.jms.client.ActiveMQJMSConnectionFactory -camel.component.jms.configuration.connectionFactory.brokerUrl=localhost:61616 +camel.component.jms.configuration.connectionFactory.#private#brokerURL=tcp://localhost:61616 # properties used in the route myCron = 0/2 * * * * ?