From notifications-return-11754-archive-asf-public=cust-asf.ponee.io@groovy.apache.org Sun Apr 8 04:30:04 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 3760918064E for ; Sun, 8 Apr 2018 04:30:04 +0200 (CEST) Received: (qmail 65950 invoked by uid 500); 8 Apr 2018 02:30:03 -0000 Mailing-List: contact notifications-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@groovy.apache.org Delivered-To: mailing list notifications@groovy.apache.org Received: (qmail 65941 invoked by uid 99); 8 Apr 2018 02:30:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Apr 2018 02:30:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 9A79F18072E for ; Sun, 8 Apr 2018 02:30:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.511 X-Spam-Level: X-Spam-Status: No, score=-109.511 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 6Zcn-N7tN11X for ; Sun, 8 Apr 2018 02:30:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 7A3845F238 for ; Sun, 8 Apr 2018 02:30:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 97D38E0A8F for ; Sun, 8 Apr 2018 02:30:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 21E2A241C4 for ; Sun, 8 Apr 2018 02:30:00 +0000 (UTC) Date: Sun, 8 Apr 2018 02:30:00 +0000 (UTC) From: "Venkatesh-Prasad Ranganath (JIRA)" To: notifications@groovy.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (GROOVY-8537) GroovyCollections.combinations(Iterable) exhibits incorrect (asymmetric) behavior MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/GROOVY-8537?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:all-tabpanel ] Venkatesh-Prasad Ranganath updated GROOVY-8537: ----------------------------------------------- Summary: GroovyCollections.combinations(Iterable) exhibits incorrect (a= symmetric) behavior (was: GroovyCollections.combinations(Iterable) exhibit= s incorrect asymmetric behavior) > GroovyCollections.combinations(Iterable) exhibits incorrect (asymmetric) = behavior > -------------------------------------------------------------------------= -------- > > Key: GROOVY-8537 > URL: https://issues.apache.org/jira/browse/GROOVY-8537 > Project: Groovy > Issue Type: Bug > Components: groovy-jdk > Affects Versions: 2.4.15 > Reporter: Venkatesh-Prasad Ranganath > Priority: Major > Labels: easyfix > > h4. *Issue* > When GroovyCollections.combinations() is invoked on a collection of itera= bles with at least one empty iterable, the expected return value is an empt= y list of combinations. > Instead, in version 2.4.15 (and I am guessing in earlier versions at leas= t since 2.2.0), the return value of combinations() is sensitive to the orde= r of iterables in the input collection.=C2=A0 Here are two instances of suc= h behavior. > h4. Repro > {{groovy:000> assert [[1,3], []].combinations() =3D=3D [[], [1,3]].combin= ations()}} > {{ERROR org.codehaus.groovy.runtime.powerassert.PowerAssertionError:}} > {{assert [[1,3], []].combinations() =3D=3D [[], [1,3]].combinations()}} > {{=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |}} > {{=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 []=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 false=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 [[1], [3]]}} > =C2=A0 > {{groovy:000> assert [[1,3], [2], []].combinations() =3D=3D [[1,3], [], [= 2]].combinations()}} > {{ERROR org.codehaus.groovy.runtime.powerassert.PowerAssertionError:}} > {{assert [[1,3], [2], []].combinations() =3D=3D [[1,3], [], [2]].combina= tions()}} > {{=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= |=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |}} > {{=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 []=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 false= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 [[2]]}} > h4. *Fix* > Add a short-circuiting check at the start of combinations(Iterable) metho= d to return an empty list of combination if any of the input iterables are = empty. -- This message was sent by Atlassian JIRA (v7.6.3#76005)