Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 3473 invoked from network); 3 Dec 2005 14:56:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 3 Dec 2005 14:56:00 -0000 Received: (qmail 10568 invoked by uid 500); 3 Dec 2005 14:55:59 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 9740 invoked by uid 500); 3 Dec 2005 14:55:56 -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 9729 invoked by uid 99); 3 Dec 2005 14:55:56 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Dec 2005 06:55:56 -0800 X-ASF-Spam-Status: No, hits=1.4 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: 217.158.94.220 is neither permitted nor denied by domain of t.p.ellison@gmail.com) Received: from [217.158.94.220] (HELO cirrus.purplecloud.com) (217.158.94.220) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Dec 2005 06:57:24 -0800 Received: (qmail 11103 invoked from network); 3 Dec 2005 14:55:32 +0000 Received: from unknown (HELO ?192.168.0.2?) (85.133.120.161) by smtp.purplecloud.net with (DHE-RSA-AES256-SHA encrypted) SMTP; 3 Dec 2005 14:55:32 +0000 Message-ID: <4391B1E3.60605@gmail.com> Date: Sat, 03 Dec 2005 14:55:31 +0000 From: Tim Ellison User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 To: harmony-dev@incubator.apache.org Subject: Re: [jira] Updated: (HARMONY-19) Divide by zero exception when rotating an empty List References: <774244298.1133562750796.JavaMail.jira@ajax.apache.org> In-Reply-To: <774244298.1133562750796.JavaMail.jira@ajax.apache.org> X-Enigmail-Version: 0.93.0.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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.