Yes, I think the fix proposed in:

https://issues.apache.org/jira/browse/GROOVY-7530

will fix this bug with intersect too. See also:

https://issues.apache.org/jira/browse/GROOVY-7602

Cheers, Paul.


On Tue, Feb 9, 2016 at 1:32 PM, Strachan, Paul
<paul.strac...@det.nsw.edu.au> wrote:
> OK. It appears to me like a Groovy bug introduced in version 2.3.10 –
> possibly https://issues.apache.org/jira/browse/GROOVY-7267
>
>
>
> def c1 = []
> def c2 = []
>
> c1 << new URL("http://sample.com/";)
> c2 << new URL("http://sample.com/";)
> println c1.intersect(c2).size()
>
>
>
> In Groovy <= 2.3.9 the output is 1
>
> In Groovy > 2.3.9 the output is 0
>
>
>
>
>
>
>
> From: Edinson E. Padrón Urdaneta [mailto:edinson.padron.urdan...@gmail.com]
> Sent: Tuesday, 9 February 2016 1:29 AM
> To: users@groovy.apache.org
> Subject: Re: not sure about Collection.intersect
>
>
>
> I have to look at the implementation of the `intersect` method to be sure
> but does your TestClass class overwrite `hashcode` and `equal`? There should
> be a way to compare the instances of said class.
>
>
> **********************************************************************
> This message is intended for the addressee named and may contain
> privileged information or confidential information or both. If you
> are not the intended recipient please delete it and notify the sender.
> **********************************************************************

Reply via email to