Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.0, 1.1-beta-1, 1.1-beta-2
-
None
-
Patch
Description
DefaultGroovyMethods.minus(List, Collection removeMe) and DefaultGroovyMethods.NumberAwareComparator have two problems.<br>
1. dupplicate values that are not Comparable cause IllegalStateExceptions
<code>
def a = new Object()
// throws IllegalStateException
assert [] == [ a ] - [ a, a ]
</code><br>
2. null values are not removed from a List
<code>
// fails
assert [] == [ null ] - [ null ]
</code><br>
I have attached a unit test and a fix based on the groovy-1.1-beta-2 source.