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 97a5606b11b19b45c042ce03f3db41965cb66b78
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Mon Jun 24 15:47:11 2019 +0200

    Optimise camel-bean to not lookup method annotations on JDK classes
---
 .../src/main/java/org/apache/camel/component/bean/BeanInfo.java     | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/components/camel-bean/src/main/java/org/apache/camel/component/bean/BeanInfo.java
 
b/components/camel-bean/src/main/java/org/apache/camel/component/bean/BeanInfo.java
index 4bbcf3e..0e54632 100644
--- 
a/components/camel-bean/src/main/java/org/apache/camel/component/bean/BeanInfo.java
+++ 
b/components/camel-bean/src/main/java/org/apache/camel/component/bean/BeanInfo.java
@@ -489,13 +489,17 @@ public class BeanInfo {
     }
 
     protected void collectParameterAnnotations(Class<?> c, Method m, 
List<Annotation>[] a) {
+        // because we are only looking for camel annotations then skip all 
stuff from JDKs
+        if (c.getName().startsWith("java")) {
+            return;
+        }
         try {
             Annotation[][] pa = c.getDeclaredMethod(m.getName(), 
m.getParameterTypes()).getParameterAnnotations();
             for (int i = 0; i < pa.length; i++) {
                 a[i].addAll(Arrays.asList(pa[i]));
             }
         } catch (NoSuchMethodException e) {
-            // no method with signature of m declared on c
+            // ignore no method with signature of m declared on c
         }
         for (Class<?> i : c.getInterfaces()) {
             collectParameterAnnotations(i, m, a);

Reply via email to