groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pavel (JIRA)" <>
Subject [jira] [Created] (GROOVY-8563) Documentation methodMissing example incorrect
Date Sat, 28 Apr 2018 21:25:00 GMT
Pavel created GROOVY-8563:

             Summary: Documentation methodMissing example incorrect
                 Key: GROOVY-8563
             Project: Groovy
          Issue Type: Bug
            Reporter: Pavel

provide example:
class GORM {

   def dynamicMethods = [...] // an array of dynamic methods that use regex

   def methodMissing(String name, args) {
       def method = dynamicMethods.find { it.match(name) }
       if(method) {
          GORM.metaClass."$name" = { Object[] varArgs ->
             method.invoke(delegate, name, varArgs)
          return method.invoke(delegate,name, args)
       else throw new MissingMethodException(name, delegate, args)
Which reasonable leads to exception:
{noformat}groovy.lang.MissingPropertyException: No such property: delegate for class: ru.taskdata.EgronReader{noformat}
Instead of second 
method.invoke(delegate, name, varArgs)
Should be something like:
return method.invoke(this, args)

If you wish I could provide pull request. On what repository it should be made?

This message was sent by Atlassian JIRA

View raw message