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

Static method calls in AST Transformations fail when multiple scripts are called after each other.

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

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.3.4
    • None
    • ast builder
    • None

    Description

      A script has an annotation on a variable, for example:

      @Input("some.input.reference")
      def input

      An AST Transformation adds a method that initializes the input reference and the declaration is transformed to:

      def input = someMethod("some.input.reference")

      The someMethod() method contains a staticMethodCall.

      If several scripts that are instrumented this way are called after each other then in the second script always a GroovyBug exception occurs, see attachment.

      If the script is called stand-alone then everything is fine.

      The order in which the scripts is called doesn't matter.

      I included a more detailed code example in the attachment.

      It seems there is some kind of bug with static method calls in AST transformations.

      Attachments

        Activity

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

          People

            Unassigned Unassigned
            rkorbee Reinout Korbee

            Dates

              Created:
              Updated:

              Slack

                Issue deployment