groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bartoleo <>
Subject problem accessing class method from FileTreeBuilder in a closure
Date Fri, 11 Mar 2016 12:29:19 GMT
Hi I'm using FileTreBuilder to create ten dirs with a file in it, the content
is returned by a class method.

Here is an example: 

class MyFileTreeBuilder {
  static def testData(){
    "my test data..."
  static void main(String[] args) {
    def tree = new FileTreeBuilder()
        file "test.txt", testData() 
      println(new File("tests/test${index}/test.txt").text)


It seems that FileTreeBuilder cannot find my class method if used in a
closure. (it works correctly if I remove the '10.times...'

Could it be a bug?

View this message in context:
Sent from the Groovy Users mailing list archive at

View raw message