From notifications-return-11793-archive-asf-public=cust-asf.ponee.io@groovy.apache.org Thu Apr 12 06:24:05 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 1D940180718 for ; Thu, 12 Apr 2018 06:24:03 +0200 (CEST) Received: (qmail 54018 invoked by uid 500); 12 Apr 2018 04:24: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 54009 invoked by uid 99); 12 Apr 2018 04:24:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Apr 2018 04:24:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id A0DB3C0157 for ; Thu, 12 Apr 2018 04:24:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-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 (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id VGOtUoCAp55b for ; Thu, 12 Apr 2018 04:24: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 093EF5FD38 for ; Thu, 12 Apr 2018 04:24: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 7044CE00B8 for ; Thu, 12 Apr 2018 04:24: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 2D0CB241C7 for ; Thu, 12 Apr 2018 04:24:00 +0000 (UTC) Date: Thu, 12 Apr 2018 04:24:00 +0000 (UTC) From: "Daniel Sun (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 ] Daniel Sun updated GROOVY-8537: ------------------------------- Fix Version/s: 2.5.0-rc-2 2.6.0-alpha-4 3.0.0-alpha-2 > 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 > Assignee: Paul King > Priority: Major > Labels: easyfix > Fix For: 3.0.0-alpha-2, 2.6.0-alpha-4, 2.4.16, 2.5.0-rc-2 > > > 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)