commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r636641 - /commons/proper/lang/trunk/src/java/org/apache/commons/lang/Entities.java
Date Thu, 13 Mar 2008 06:11:31 GMT
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) {



Mime
View raw message