You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ba...@apache.org on 2008/03/13 07:11:31 UTC

svn commit: r636641 - /commons/proper/lang/trunk/src/java/org/apache/commons/lang/Entities.java

Author: bayard
Date: Wed Mar 12 23:11:30 2008
New Revision: 636641

URL: http://svn.apache.org/viewvc?rev=636641&view=rev
Log:
Fixing a possible overflow in the >> 1 divide by two by using >>> 1 instead. Findbugs pointed this out> 

Modified:
    commons/proper/lang/trunk/src/java/org/apache/commons/lang/Entities.java

Modified: commons/proper/lang/trunk/src/java/org/apache/commons/lang/Entities.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Entities.java?rev=636641&r1=636640&r2=636641&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/java/org/apache/commons/lang/Entities.java (original)
+++ commons/proper/lang/trunk/src/java/org/apache/commons/lang/Entities.java Wed Mar 12 23:11:30 2008
@@ -679,7 +679,7 @@
             int high = size - 1;
 
             while (low <= high) {
-                int mid = (low + high) >> 1;
+                int mid = (low + high) >>> 1;
                 int midVal = values[mid];
 
                 if (midVal < key) {