classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] Collections.rotate() vs empty lists.


From: Mark Wielaard
Subject: [cp-patches] Collections.rotate() vs empty lists.
Date: Mon, 20 Sep 2004 00:02:03 +0200

Hi,

This fixes a small issue found by one of the new Collections tests from
David.

2004-09-19  Mark Wielaard  <address@hidden>

        * java/util/Collections.java (rotate): Just return when list is empty.

Committed,

Mark

diff -u -r1.28 Collections.java
--- java/util/Collections.java  17 Apr 2004 19:23:19 -0000      1.28
+++ java/util/Collections.java  19 Sep 2004 21:59:42 -0000
@@ -1110,6 +1110,8 @@
   public static void rotate(List list, int distance)
   {
     int size = list.size();
+    if (size == 0)
+      return;
     distance %= size;
     if (distance == 0)
       return;

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]