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/a4542b9e
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/a4542b9e
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/a4542b9e

Branch: refs/heads/GROOVY_2_4_X
Commit: a4542b9ef292017feaaab1e62bd59000ea3b125c
Parents: 12fd2a6
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:40:32 2018 +1000

----------------------------------------------------------------------
 src/main/groovy/util/GroovyCollections.java | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/a4542b9e/src/main/groovy/util/GroovyCollections.java
----------------------------------------------------------------------
diff --git a/src/main/groovy/util/GroovyCollections.java 
b/src/main/groovy/util/GroovyCollections.java
index 54a1a32..5a5b08d 100644
--- a/src/main/groovy/util/GroovyCollections.java
+++ b/src/main/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

Reply via email to