You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "rastislavpapp (via GitHub)" <gi...@apache.org> on 2023/02/16 08:38:50 UTC

[GitHub] [camel] rastislavpapp opened a new pull request, #9359: CAMEL-19049 - unwrap aries proxy & bytebuddy proxy classes when introspecting

rastislavpapp opened a new pull request, #9359:
URL: https://github.com/apache/camel/pull/9359

   Fixes problem introduced in CAMEL-18411 in `BeanInfo` class, in 3.14.x, where methods from synthetic classes are no longer considered as overriding the original methods (via a change in the `#findMostSpecificOverride` method). 
   
   This causes ambiguity when trying to invoke them. I'm mainly concerned about usage in Karaf, where the proxy class is created via aries-proxy. For simplicity, test case added uses bytebuddy.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] rastislavpapp commented on a diff in pull request #9359: CAMEL-19049 - unwrap aries proxy & bytebuddy proxy classes when introspecting

Posted by "rastislavpapp (via GitHub)" <gi...@apache.org>.
rastislavpapp commented on code in PR #9359:
URL: https://github.com/apache/camel/pull/9359#discussion_r1108173292


##########
components/camel-bean/src/main/java/org/apache/camel/component/bean/BeanInfo.java:
##########
@@ -63,7 +63,9 @@ public class BeanInfo {
     private static final Logger LOG = LoggerFactory.getLogger(BeanInfo.class);
     private static final String CGLIB_CLASS_SEPARATOR = "$$";
     private static final String CGLIB_METHOD_MARKER = "CGLIB$";
+    private static final String BYTE_BUDDY_CLASS_SEPARATOR = "$ByteBuddy$";
     private static final String BYTE_BUDDY_METHOD_MARKER = "$accessor$";
+    private static final String ARIES_PROXY_CLASS_PREFIX = "Proxy";

Review Comment:
   The class name of aries-proxy class is created as:
   ```
   className = "Proxy" + AbstractWovenProxyAdapter.getSanitizedUUIDString();
   ```
   So it would be possible to create a regex for it, if we wanted to be more precise. But the class name is created in default java package, so it should be pretty resistant to real world user classes. At least that was how I thought about it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] davsclaus commented on a diff in pull request #9359: CAMEL-19049 - unwrap aries proxy & bytebuddy proxy classes when introspecting

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on code in PR #9359:
URL: https://github.com/apache/camel/pull/9359#discussion_r1108168752


##########
components/camel-bean/src/main/java/org/apache/camel/component/bean/BeanInfo.java:
##########
@@ -63,7 +63,9 @@ public class BeanInfo {
     private static final Logger LOG = LoggerFactory.getLogger(BeanInfo.class);
     private static final String CGLIB_CLASS_SEPARATOR = "$$";
     private static final String CGLIB_METHOD_MARKER = "CGLIB$";
+    private static final String BYTE_BUDDY_CLASS_SEPARATOR = "$ByteBuddy$";
     private static final String BYTE_BUDDY_METHOD_MARKER = "$accessor$";
+    private static final String ARIES_PROXY_CLASS_PREFIX = "Proxy";

Review Comment:
   This is not accepted as Proxy has no special marker that would cause problems for end users that have normal classes that are named `ProxyMyWorld` or something.
   
   Why does Aries not use a special marker like the others do



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] davsclaus commented on pull request #9359: CAMEL-19049 - unwrap aries proxy & bytebuddy proxy classes when introspecting

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on PR #9359:
URL: https://github.com/apache/camel/pull/9359#issuecomment-1432713653

   Can you test with 3.18, or 3.20 before special PRs against an old Camel version.
   We have fixed stuff and its likely there is another existing PR that can be backported instead.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-19049 - unwrap aries proxy & bytebuddy proxy classes when introspecting [camel]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus closed pull request #9359: CAMEL-19049 - unwrap aries proxy & bytebuddy proxy classes when introspecting
URL: https://github.com/apache/camel/pull/9359


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] rastislavpapp commented on a diff in pull request #9359: CAMEL-19049 - unwrap aries proxy & bytebuddy proxy classes when introspecting

Posted by "rastislavpapp (via GitHub)" <gi...@apache.org>.
rastislavpapp commented on code in PR #9359:
URL: https://github.com/apache/camel/pull/9359#discussion_r1108214988


##########
components/camel-bean/src/main/java/org/apache/camel/component/bean/BeanInfo.java:
##########
@@ -63,7 +63,9 @@ public class BeanInfo {
     private static final Logger LOG = LoggerFactory.getLogger(BeanInfo.class);
     private static final String CGLIB_CLASS_SEPARATOR = "$$";
     private static final String CGLIB_METHOD_MARKER = "CGLIB$";
+    private static final String BYTE_BUDDY_CLASS_SEPARATOR = "$ByteBuddy$";
     private static final String BYTE_BUDDY_METHOD_MARKER = "$accessor$";
+    private static final String ARIES_PROXY_CLASS_PREFIX = "Proxy";

Review Comment:
   Or the check could be done via reflection, checking for some other markers.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] oscerd commented on a diff in pull request #9359: CAMEL-19049 - unwrap aries proxy & bytebuddy proxy classes when introspecting

Posted by "oscerd (via GitHub)" <gi...@apache.org>.
oscerd commented on code in PR #9359:
URL: https://github.com/apache/camel/pull/9359#discussion_r1108216493


##########
components/camel-bean/src/main/java/org/apache/camel/component/bean/BeanInfo.java:
##########
@@ -63,7 +63,9 @@ public class BeanInfo {
     private static final Logger LOG = LoggerFactory.getLogger(BeanInfo.class);
     private static final String CGLIB_CLASS_SEPARATOR = "$$";
     private static final String CGLIB_METHOD_MARKER = "CGLIB$";
+    private static final String BYTE_BUDDY_CLASS_SEPARATOR = "$ByteBuddy$";
     private static final String BYTE_BUDDY_METHOD_MARKER = "$accessor$";
+    private static final String ARIES_PROXY_CLASS_PREFIX = "Proxy";

Review Comment:
   Reflection should be avoided.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] rastislavpapp commented on pull request #9359: CAMEL-19049 - unwrap aries proxy & bytebuddy proxy classes when introspecting

Posted by "rastislavpapp (via GitHub)" <gi...@apache.org>.
rastislavpapp commented on PR #9359:
URL: https://github.com/apache/camel/pull/9359#issuecomment-1432773160

   In addition to the problems above, I've found out that the solution does not work if the proxy is based on an interface.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-19049 - unwrap aries proxy & bytebuddy proxy classes when introspecting [camel]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on PR #9359:
URL: https://github.com/apache/camel/pull/9359#issuecomment-1803743987

   closing old PRs


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org