You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@groovy.apache.org by Paul King <pa...@asert.com.au> on 2018/03/30 12:06:43 UTC

Binary compatibility issue with GroovyClassLoader

I have been cleaning up things ready for the rc1 release. I noticed a few
binary compatibility issues that have crept into the code base. There are a
couple in what I deem internal classes so I am not too worried about them
but I'll clean up where it makes sense.

In groovy.lang.GroovyClassLoader we have two protected properties,
classCache and sourceCache that have different types in 2.4 and 2.5+. Map
vs EvictableCache.

This will obviously break code built on one version of Groovy that someone
might like to use with the other. It seems we should avoid that. I tried
playing around with deprecating the Map fields and introducing some
alternate fields:
https://github.com/apache/groovy/pull/678

But I am not really happy with it. The alternative would be to make
EvictableCache more Map like and revert the field types. It is close but
just a little different and might require some finessing, e.g. we might
make entrySet() throw UnsupportedOperationException for instance. I'll
explore that possibility further but does anyone have alternative thoughts?

Cheers, Paul.

Re: Binary compatibility issue with GroovyClassLoader

Posted by Paul King <pa...@asert.com.au>.
This is the alternative PR (requires a bit more checking):
https://github.com/apache/groovy/pull/679

On Fri, Mar 30, 2018 at 10:06 PM, Paul King <pa...@asert.com.au> wrote:

>
> I have been cleaning up things ready for the rc1 release. I noticed a few
> binary compatibility issues that have crept into the code base. There are a
> couple in what I deem internal classes so I am not too worried about them
> but I'll clean up where it makes sense.
>
> In groovy.lang.GroovyClassLoader we have two protected properties,
> classCache and sourceCache that have different types in 2.4 and 2.5+. Map
> vs EvictableCache.
>
> This will obviously break code built on one version of Groovy that someone
> might like to use with the other. It seems we should avoid that. I tried
> playing around with deprecating the Map fields and introducing some
> alternate fields:
> https://github.com/apache/groovy/pull/678
>
> But I am not really happy with it. The alternative would be to make
> EvictableCache more Map like and revert the field types. It is close but
> just a little different and might require some finessing, e.g. we might
> make entrySet() throw UnsupportedOperationException for instance. I'll
> explore that possibility further but does anyone have alternative thoughts?
>
> Cheers, Paul.
>
>
>