Repository: groovy Updated Branches: refs/heads/GROOVY_2_6_X 83391ce60 -> 40c7fcef1
GROOVY-8537: GroovyCollections.combinations should return an empty list if one of the source collections is empty (closes #682) Project: http://git-wip-us.apache.org/repos/asf/groovy/repo Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/40c7fcef Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/40c7fcef Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/40c7fcef Branch: refs/heads/GROOVY_2_6_X Commit: 40c7fcef12405f206a7072e4fc1d4b59f3a13479 Parents: c1eda75 Author: Paul King <pa...@asert.com.au> Authored: Wed Apr 11 16:38:41 2018 +1000 Committer: Paul King <pa...@asert.com.au> Committed: Wed Apr 11 16:39:25 2018 +1000 ---------------------------------------------------------------------- src/main/groovy/groovy/util/GroovyCollections.java | 1 + 1 file changed, 1 insertion(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/groovy/blob/40c7fcef/src/main/groovy/groovy/util/GroovyCollections.java ---------------------------------------------------------------------- diff --git a/src/main/groovy/groovy/util/GroovyCollections.java b/src/main/groovy/groovy/util/GroovyCollections.java index 3f637ef..19bef50 100644 --- a/src/main/groovy/groovy/util/GroovyCollections.java +++ b/src/main/groovy/groovy/util/GroovyCollections.java @@ -91,6 +91,7 @@ public class GroovyCollections { * is <code>[['a', 1], ['b', 1], ['a', 2], ['b', 2], ['a', 3], ['b', 3]]</code>. * If a non-collection item is given, it is treated as a singleton collection, * i.e. <code>combinations([[1, 2], 'x'])</code> is <code>[[1, 'x'], [2, 'x']]</code>. + * If an empty collection is found within the given collections, the result will be an empty list. * * @param collections the Iterable of given collections * @return a List of the combinations found