groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ruben Laguna (JIRA)" <>
Subject [jira] [Commented] (GROOVY-3867) Allow methodMissing/propertyMissing to be defined through category
Date Fri, 08 Dec 2017 09:25:00 GMT


Ruben Laguna commented on GROOVY-3867:

I've opened a new issue GROOVY-8408 from a conversation with [~blackdrag] in the []
which is related to this issue. (invokeMethod instead of missingMethod) 

> Allow methodMissing/propertyMissing to be defined through category
> ------------------------------------------------------------------
>                 Key: GROOVY-3867
>                 URL:
>             Project: Groovy
>          Issue Type: Improvement
>          Components: groovy-runtime
>    Affects Versions: 1.6.5
>            Reporter: Kohsuke Kawaguchi
>         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
> 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

View raw message