hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cdoug...@apache.org
Subject svn commit: r746166 - in /hadoop/core/trunk: CHANGES.txt src/core/org/apache/hadoop/util/bloom/HashFunction.java
Date Fri, 20 Feb 2009 06:28:18 GMT
Author: cdouglas
Date: Fri Feb 20 06:28:18 2009
New Revision: 746166

URL: http://svn.apache.org/viewvc?rev=746166&view=rev
Log:
HADOOP-5255. Fix use of Math.abs to avoid overflow. Contributed by Jonathan Ellis.

Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/core/org/apache/hadoop/util/bloom/HashFunction.java

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=746166&r1=746165&r2=746166&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Fri Feb 20 06:28:18 2009
@@ -798,6 +798,9 @@
     HADOOP-4692. Namenode in infinite loop for replicating/deleting corrupt
     blocks. (hairong)
 
+    HADOOP-5255. Fix use of Math.abs to avoid overflow. (Jonathan Ellis via
+    cdouglas)
+
 Release 0.19.1 - Unreleased
 
   IMPROVEMENTS

Modified: hadoop/core/trunk/src/core/org/apache/hadoop/util/bloom/HashFunction.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/core/org/apache/hadoop/util/bloom/HashFunction.java?rev=746166&r1=746165&r2=746166&view=diff
==============================================================================
--- hadoop/core/trunk/src/core/org/apache/hadoop/util/bloom/HashFunction.java (original)
+++ hadoop/core/trunk/src/core/org/apache/hadoop/util/bloom/HashFunction.java Fri Feb 20 06:28:18
2009
@@ -112,7 +112,7 @@
       int[] result = new int[nbHash];
       for (int i = 0, initval = 0; i < nbHash; i++) {
 	  initval = hashFunction.hash(b, initval);
-	  result[i] = Math.abs(initval) % maxValue;
+	  result[i] = Math.abs(initval % maxValue);
       }
       return result;
   }



Mime
View raw message