Created
August 26, 2016 19:15
-
-
Save yackx/55c148a6294ec30ba5d96a15ae127506 to your computer and use it in GitHub Desktop.
Check for Collection.intersect() bug that affects some Groovy versions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Check Groovy intersect bug | |
def checkIntersectBug() { | |
def foo = [[1], [2], [3]] | |
def bar = [[2], [3], [4]] | |
if (foo.intersect(bar).size() != 2) { | |
println '''Warning! | |
The version of Groovy that you are running contains a bug on Collection.intersect(). | |
Upgrade to 2.4.7 or later. | |
See http://stackoverflow.com/questions/35493088/groovy-strange-collectionintersect-behaviour | |
This program will not function correctly under this version. | |
Exiting''' | |
System.exit(1) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment