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

[jira] [Resolved] (GROOVY-8408) invokeMethod cannot be set through category

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

Daniel Sun resolved GROOVY-8408.
--------------------------------
       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

> invokeMethod cannot be set  through category
> --------------------------------------------
>
>                 Key: GROOVY-8408
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8408
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 3.x, 2.5.x, 2.4.13, 2.6.0-alpha-2
>            Reporter: Ruben Laguna
>            Assignee: Daniel Sun
>            Priority: Major
>             Fix For: 2.6.0-alpha-4, 3.0.0-alpha-3, 2.5.0-rc-3
>
>         Attachments: categoryMissingMethod.groovy
>
>
> In the Groovy in Action book, chapter 8.4.5 says 
> {quote}Category method names can well take the form of property accessors (pretending property access), operator methods, and GroovyObject methods. MOP hook methods cannot be added through a category class. This is a restriction as of Groovy 2.4. The feature may become available in later versions.{quote}
> It interpreted this as meaning that I can add GroovyMethods (getProperty,
> getMetaClass, invokeMethod , setMetaClass and setProperty)  to a class using categories but not
> methodMissing or propertyMissing (which I think they call MOP hook methods in the GINA book).
> But when I tried to add invokeMethod using a category the change has no effect, adding missingMethod does not work either see attachement. 
> I see that methodsMissing/ propertyMissing via category was probably never supported noted in GROOVY-3867. But the Groovy in Action paragraph makes me think that invokeMethod et al were supported at some point. 
> Mailing list thread with [~blackdrag] on the [mailing list|http://markmail.org/message/xlj74kawyayspnzv?q=list:org%2Eapache%2Egroovy%2Eusers+category+category]



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