Named function arguments in Groovy

2016-11-22 Thread Michael Rüegg
Hi, I have a DSL where I want to pass named arguments like follows: def foo(String a, String b, String c, Closure d) { } foo(a=“a”, c=“c”, b=“b”) { } I’m aware that named arguments are supported by receiving the arguments with a map: def foo(Map obj, Closure c) { }

RE: JDK8 Streams / Closure cast to interface

2016-11-22 Thread Winnebeck, Jason
I was referring to a compile-time generation of the class -- that the Closure itself that is normally generated implements the interface natively. That would make it equivalent to anonymous class in Java 7 and earlier for calling functional (or any SAM type) methods. That wouldn't have any

ClosureSignatureHint for class generic type?

2016-11-22 Thread Winnebeck, Jason
Suppose I have: class Blah { void doit(Closure c) } Used so: Blah b = new Blah<>("abc") b.doit {it.trim()} Is there a ClosureSignatureHint that specifies this? This method from DGM is what I'd want, except doit is an instance method and not a static one, so I can't use "FirstParam" public

JDK8 Streams / Closure cast to interface

2016-11-22 Thread Winnebeck, Jason
I love Groovy. I also love the new streams functionality in JDK 8. But, I am weary of the performance implications of Groovy + Streams, because to use streams you must use Groovy closures. I see the code generated creates a new closure instance then uses castToType to cast the closure to the

Re: Groovy Script Memory Management Anti-patterns

2016-11-22 Thread Jacopo Cappellato
Hi Daniel, I think that the problem you are facing is that when your code calls: List datalist = sourceDB.rows(...) all the records in the resultset are retrieved by Groovy and added to the datalist List (implemented by an ArrayList). If the resultset is large (e.g. 2GB) then the memory

Re: Http Builder NG

2016-11-22 Thread Daniel Sun
Good job :) Cheers, Daniel.Sun -- View this message in context: http://groovy.329449.n5.nabble.com/Http-Builder-NG-tp5736876p5736879.html Sent from the Groovy Users mailing list archive at Nabble.com.

groovy email template script help.

2016-11-22 Thread pradeep
Hi, I have written a groovy template script to be integrated to the E-mail Extn plugin in Jenkins for sending customised reports. The idea is to to parse the jUNIT Test reports from Jenkins and add the test results in a tabular format. The problem is the "Test Pass Count", "Test Fail Count",