You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@servicecomb.apache.org by "Willem Jiang (Jira)" <ji...@apache.org> on 2019/08/22 06:35:00 UTC

[jira] [Updated] (SCB-1402) BeanUtils.getImplClassFromBean can not return correctly info in cglib proxy situation

     [ https://issues.apache.org/jira/browse/SCB-1402?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Willem Jiang updated SCB-1402:
------------------------------
    Fix Version/s: java-chassis-1.3.0

> BeanUtils.getImplClassFromBean can not return correctly info in cglib proxy situation
> -------------------------------------------------------------------------------------
>
>                 Key: SCB-1402
>                 URL: https://issues.apache.org/jira/browse/SCB-1402
>             Project: Apache ServiceComb
>          Issue Type: Improvement
>          Components: Java-Chassis
>    Affects Versions: java-chassis-1.2.1
>            Reporter: Ang Li
>            Assignee: Ang Li
>            Priority: Major
>             Fix For: java-chassis-1.3.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> I found a problem using org.apache.servicecomb.foundation.common.utils.BeanUtils#getImplClassFromBean. If the @param bean is a cgLib proxy subclass bean, the getImplClassFromBean method will return null instead of super class which is expected. To make the issure more clearly, I created a bean class as following:
> *static class* TestBean{
>  
>  }
>  
> *static class* TestBean$$TestBeanByCGLIB$$e1a36bab *extends* TestBean *implements* SpringProxy {
>  
>  }
> The case is to simulate a bean class proxied by cglib proxy.A test case provided as following and the case is not past.
> @Test
>  *public void* testGetImplClassFromBeanfromCglib(){
>    TestBean testBeanByCGLIB = *new* TestBean$$TestBeanByCGLIB$$e1a36bab();
>    Assert._assertEquals_(TestBean.*class*, BeanUtils._getImplClassFromBean_(testBeanByCGLIB));
>  }
> This matters because cglib proxy can be used while using serviceComb framework and I think just a few lines of code changing can fix this issue.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)