commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r1340799 - /commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/bzip2/BlockSort.java
Date Sun, 20 May 2012 18:50:59 GMT
Author: bodewig
Date: Sun May 20 18:50:36 2012
New Revision: 1340799

URL: http://svn.apache.org/viewvc?rev=1340799&view=rev
Log:
Actually this shift is supposed to be unsigned.

Kudos to Findbugs:
http://findbugs.sourceforge.net/bugDescriptions.html#IM_AVERAGE_COMPUTATION_COULD_OVERFLOW

Modified:
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/bzip2/BlockSort.java

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/bzip2/BlockSort.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/bzip2/BlockSort.java?rev=1340799&r1=1340798&r2=1340799&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/bzip2/BlockSort.java
(original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/bzip2/BlockSort.java
Sun May 20 18:50:36 2012
@@ -370,7 +370,7 @@ class BlockSort {
             if (r3 == 0) {
                 med = eclass[fmap[lo]]; 
             } else if (r3 == 1) {
-                med = eclass[fmap[(lo+hi)>>1]];
+                med = eclass[fmap[(lo + hi) >>> 1]];
             } else {
                 med = eclass[fmap[hi]];
             }



Mime
View raw message