Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.1-beta-1, 1.1-beta-2
    • Fix Version/s: 1.1-rc-2
    • Component/s: None
    • Labels:
      None
    • Flags:
      Patch

      Description

      Groovy beans wrapped in JDK style proxies throw an "IllegalArgumentException: object is not an instance of declaring class" when a method is called on them from a Groovy object.

      Thread on subject from the dev list: http://www.nabble.com/JDK-Style-Proxy-Issue-tf4137792.html

      Diagnosis from Jochen Theodorou: http://www.nabble.com/Re%3A-JDK-Style-Proxy-Issue-p11815320.html

      1. JdkDynamicProxyTest.diff
        5 kB
        Mark Menard
      2. GroovyJdkDynamicProxyPatch.diff
        12 kB
        Mark Menard

        Activity

        Mark Menard created issue -
        Hide
        Mark Menard added a comment -

        This is a patch from groovy-core/src.

        This patch includes all of the test cases from the previous patch and a fix for the issue.

        I have added an interfaceMetaMethod property to MetaMethod. This allows MetaMethod to know if the method it is invoking was declared on an interface. Then the logic to invoke the method checks to see if the type of MetaMethod.method implementing class == the type of the target object. If it does not and there is an interfaceMetaMethod it delegates the invocation to the interfaceMetaMethod.

        In MetaClass I've added a new method that wires a newly create MetaMethod to its implementing MetaMethod if one exists. This is called from createMetaMethod().

        All existing tests in the current trunk pass with this patch applied.

        Show
        Mark Menard added a comment - This is a patch from groovy-core/src. This patch includes all of the test cases from the previous patch and a fix for the issue. I have added an interfaceMetaMethod property to MetaMethod. This allows MetaMethod to know if the method it is invoking was declared on an interface. Then the logic to invoke the method checks to see if the type of MetaMethod.method implementing class == the type of the target object. If it does not and there is an interfaceMetaMethod it delegates the invocation to the interfaceMetaMethod. In MetaClass I've added a new method that wires a newly create MetaMethod to its implementing MetaMethod if one exists. This is called from createMetaMethod(). All existing tests in the current trunk pass with this patch applied.
        Mark Menard made changes -
        Field Original Value New Value
        Attachment JdkDynamicProxyTest.diff [ 28678 ]
        Mark Menard made changes -
        Attachment JdkDynamicProxyTest.diff [ 28678 ]
        Hide
        Mark Menard added a comment -

        This is a patch from groovy-core/src.

        This patch includes all of the test cases from the previous patch and a fix for the issue.

        I have added an interfaceMetaMethod property to MetaMethod. This allows MetaMethod to know if the method it is invoking was declared on an interface. Then the logic to invoke the method checks to see if the type of MetaMethod.method implementing class == the type of the target object. If it does not and there is an interfaceMetaMethod it delegates the invocation to the interfaceMetaMethod.

        In MetaClass I've added a new method that wires a newly create MetaMethod to its implementing MetaMethod if one exists. This is called from createMetaMethod().

        All existing tests in the current trunk pass with this patch applied.

        Show
        Mark Menard added a comment - This is a patch from groovy-core/src. This patch includes all of the test cases from the previous patch and a fix for the issue. I have added an interfaceMetaMethod property to MetaMethod. This allows MetaMethod to know if the method it is invoking was declared on an interface. Then the logic to invoke the method checks to see if the type of MetaMethod.method implementing class == the type of the target object. If it does not and there is an interfaceMetaMethod it delegates the invocation to the interfaceMetaMethod. In MetaClass I've added a new method that wires a newly create MetaMethod to its implementing MetaMethod if one exists. This is called from createMetaMethod(). All existing tests in the current trunk pass with this patch applied.
        Mark Menard made changes -
        Attachment GroovyJdkDynamicProxyPatch.diff [ 28679 ]
        Guillaume Delcroix made changes -
        Fix Version/s 1.1-beta-3 [ 13590 ]
        Priority Major [ 3 ] Critical [ 2 ]
        Assignee Jochen Theodorou [ blackdrag ]
        Guillaume Delcroix made changes -
        Fix Version/s 1.1-beta-3 [ 13590 ]
        Fix Version/s 1.1-rc-1 [ 13165 ]
        Hide
        Guillaume Delcroix added a comment -

        Hi Mark,
        I had a quick look at this issue, and the Groovy code base has changed a little since.
        Do you still encounter the same problem?
        If yes, could I ask you to update your patch, please?

        Show
        Guillaume Delcroix added a comment - Hi Mark, I had a quick look at this issue, and the Groovy code base has changed a little since. Do you still encounter the same problem? If yes, could I ask you to update your patch, please?
        Hide
        Mark Menard added a comment -

        Hi Guillaume,

        I've tried out the 1.1-beta-3 from http://repo1.maven.org/maven2/groovy/groovy-all/1.1-beta-3/. If that is the released version of 1.1-beta-3 then it has not fixed the issue.

        If I have time I will check out the SVN and take a look at this again. (I'm a bit buried on a project right now.) What is the time to the first RC? And does this need to be fixed before then to make it into 1.1?

        Mark

        Show
        Mark Menard added a comment - Hi Guillaume, I've tried out the 1.1-beta-3 from http://repo1.maven.org/maven2/groovy/groovy-all/1.1-beta-3/ . If that is the released version of 1.1-beta-3 then it has not fixed the issue. If I have time I will check out the SVN and take a look at this again. (I'm a bit buried on a project right now.) What is the time to the first RC? And does this need to be fixed before then to make it into 1.1? Mark
        Hide
        Guillaume Delcroix added a comment -

        We plan to release RC-1 tomorrow evening (ie in 24 hours or so).
        And 1.1 mid-November.
        As it's a "bug fix" and not a "feature", we can include the fix in after tomorrow if you don't have time to look till tomorrow.

        Show
        Guillaume Delcroix added a comment - We plan to release RC-1 tomorrow evening (ie in 24 hours or so). And 1.1 mid-November. As it's a "bug fix" and not a "feature", we can include the fix in after tomorrow if you don't have time to look till tomorrow.
        Guillaume Delcroix made changes -
        Fix Version/s 1.1-rc-2 [ 13792 ]
        Fix Version/s 1.1-rc-1 [ 13165 ]
        Guillaume Delcroix made changes -
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Closed [ 6 ]
        Mark Thomas made changes -
        Project Import Sun Apr 05 13:32:57 UTC 2015 [ 1428240777691 ]
        Mark Thomas made changes -
        Workflow jira [ 12731107 ] Default workflow, editable Closed status [ 12743047 ]
        Mark Thomas made changes -
        Patch Submitted Yes [ 10763 ]
        Flags Patch [ 10430 ]
        Mark Thomas made changes -
        Project Import Mon Apr 06 02:11:23 UTC 2015 [ 1428286283443 ]
        Mark Thomas made changes -
        Workflow jira [ 12967855 ] Default workflow, editable Closed status [ 12975615 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Closed Closed
        93d 23h 29m 1 Guillaume Delcroix 28/Oct/07 16:57

          People

          • Assignee:
            Jochen Theodorou
            Reporter:
            Mark Menard
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development