Aristedes Maniatis | 30 May 13:27 2016

JVM crash after groovy 2.4.6 upgrade

This is a little stab in the dark, but we are seeing JVM crashes (at least 10 so far, so it isn't a fluke) after a
recent groovy 2.4.5 -> 2.4.6 upgrade.

The crash happens here [] ZIP_GetEntry+0x11a which appears to be triggered by groovy
invoking the class loader to compile something.

Full details here:

The closest openJDK bug reports I could find are caused by something trying to change the contents of a zip
while it is open. Because I haven't yet figured how to make the JVM crash on demand, I haven't been able to
pinpoint this. And as you can see, my code involves JasperReports invoking Groovy and there is quite a lot
going on.

But I thought I'd give it a shot: has anyone seen something similar? Is this likely to be related to the
upgrade of groovy?



Aristedes Maniatis
CEO, ish
GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A

Schalk Cronjé | 29 May 23:47 2016

<at> CompileStatic & interfaces

Simple question: Does it actually make any difference to have interfaces annotated with <at> CompileStatic?

-- Schalk W. Cronjé Twitter / Ello / Toeter : <at> ysb33r
David Eisner | 27 May 15:39 2016

groovysh classpath switch not working under Windows

I'm trying to set the classpath for a groovysh session with the classpath switch (e.g. "-cp" or "-classpath"). On Linux (and under Cygwin with an sdkman-installed Groovy), it works fine.

But under Windows (both Windows 7 64-bit and Windows 10 64-bit, installed using the Windows installer) I get this error:

PS C:\> groovysh -cp .
Unrecognized option: -cp
error: jvm creation failed with code -1: unknown error
PS C:\> groovysh -classpath .
Unrecognized option: -classpath
error: jvm creation failed with code -1: unknown error

I'm using the current directory as an example argument, but I get the same error no matter what I try.

In all cases (Linux, Cygwin w/ sdkman, Windows 7 and 10) this is Groovy 2.4.6 with JVM 1.8.0_91). One other thing: the problem occurs whether I'm using PowerShell or cmd.exe.

I don't see any bugs filed against this in JIRA. I'm new to groovy, so perhaps I'm missing something. Any ideas?


Paolo Di Tommaso | 26 May 20:06 2016

List and GString

Dear all, 

I have a use case in which I need to override the `toString` method of a custom List class and use it when interpolating that list object in a GString. 

It turns out the Groovy uses its own formatting methods for List and other structures, so the my custom `toString` is simply ignored. 

To explain it better take in consideration this example: 

class MyList extends ArrayList {

  String toString() {


def x = new MyList()
x << 1 << 2 << 3 

assert x.toString() == '1-2-3'
assert "$x" == '1-2-3'

Assertion failed: 
assert "$x" == '1-2-3'
         |  |
         |  false
         [1, 2, 3]

The second assertion fails for the reason said above. Now I'm wondering it there's any way to override somehow the GString default rendering mechanism in such a way I can inject my own formatting rule for my custom class. 

Any suggestion is appreciated. 


Benjamin Gudehus | 23 May 17:09 2016

[OT] Old Mailing-list on Nabble


for (nearly) every message to the Apache Groovy Mailing-lists I receive two mails (one from and one from

Unfortunately the URL to the Nabble forum on [1] redirects to [1] itself. Which means I can't use the Nabble user interface to unsubscribe (if there was any).
Clicking on the unsubscribe link in the footer of the mails does the same.

I wonder if there's a way to unsubscribe. If not, as a work-around, I'll filter all mails from that contain the text "".


Rahul Somasunderam | 22 May 20:52 2016

GroovyLexer and newlines in comments


I've got this code 

 <at> Grab('org.fusesource.jansi:jansi:1.12')

import static org.fusesource.jansi.Ansi.Color.RED
import static org.fusesource.jansi.Ansi.ansi

import groovyjarjarantlr.Token
import org.codehaus.groovy.antlr.parser.GroovyLexer
import org.fusesource.jansi.AnsiConsole


 * Some class
class Foo {
     *  <at> param a
     *  <at> param b
     *  <at> param c
     *  <at> return
    String doSomething(String a, int b, double c) {
def lexer = new GroovyLexer(new File('gpa.groovy').newInputStream())
def lastLine = 0

while (true) {
    def t = lexer.nextToken()
    if (!t || t.type == Token.EOF_TYPE) {
    if (lastLine != t.line) {
        println ''
        def lineNum = t.line.toString().padLeft(4)
        print ansi().fg(RED).a(lineNum).a('| ').reset()
        lastLine = t.line
    print t.text
println ''```

When I run it, it parses itself, and prints itself out with line numbers.
There are 2 weird things I see.

1. The comments and javadoc get squished into one line. Is there a way to
get them unmodified?
2. The last statement doesn't retain the last token which is a constant of
an empty string when the file ends on the same line. This problem goes away
if i add a newline at the end of the file. Is there some way to convince the
lexer to not do that?



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

Schalk Cronjé | 22 May 18:58 2016

About Gradle, Kotlin and Inner Fear

As a follow-up to Dan Woods post regarding reactions of the ApacheGroovy community to the recent announcement of Kotlin support in Gradle, I had posted the following

in the hope that it will elicit more conversation regarding the state of the Groovy nation.

-- Schalk W. Cronjé Twitter / Ello / Toeter : <at> ysb33r
Guillaume Laforge | 20 May 22:21 2016
Gravatar down for now

Hi all,

FYI, the Groovy website is currently down.

We're migrating the domain-name to the Apache foundation, but it looks like there are some issues with the transfer. 
The Apache infrastructure team is investigating this, and hopefully it'll be back soon.
But till the DNS changes propagate and so on, it might take a little while till it's back.
Fingers crossed.

In the meantime, sorry for the inconvenience :-(
Thanks for your understanding.


Guillaume Laforge
Apache Groovy committer & PMC Vice-President
Product Ninja & Advocate at Restlet

Schalk Cronjé | 19 May 13:59 2016

NIO2 FIleContentType Provider in Java, Groovy & Kotlin

As I like to say, java.nio.file is like a big wooden crate with some diagrams, but it does not actually contain any useful content.

I had to solve a problem yesterday and wrote this It will detect the content type of a file, bu actually inspecting the first couple of bytes of a file rather than guessing it from the file extension. It uses Apache Tika underneath to do the real work. This allows the java.nio.file.FIles.probeFIieContent(Path) method to actually do something useful and not just return null. \o/

I am posting this here as the repo contains three functionally equivalant implementations - Java, Groovy & Kotlin. (The published artifact on BIntray is the Java one, simply because I did not want to add an additional dependency for such a small implementation). At some stage I'll get around to comparing the performance of the three implementations

This will form part of something else I want to do is showing how to write NIO2 providers in alternative JVM languages.

In the mean-time this might be of interest to those who would like to compare implementations.

-- Schalk W. Cronjé Twitter / Ello / Toeter : <at> ysb33r

GR8Conf EU Registration ends soon!

/*<![CDATA[*/ body{font-family:Helvetica,Arial;font-size:13px} /*]]>*/

Registrations for GR8Conf EU ends one week from now, Monday May 23rd. 

You do not want to miss this year's event! Here you can learn all about Groovy, Grails and Gradle from the project founders and core developers!  

From the Groovy core team you can meet: Guillaume Laforge, Cedric Champeau and Jochen Theodorou. From the Grails core team you can meet: Jeff Brown and Graeme Rocher. Cedric also represents Gradle. 

The opening keynote is delivered by Ken Kousen.  

One University day with workshops, Two conference days, Three conference tracks, 24 speakers from all over the world. Not to mention our home brewed beer for Meet & Greet.

For more information, please visit now!

Best regards,
Søren Berg Glasius
GR8Conf Europe organizing team

GR8Conf ApS
Mobile: +45 40 44 91 88, Web:, Skype: sbglasius 
Company Address: Buchwaldsgade 50, 5000 Odense C, Denmark
Personal Address: Hedevej 1, Gl. Rye, 8680 Ry, Denmark
--- GR8Conf - Dedicated to the Groovy Ecosystem
Guy Matz | 16 May 17:28 2016

re-using a comparison closure

I have to sort a list of strings based on a number within the string . . .  I am able to sort using something like:
list.sort( { a,b -> getVersion(a) <=> getVersion(b)})

I need to use this in a bunch of places in my code and was hoping to replace it with a method, like:
list.sort( compareVersions)

with compareVersions:
def compareVersions(a, b) {
  return getVersion(a).toInteger() <=> getVersion(b).toInteger()

putting the method (compoareVersions) into the sort as a param doesn't work.  Anyone know what I'm missing?