You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/05/03 07:16:00 UTC

[jira] [Commented] (GROOVY-3867) Allow methodMissing/propertyMissing to be defined through category

    [ https://issues.apache.org/jira/browse/GROOVY-3867?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16462038#comment-16462038 ] 

ASF GitHub Bot commented on GROOVY-3867:
----------------------------------------

GitHub user ecerulm opened a pull request:

    https://github.com/apache/groovy/pull/693

    Allow methodMissing/propertyMissing to be defined through category

    Resolves GROOVY-3867

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ecerulm/groovy GROOVY-3867-pq

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/groovy/pull/693.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #693
    
----
commit 8d6af73c53d0f0ad8c2e7b72d214ba732b14e8ee
Author: Ruben Laguna <ru...@...>
Date:   2018-05-01T10:07:54Z

    Allow methodMissing/propertyMissing to be defined through category
    
    Resolves GROOVY-3867

----


> 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
>            Priority: Major
>         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)