Uploaded image for project: 'Apache ServiceComb'
  1. Apache ServiceComb
  2. SCB-1402

BeanUtils.getImplClassFromBean can not return correctly info in cglib proxy situation

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • java-chassis-1.2.1
    • java-chassis-1.3.0
    • Java-Chassis
    • None

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              Ang Li Ang Li
              Ang Li Ang Li
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m