groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Strachan, Paul" <>
Subject RE: not sure about Collection.intersect
Date Tue, 09 Feb 2016 03:32:02 GMT
OK. It appears to me like a Groovy bug introduced in version 2.3.10 – possibly

def c1 = []
def c2 = []
c1 << new URL("")
c2 << new URL("")
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 []
Sent: Tuesday, 9 February 2016 1:29 AM
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.
View raw message