Re: not sure about Collection.intersect

2016-02-09 Thread Paul King
).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.apach

RE: not sure about Collection.intersect

2016-02-08 Thread Strachan, Paul
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 implemen

RE: not sure about Collection.intersect

2016-02-08 Thread Strachan, Paul
t: Re: not sure about Collection.intersect Could it be that you're using a String instead of a List of String as the value for the `includes` element? Check this: http://docs.groovy-lang.org/next/html/gapi/groovy/transform/EqualsAndHashCod

Re: not sure about Collection.intersect

2016-02-08 Thread Edinson E . Padrón Urdaneta
Could it be that you're using a String instead of a List of String as the value for the `includes` element? Check this: http://docs.groovy-lang.org/next/html/gapi/groovy/transform/EqualsAndHashCode.html#includes

Re: not sure about Collection.intersect

2016-02-08 Thread Søren Berg Glasius (GR8Conf EU)
@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.

Re: not sure about Collection.intersect

2016-02-08 Thread Edinson E . Padrón Urdaneta
Oh! I'm sorry, I don't know why I didn't notice the class's code.

Re: not sure about Collection.intersect

2016-02-08 Thread Edinson E . Padrón Urdaneta
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.

Re: not sure about Collection.intersect

2016-02-08 Thread Søren Berg Glasius (GR8Conf EU)
vej 1, Gl. Rye, 8680 Ry, Denmark --- GR8Conf - Dedicated to the Groovy Ecosystem From: Strachan, Paul Reply: users@groovy.apache.org Date: February 8, 2016 at 15:12:06 To: users@groovy.apache.org Subject:  not sure about Collection.intersect Groovy 2.4.4 / 2.4.5   Hi – I’d like to get a li

not sure about Collection.intersect

2016-02-08 Thread Strachan, Paul
Groovy 2.4.4 / 2.4.5 Hi - I'd like to get a list of objects from collection A that exist in collection B using intersect() but I'm getting no results: def c1 = []// as Set def c2 = []// as Set c1 << new TestClass(name: 'mike') c2 << new TestClass(name: 'mike') println c1.contains(c2[0]) assert