commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r956280 - /commons/proper/collections/trunk/src/test/org/apache/commons/collections/comparators/TestFixedOrderComparator.java
Date Sat, 19 Jun 2010 19:55:17 GMT
Author: bayard
Date: Sat Jun 19 19:55:17 2010
New Revision: 956280

URL: http://svn.apache.org/viewvc?rev=956280&view=rev
Log:
Code cleanup per COLLECTIONS-312

Modified:
    commons/proper/collections/trunk/src/test/org/apache/commons/collections/comparators/TestFixedOrderComparator.java

Modified: commons/proper/collections/trunk/src/test/org/apache/commons/collections/comparators/TestFixedOrderComparator.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/org/apache/commons/collections/comparators/TestFixedOrderComparator.java?rev=956280&r1=956279&r2=956280&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/test/org/apache/commons/collections/comparators/TestFixedOrderComparator.java
(original)
+++ commons/proper/collections/trunk/src/test/org/apache/commons/collections/comparators/TestFixedOrderComparator.java
Sat Jun 19 19:55:17 2010
@@ -205,22 +205,20 @@ public class TestFixedOrderComparator ex
         // this requires more than one shuffle.
 
         boolean isInNewOrder = false;
+        Random rand = new Random();
         while (keys.length > 1 && isInNewOrder == false) {
-            shuffle: {
-                Random rand = new Random();
-                for (int i = keys.length-1; i > 0; i--) {
-                        String swap = keys[i];
-                        int j = rand.nextInt(i+1);
-                        keys[i] = keys[j];
-                        keys[j] = swap;
-                    }
+            // shuffle:
+            for (int i = keys.length-1; i > 0; i--) {
+                String swap = keys[i];
+                int j = rand.nextInt(i+1);
+                keys[i] = keys[j];
+                keys[j] = swap;
             }
 
-            testShuffle: {
-                for (int i = 0; i < keys.length && !isInNewOrder; i++) {
-                    if( !orderedObjects[i].equals(keys[i])) {
-                        isInNewOrder = true;
-                    }
+            // testShuffle
+            for (int i = 0; i < keys.length && !isInNewOrder; i++) {
+                if( !orderedObjects[i].equals(keys[i])) {
+                    isInNewOrder = true;
                 }
             }
         }



Mime
View raw message