harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r568958 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Arrays.java
Date Thu, 23 Aug 2007 12:42:09 GMT
Author: tellison
Date: Thu Aug 23 05:42:09 2007
New Revision: 568958

URL: http://svn.apache.org/viewvc?rev=568958&view=rev
Log:
Fix for HARMONY-4669 (BinarySearches in Arrays broken)

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

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Arrays.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Arrays.java?rev=568958&r1=568957&r2=568958&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Arrays.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Arrays.java Thu Aug
23 05:42:09 2007
@@ -178,7 +178,7 @@
     public static int binarySearch(byte[] array, byte value) {
         int low = 0, mid = -1, high = array.length - 1;
         while (low <= high) {
-            mid = (low + high) >> 1;
+            mid = (low + high) >>> 1;
             if (value > array[mid]) {
                 low = mid + 1;
             } else if (value == array[mid]) {
@@ -208,7 +208,7 @@
     public static int binarySearch(char[] array, char value) {
         int low = 0, mid = -1, high = array.length - 1;
         while (low <= high) {
-            mid = (low + high) >> 1;
+            mid = (low + high) >>> 1;
             if (value > array[mid]) {
                 low = mid + 1;
             } else if (value == array[mid]) {
@@ -238,7 +238,7 @@
         long longBits = Double.doubleToLongBits(value);
         int low = 0, mid = -1, high = array.length - 1;
         while (low <= high) {
-            mid = (low + high) >> 1;
+            mid = (low + high) >>> 1;
             if (lessThan(array[mid], value)) {
                 low = mid + 1;
             } else if (longBits == Double.doubleToLongBits(array[mid])) {
@@ -268,7 +268,7 @@
         int intBits = Float.floatToIntBits(value);
         int low = 0, mid = -1, high = array.length - 1;
         while (low <= high) {
-            mid = (low + high) >> 1;
+            mid = (low + high) >>> 1;
             if (lessThan(array[mid], value)) {
                 low = mid + 1;
             } else if (intBits == Float.floatToIntBits(array[mid])) {
@@ -297,7 +297,7 @@
     public static int binarySearch(int[] array, int value) {
         int low = 0, mid = -1, high = array.length - 1;
         while (low <= high) {
-            mid = (low + high) >> 1;
+            mid = (low + high) >>> 1;
             if (value > array[mid]) {
                 low = mid + 1;
             } else if (value == array[mid]) {
@@ -326,7 +326,7 @@
     public static int binarySearch(long[] array, long value) {
         int low = 0, mid = -1, high = array.length - 1;
         while (low <= high) {
-            mid = (low + high) >> 1;
+            mid = (low + high) >>> 1;
             if (value > array[mid]) {
                 low = mid + 1;
             } else if (value == array[mid]) {
@@ -365,7 +365,7 @@
         Comparable<Object> key = (Comparable<Object>) object;
         int low = 0, mid = 0, high = array.length - 1, result = 0;
         while (low <= high) {
-            mid = (low + high) >> 1;
+            mid = (low + high) >>> 1;
             if ((result = key.compareTo(array[mid])) > 0) {
                 low = mid + 1;
             } else if (result == 0) {
@@ -402,7 +402,7 @@
 
         int low = 0, mid = 0, high = array.length - 1, result = 0;
         while (low <= high) {
-            mid = (low + high) >> 1;
+            mid = (low + high) >>> 1;
             if ((result = comparator.compare(array[mid], object)) < 0) {
                 low = mid + 1;
             } else if (result == 0) {
@@ -428,7 +428,7 @@
     public static int binarySearch(short[] array, short value) {
         int low = 0, mid = -1, high = array.length - 1;
         while (low <= high) {
-            mid = (low + high) >> 1;
+            mid = (low + high) >>> 1;
             if (value > array[mid]) {
                 low = mid + 1;
             } else if (value == array[mid]) {
@@ -2420,7 +2420,7 @@
             }
             return;
         }
-        int med = (end + start) >> 1;
+        int med = (end + start) >>> 1;
         mergeSort(out, in, start, med);
         mergeSort(out, in, med, end);
 
@@ -2502,7 +2502,7 @@
             }
             return;
         }
-        int med = (end + start) >> 1;
+        int med = (end + start) >>> 1;
         mergeSort(out, in, start, med, c);
         mergeSort(out, in, med, end, c);
 
@@ -2584,7 +2584,7 @@
             d <<= 1;
         }
         while (l <= r) {
-            m = (l + r) >> 1;
+            m = (l + r) >>> 1;
             if (val.compareTo(arr[m]) > bnd) {
                 l = m + 1;
             } else {
@@ -2630,7 +2630,7 @@
             d <<= 1;
         }
         while (l <= r) {
-            m = (l + r) >> 1;
+            m = (l + r) >>> 1;
             if (c.compare(val, arr[m]) > bnd) {
                 l = m + 1;
             } else {



Mime
View raw message