You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2022/04/06 13:56:43 UTC

[camel] branch main updated: CAMEL-17916: Make BeanInfo handle Quarkus Arc Client Proxy generated classes

This is an automated email from the ASF dual-hosted git repository.

jamesnetherton pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new e7a1e9abcc8 CAMEL-17916: Make BeanInfo handle Quarkus Arc Client Proxy generated classes
e7a1e9abcc8 is described below

commit e7a1e9abcc8199594a9ed7de6dcea2a406984156
Author: James Netherton <ja...@gmail.com>
AuthorDate: Wed Apr 6 13:58:48 2022 +0100

    CAMEL-17916: Make BeanInfo handle Quarkus Arc Client Proxy generated classes
---
 .../src/main/java/org/apache/camel/component/bean/BeanInfo.java       | 4 +++-
 1 file changed, 3 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 acbdba209d5..bcf117ff9d6 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
@@ -64,6 +64,7 @@ public class BeanInfo {
     private static final String CGLIB_CLASS_SEPARATOR = "$$";
     private static final String CGLIB_METHOD_MARKER = "CGLIB$";
     private static final String BYTE_BUDDY_METHOD_MARKER = "$accessor$";
+    private static final String CLIENT_PROXY_SUFFIX = "_ClientProxy";
     private static final String[] EXCLUDED_METHOD_NAMES = new String[] {
             "clone", "equals", "finalize", "getClass", "hashCode", "notify", "notifyAll", "wait", // java.lang.Object
             "getInvocationHandler", "getProxyClass", "isProxyClass", "newProxyInstance" // java.lang.Proxy
@@ -1138,7 +1139,8 @@ public class BeanInfo {
     }
 
     private static Class<?> getTargetClass(Class<?> clazz) {
-        if (clazz != null && clazz.getName().contains(CGLIB_CLASS_SEPARATOR)) {
+        if (clazz != null
+                && (clazz.getName().contains(CGLIB_CLASS_SEPARATOR) || clazz.getName().endsWith(CLIENT_PROXY_SUFFIX))) {
             Class<?> superClass = clazz.getSuperclass();
             if (superClass != null && !Object.class.equals(superClass)) {
                 return superClass;