Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 29975 invoked from network); 4 Dec 2005 22:27:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 4 Dec 2005 22:27:03 -0000 Received: (qmail 48468 invoked by uid 500); 4 Dec 2005 22:26:59 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 47973 invoked by uid 500); 4 Dec 2005 22:26:58 -0000 Mailing-List: contact harmony-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-dev@incubator.apache.org Received: (qmail 47962 invoked by uid 99); 4 Dec 2005 22:26:57 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 Dec 2005 14:26:57 -0800 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of GHARLEY@uk.ibm.com designates 195.212.29.136 as permitted sender) Received: from [195.212.29.136] (HELO mtagate3.uk.ibm.com) (195.212.29.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 Dec 2005 14:26:57 -0800 Received: from d06nrmr1407.portsmouth.uk.ibm.com (d06nrmr1407.portsmouth.uk.ibm.com [9.149.38.185]) by mtagate3.uk.ibm.com (8.12.10/8.12.10) with ESMTP id jB4MQaQg194472 for ; Sun, 4 Dec 2005 22:26:36 GMT Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1407.portsmouth.uk.ibm.com (8.12.10/NCO/VERS6.8) with ESMTP id jB4MQZT4225182 for ; Sun, 4 Dec 2005 22:26:35 GMT Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.12.11/8.13.3) with ESMTP id jB4MQZNF021104 for ; Sun, 4 Dec 2005 22:26:35 GMT Received: from d06ml066.portsmouth.uk.ibm.com (d06ml066.portsmouth.uk.ibm.com [9.149.38.139]) by d06av02.portsmouth.uk.ibm.com (8.12.11/8.12.11) with ESMTP id jB4MQZPG021098 for ; Sun, 4 Dec 2005 22:26:35 GMT In-Reply-To: <4391B1E3.60605@gmail.com> To: harmony-dev@incubator.apache.org Subject: Re: [jira] Updated: (HARMONY-19) Divide by zero exception when rotating an empty List MIME-Version: 1.0 X-Mailer: Lotus Notes Release 7.0 HF85 November 04, 2005 From: George Harley1 X-MIMETrack: S/MIME Sign by Notes Client on George Harley1/UK/IBM(Release 7.0 HF85|November 04, 2005) at 04/12/2005 22:26:35, Serialize by Notes Client on George Harley1/UK/IBM(Release 7.0 HF85|November 04, 2005) at 04/12/2005 22:26:35, Serialize complete at 04/12/2005 22:26:35, S/MIME Sign failed at 04/12/2005 22:26:35: The cryptographic key was not found, Serialize by Router on D06ML066/06/M/IBM(Release 6.53HF247 | January 6, 2005) at 04/12/2005 22:26:34, Serialize complete at 04/12/2005 22:26:34 Message-ID: Date: Sun, 4 Dec 2005 22:26:33 +0000 Content-Type: text/plain; charset="US-ASCII" X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi Tim, No worries. Tweak away. Bye for now, George ________________________________________ George C. Harley Tim Ellison 03/12/2005 14:55 Please respond to harmony-dev@incubator.apache.org To harmony-dev@incubator.apache.org cc Subject Re: [jira] Updated: (HARMONY-19) Divide by zero exception when rotating an empty List George, I was just tweaking your JIRA report to reflect the new classlib component that Geir (I assume) created -- and it was something of an experiment to see if JIRA allows people to modify other 'random' issues. I've used Bugzilla before, but not JIRA so having a play, hope that's ok. Regards, Tim Tim Ellison (JIRA) wrote: > [ http://issues.apache.org/jira/browse/HARMONY-19?page=all ] > > Tim Ellison updated HARMONY-19: > ------------------------------- > > Component: Classlib > (was: Contributions) > > >>Divide by zero exception when rotating an empty List >>---------------------------------------------------- >> >> Key: HARMONY-19 >> URL: http://issues.apache.org/jira/browse/HARMONY-19 >> Project: Harmony >> Type: Bug >> Components: Classlib >> Environment: All >> Reporter: George Harley >> Assignee: Geir Magnusson Jr >> Priority: Minor >> Attachments: HARMONY-19-patch-20051202.txt >> >>The implementation of method rotate(List, int) in java.util.Collections is not >>checking the size of the input list prior to attempting the rotation. As a >>result, when called with an empty List argument a java.lang.ArithmeticException >>will occur because of the the subsequent divide by zero operation. >>The problem can be demonstrated in the below unit test case ... >> public void testRotateEmptyList() { >> // Create an *empty* list >> List list = new ArrayList(); >> try { >> Collections.rotate(list, 25); >> } catch (Exception e) { >> fail("Unexpected exception rotating empty List : " + e); >> } >> } > > -- Tim Ellison (t.p.ellison@gmail.com) IBM Java technology centre, UK.