directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r952236 - /directory/apacheds/trunk/jdbm/src/main/java/jdbm/btree/BPage.java
Date Mon, 07 Jun 2010 14:16:58 GMT
Author: felixk
Date: Mon Jun  7 14:16:57 2010
New Revision: 952236

URL: http://svn.apache.org/viewvc?rev=952236&view=rev
Log:
Computation of average could overflow
http://findbugs.sourceforge.net/bugDescriptions.html#IM_AVERAGE_COMPUTATION_COULD_OVERFLOW

"This bug exists in many earlier implementations of binary search and merge sort."

Modified:
    directory/apacheds/trunk/jdbm/src/main/java/jdbm/btree/BPage.java

Modified: directory/apacheds/trunk/jdbm/src/main/java/jdbm/btree/BPage.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm/src/main/java/jdbm/btree/BPage.java?rev=952236&r1=952235&r2=952236&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm/src/main/java/jdbm/btree/BPage.java (original)
+++ directory/apacheds/trunk/jdbm/src/main/java/jdbm/btree/BPage.java Mon Jun  7 14:16:57
2010
@@ -798,7 +798,7 @@ public class BPage<K, V> implements Seri
         // binary search
         while ( left < right )
         {
-            int middle = ( left + right ) >> 1;
+            int middle = ( left + right ) >>> 1;
             
             int comp = compare( keys[middle], key );
             



Mime
View raw message