groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jochen Theodorou <>
Subject Re: @Immutable backwards compatibility
Date Wed, 26 Sep 2018 22:14:35 GMT
On 26.09.2018 12:58, Paul King wrote:
> I shouldn't try to respond to emails while rushing between conference 
> sessions. Refreshed my memory and yes, the current provisions for 2.4 
> compatibility don't really help. I'll see if Jochen has some ideas on 
> how we could improve that.

I guess we have to compare


which tells me the knownImmutableClasses part is gone from @Immutable 
and the 2.5.x version has no way of getting this information anymore, 
since this is supposed to be given directly to the method.

Bad, but let's continue talks about for example 
the Commit.groovy, that can be found here:

it does have a knownImmutableClasses=[ZonedDateTime], but looking at

it is in the list of builtinImmutables.

And the error message is of course not about that, it is about Person:

And that is where I am actually stuck in understanding the issue...

> if (field == null || field instanceof Enum || builtinOrMarkedImmutableClass(field.getClass()))
>             return field;
> }

this code for the 2.4 check should have returned, because 
builtinOrMarkedImmutableClass checks if the class of the value for the 
field has an annotation named groovy.transform.Immutable, which is the 
case for Person (see

It is similar for Branch.groovy...

So what exactly is not working anymore? I am confused (and it is well 
too late here for looking into such an issue). Cedric, Paul, can you 
explain what exactly goes wrong?

bye Jochen

View raw message