Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-3867

Allow methodMissing/propertyMissing to be defined through category

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      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.

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            daniel_sun Daniel Sun
            kohsuke Kohsuke Kawaguchi
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment