groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Sun (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (GROOVY-3867) Allow methodMissing/propertyMissing to be defined through category
Date Fri, 04 May 2018 00:14:00 GMT

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

Daniel Sun resolved GROOVY-3867.
--------------------------------
       Resolution: Fixed
         Assignee: Daniel Sun
    Fix Version/s: 2.5.0-rc-3
                   3.0.0-alpha-3
                   2.6.0-alpha-4

The proposed PR is merged. Thanks!

https://github.com/apache/groovy/commit/ad664b181249c4b8e8821003d7e750632943ce36

> Allow methodMissing/propertyMissing to be defined through category
> ------------------------------------------------------------------
>
>                 Key: GROOVY-3867
>                 URL: https://issues.apache.org/jira/browse/GROOVY-3867
>             Project: Groovy
>          Issue Type: Improvement
>          Components: groovy-runtime
>    Affects Versions: 1.6.5
>            Reporter: Kohsuke Kawaguchi
>            Assignee: Daniel Sun
>            Priority: Major
>             Fix For: 2.6.0-alpha-4, 3.0.0-alpha-3, 2.5.0-rc-3
>
>         Attachments: categoryAndMissingMethodFailingTest.patch
>
>
> When integrating a library defined by a 3rd party into Groovy, it's often convenient
to be able to define missing method/property receiver. Since I can't modify the library directly,
it would be great if this can be achieved via category.
> In the current MetaClassImpl implementation, category isn't searched for a missing method/property
receiver.
> Note that the generic "Object get(String name)" serves as a replacement for propertyMissing,
but there's nothing like that for methods. Plus the get method isn't invoked for "foo.someMethod(...)"
even though it works for "(foo.someMethod)(...)" due to the difference in the property look
up and method invocation handling.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message