Hi Tim, No worries. Tweak away.
Bye for now, George ________________________________________ George C. Harley Tim Ellison <[EMAIL PROTECTED]> 03/12/2005 14:55 Please respond to [email protected] To [email protected] 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 ([EMAIL PROTECTED]) IBM Java technology centre, UK.
