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

[jira] [Resolved] (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 ]

Ang Li resolved SCB-1402.
-------------------------
    Resolution: Fixed

solved, see [https://github.com/apache/servicecomb-java-chassis/pull/1281]

> 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
>          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
(v7.6.14#76016)