hadoop-common-commits mailing list archives

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

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

Modified:
    hadoop/core/branches/branch-0.20/CHANGES.txt
    hadoop/core/branches/branch-0.20/src/core/org/apache/hadoop/util/bloom/HashFunction.java

Modified: hadoop/core/branches/branch-0.20/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.20/CHANGES.txt?rev=746167&r1=746166&r2=746167&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.20/CHANGES.txt (original)
+++ hadoop/core/branches/branch-0.20/CHANGES.txt Fri Feb 20 06:28:32 2009
@@ -610,6 +610,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/branches/branch-0.20/src/core/org/apache/hadoop/util/bloom/HashFunction.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.20/src/core/org/apache/hadoop/util/bloom/HashFunction.java?rev=746167&r1=746166&r2=746167&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.20/src/core/org/apache/hadoop/util/bloom/HashFunction.java
(original)
+++ hadoop/core/branches/branch-0.20/src/core/org/apache/hadoop/util/bloom/HashFunction.java
Fri Feb 20 06:28:32 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