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

Extending a class via its superclass' metaclass changes method visibility rules

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

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.4.15
    • None
    • groovy-runtime
    • None

    Description

      Private fields/methods of a superclass are not accessible in groovy, see GROOVY-3142

      But if some superclasses in the class hierarchy is extended via its metaclass, private methods become visible.

      This happens in all the latest 2.X (2.4.21), 3.X (3.0.8) and 4.X (4.0.0-alpha-3) versions.

       

      Attached is a simple groovy script that demonstrates it.

      Attachments

        Issue Links

        Activity

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

          People

            Unassigned Unassigned
            klv_m72 L

            Dates

              Created:
              Updated:

              Slack

                Issue deployment