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

AstBuilder.buildFromString exceptions with Global Transformations

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • 1.7.6
    • None
    • ast builder
    • None
    • tested in 1.7

    Description

      AstBuilder.buildFromString exceptions with Global Transformations

      Perhaps it is the local environment for the user. I tested this in 1.8 and received no exceptions. It looks like a temporary script class is created, then read, then repeated until StackOverflow.

      [daniel@magnaopus tmp]$ groovy -cp /tmp/println_g_ast.jar Run.groovy
      visit(): this pack.PrintlnTransformation@627a4489
      visitClass(): node Run
      visitMethod(): node MethodNode@984103443[void main([Ljava.lang.String]
      visit(): this pack.PrintlnTransformation@5bf99eea
      visitClass(): node script1294995677622
      visitMethod(): node MethodNode@1630553042[void
      main([Ljava.lang.String]
      visitMethod(): node MethodNode@666157527[java.lang.Object run()]
      visit(): this pack.PrintlnTransformation@67f31652
      visitClass(): node script1294995677653
      visitMethod(): node MethodNode@138319567[void main([Ljava.lang.String]
      visitMethod(): node MethodNode@1159656515[java.lang.Object run()]
      visit(): this pack.PrintlnTransformation@30e34726
      visitClass(): node script1294995677658
      visitMethod(): node MethodNode@424945885[void main([Ljava.lang.String]
      visitMethod(): node MethodNode@1682362920[java.lang.Object run()]
      visit(): this pack.PrintlnTransformation@74b957ea
      visitClass(): node script1294995677663
      visitMethod(): node MethodNode@876281732[void main([Ljava.lang.String]
      visitMethod(): node MethodNode@224218598[java.lang.Object run()]
      visit(): this pack.PrintlnTransformation@38827968
      visitClass(): node script1294995677668
      visitMethod(): node MethodNode@2112927699[void
      main([Ljava.lang.String]
      visitMethod(): node MethodNode@1186250301[java.lang.Object run()]
      visit(): this pack.PrintlnTransformation@638bd7f1
      visitClass(): node script1294995677671
      visitMethod(): node MethodNode@1913537093[void
      main([Ljava.lang.String]
      visitMethod(): node MethodNode@102824579[java.lang.Object run()]
      visit(): this pack.PrintlnTransformation@5adf48c4
      visitClass(): node script1294995677673
      visitMethod(): node MethodNode@2032298615[void
      main([Ljava.lang.String]
      visitMethod(): node MethodNode@1115416770[java.lang.Object run()]
      visit(): this pack.PrintlnTransformation@301db5ec
      visitClass(): node script1294995677684
      visitMethod(): node MethodNode@1855107489[void
      main([Ljava.lang.String]
      visitMethod(): node MethodNode@1623980477[java.lang.Object run()]
      visit(): this pack.PrintlnTransformation@77546dbc
      visitClass(): node script1294995677688
      visitMethod(): node MethodNode@1206947544[void
      main([Ljava.lang.String]
      visitMethod(): node MethodNode@36842446[java.lang.Object run()]
      visit(): this pack.PrintlnTransformation@6da5db4b
      visitClass(): node script1294995677691
      
      (...) sometime in the near future
      
      visitClass(): node script1294995678620
      visitMethod(): node MethodNode@1309289016[void
      main([Ljava.lang.String]
      visitMethod(): node MethodNode@2103044750[java.lang.Object run()]
      Caught: java.lang.StackOverflowError
              at
      org.codehaus.groovy.ast.builder.AstStringCompiler.compile(AstStringCompiler.groovy:46)
              at
      org.codehaus.groovy.ast.builder.AstBuilder.buildFromString(AstBuilder.groovy:100)
              at
      org.codehaus.groovy.ast.builder.AstBuilder.buildFromString(AstBuilder.groovy)
              at
      org.codehaus.groovy.ast.builder.AstStringCompiler.compile(AstStringCompiler.groovy:46)
              at
      org.codehaus.groovy.ast.builder.AstBuilder.buildFromString(AstBuilder.groovy:100)
              at
      org.codehaus.groovy.ast.builder.AstBuilder.buildFromString(AstBuilder.groovy)
              at
      org.codehaus.groovy.ast.builder.AstStringCompiler.compile(AstStringCompiler.groovy:46)
              at
      org.codehaus.groovy.ast.builder.AstBuilder.buildFromString(AstBuilder.groovy:100)
              at
      org.codehaus.groovy.ast.builder.AstBuilder.buildFromString(AstBuilder.groovy)
              at
      org.codehaus.groovy.ast.builder.AstStringCompiler.compile(AstStringCompiler.groovy:46)
              at
      org.codehaus.groovy.ast.builder.AstBuilder.buildFromString(AstBuilder.groovy:100)
              at
      org.codehaus.groovy.ast.builder.AstBuilder.buildFromString(AstBuilder.groovy)
              at
      org.codehaus.groovy.ast.builder.AstStringCompiler.compile(AstStringCompiler.groovy:46)
              at
      org.codehaus.groovy.ast.builder.AstBuilder.buildFromString(AstBuilder.groovy:100)
              at
      org.codehaus.groovy.ast.builder.AstBuilder.buildFromString(AstBuilder.groovy)
              at
      org.codehaus.groovy.ast.builder.AstStringCompiler.compile(AstStringCompiler.groovy:46)
              at
      org.codehaus.groovy.ast.builder.AstBuilder.buildFromString(AstBuilder.groovy:100)
              at
      org.codehaus.groovy.ast.builder.AstBuilder.buildFromString(AstBuilder.groovy)
              at
      org.codehaus.groovy.ast.builder.AstStringCompiler.compile(AstStringCompiler.groovy:46)
              at
      org.codehaus.groovy.ast.builder.AstBuilder.buildFromString(AstBuilder.groovy:100)
              at
      org.codehaus.groovy.ast.builder.AstBuilder.buildFromString(AstBuilder.groovy)
      

      Attachments

        Activity

          People

            guillaume Guillaume Sauthier
            hamlet.darcy@canoo.com Hamlet D'Arcy
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: