GROOVY-8537: GroovyCollections.combinations should return an empty list if one
of the source collections is empty (closes #682)
Advertising
Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/e6a0efdb
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/e6a0efdb
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/e6a0efdb
Branch: refs/heads/master
Commit: e6a0efdbf2c8ec836949f01a208a569fc325fafc
Parents: 93ecc0a
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:38:41 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/e6a0efdb/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