harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r415234 - /incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Collections.java
Date Mon, 19 Jun 2006 02:42:49 GMT
Author: ndbeyer
Date: Sun Jun 18 19:42:49 2006
New Revision: 415234

URL: http://svn.apache.org/viewvc?rev=415234&view=rev
Log:
Fix the sort method that I broke.

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Collections.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Collections.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Collections.java?rev=415234&r1=415233&r2=415234&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Collections.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Collections.java
Sun Jun 18 19:42:49 2006
@@ -1771,14 +1771,14 @@
 	 *                or elements cannot be compared to each other
 	 */
 	public static <T extends Comparable<? super T>> void sort(List<T> list)
{
-        T[] array = list.toArray((T[])new Object[list.size()]);
-		Arrays.sort(array);
-		int i = 0;
-		ListIterator<T> it = list.listIterator();
-		while (it.hasNext()) {
-			it.next();
-			it.set(array[i++]);
-		}
+        Object[] array = list.toArray();
+        Arrays.sort(array);
+        int i = 0;
+        ListIterator<T> it = list.listIterator();
+        while (it.hasNext()) {
+            it.next();
+            it.set((T)array[i++]);
+        }
 	}
 
 	/**
@@ -1800,7 +1800,7 @@
 		ListIterator<T> it = list.listIterator();
 		while (it.hasNext()) {
 			it.next();
-			it.set((T)array[i++]);
+			it.set(array[i++]);
 		}
 	}
 



Mime
View raw message