Thanks. You can create an issue and submit a PR.


--------------------------------------------------
???? Liu Bao
Mobile: +86-18664569778<tel:+86-18664569778>
Email: [email protected]<mailto:[email protected]>
????????LA <[email protected]>
????????dev <[email protected]>
??????2019-07-29 11:46:23
???6?9????BeanUtils.getImplClassFromBean can not return correctly info in cglib 
proxy situation

Hey Guys,


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.---------------------------------------------------------------------------------Best,
 Ang Li

Reply via email to