groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Strachan, Paul" <Paul.Strac...@det.nsw.edu.au>
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 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.urdaneta@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.
**********************************************************************
Mime
View raw message