harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r372231 - /incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Collections.java
Date Wed, 25 Jan 2006 14:58:09 GMT
Author: tellison
Date: Wed Jan 25 06:58:06 2006
New Revision: 372231

URL: http://svn.apache.org/viewcvs?rev=372231&view=rev
Log:
Minor change to introduce local var.

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/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Collections.java?rev=372231&r1=372230&r2=372231&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
Wed Jan 25 06:58:06 2006
@@ -1770,7 +1770,7 @@
 	 * like this: [8, 9, 0, 1, 2, 3, 4, 5, 6, 7]
 	 * 
 	 * @param list
-	 * @param dist
+	 * @param normdist
 	 *            It can be any integer: 0, positive, negative, larger than the
 	 *            list size
 	 */
@@ -1783,12 +1783,13 @@
 		}
 
 		// normalize the distance
+		int normdist;
 		if (dist > 0)
-			dist = dist % size;
+			normdist = dist % size;
 		else
-			dist = size - (dist * (-1) % size);
+			normdist = size - (dist * (-1) % size);
 
-		if (dist == 0 || dist == size)
+		if (normdist == 0 || normdist == size)
 			return;
 
 		if (list instanceof RandomAccess) {
@@ -1797,7 +1798,7 @@
 			Object temp = list.get(0);
 			int index = 0, beginIndex = 0;
 			for (int i = 0; i < size; i++) {
-				index = (index + dist) % size;
+				index = (index + normdist) % size;
 				temp = list.set(index, temp);
 				if (index == beginIndex) {
 					index = ++beginIndex;
@@ -1805,7 +1806,7 @@
 				}
 			}
 		} else {
-			int divideIndex = (size - dist) % size;
+			int divideIndex = (size - normdist) % size;
 			List sublist1 = list.subList(0, divideIndex);
 			List sublist2 = list.subList(divideIndex, size);
 			reverse(sublist1);



Mime
View raw message