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

Save the ClassNode AST by default

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • None
    • None
    • None
    • None

    Description

      Currently MetaClass.getClassNode() tries to recompile a given Groovy class to gain access to the AST. This doesn't work when using groovy scripts that are not on the classpath (eg. GroovyShell) and you would have to do it yourself.

      With the following patch the ClassNode of every compiled class will be saved and available for access later.

      One example where a missing ClassNode causes problems:

      groovy.sql.DataSet when used inside a GroovyShell script doesn't work since the AST will not be found to walk the closure.

      Attachments

        1. classnode.patch
          10 kB
          Thomas Heller
        2. classnode.patch
          5 kB
          Thomas Heller

        Issue Links

          Activity

            People

              blackdrag Jochen Theodorou
              maniax Thomas Heller
              Votes:
              3 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: