harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r824002 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/TreeMap.java
Date Sun, 11 Oct 2009 02:52:46 GMT
Author: ndbeyer
Date: Sun Oct 11 02:52:45 2009
New Revision: 824002

URL: http://svn.apache.org/viewvc?rev=824002&view=rev
Log:
convert signed shift to unsigned shift to preven possible overflow

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

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/TreeMap.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/TreeMap.java?rev=824002&r1=824001&r2=824002&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/TreeMap.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/TreeMap.java Sun
Oct 11 02:52:45 2009
@@ -536,7 +536,7 @@
                         foundIndex = right_idx;
                         int low = left_idx + 1, mid = 0, high = right_idx - 1;
                         while (low <= high) {
-                            mid = (low + high) >> 1;
+                            mid = (low + high) >>> 1;
                             result = backingMap.cmp(object, key, keys[mid]);
                             if (result > 0) {
                                 low = mid + 1;
@@ -658,7 +658,7 @@
                         foundIndex = left_idx;
                         int low = left_idx + 1, mid = 0, high = right_idx - 1;
                         while (low <= high) {
-                            mid = (low + high) >> 1;
+                            mid = (low + high) >>> 1;
                             result = backingMap.cmp(object, key, keys[mid]);
                             if (result > 0) {
                                 foundNode = node;
@@ -1129,7 +1129,7 @@
                 } else { /*search in node*/
                     int low = left_idx + 1, mid = 0, high = right_idx - 1;
                     while (low <= high) {
-                        mid = (low + high) >> 1;
+                        mid = (low + high) >>> 1;
                         result = cmp(object, keyK, keys[mid]);
                         if (result > 0) {
                             low = mid + 1;
@@ -1293,7 +1293,7 @@
                 } else { /*search in node*/
                     int low = left_idx + 1, mid = 0, high = right_idx - 1;
                     while (low <= high) {
-                        mid = (low + high) >> 1;
+                        mid = (low + high) >>> 1;
                         result = cmp(object, keyK, keys[mid]);
                         if (result > 0) {
                             low = mid + 1;
@@ -1479,7 +1479,7 @@
                 } else { /*search in node*/
                     int low = left_idx + 1, mid = 0, high = right_idx - 1;
                     while (low <= high) {
-                        mid = (low + high) >> 1;
+                        mid = (low + high) >>> 1;
                         result = cmp(object, keyK, keys[mid]);
                         if (result > 0) {
                             low = mid + 1;
@@ -1870,7 +1870,7 @@
                 } else { /*search in node*/
                     int low = left_idx + 1, mid = 0, high = right_idx - 1;
                     while (low <= high) {
-                        mid = (low + high) >> 1;
+                        mid = (low + high) >>> 1;
                         result = cmp(object, keyK, keys[mid]);
                         if (result > 0) {
                             low = mid + 1;



Mime
View raw message