mahout-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jman...@apache.org
Subject svn commit: r901693 - /lucene/mahout/trunk/math/src/main/java-templates/org/apache/mahout/math/map/OpenKeyTypeValueTypeHashMap.java.t
Date Thu, 21 Jan 2010 13:15:54 GMT
Author: jmannix
Date: Thu Jan 21 13:15:54 2010
New Revision: 901693

URL: http://svn.apache.org/viewvc?rev=901693&view=rev
Log:
Nasty little bug in the Open primitive map, only found by walking deep in the debugger: clear()
wasn't clearing out the last entry in the values array, so if it was full, it stayed full
after clear()!  This actaully caused infinite loops in certain conditions in other parts of
the codebase.

Modified:
    lucene/mahout/trunk/math/src/main/java-templates/org/apache/mahout/math/map/OpenKeyTypeValueTypeHashMap.java.t

Modified: lucene/mahout/trunk/math/src/main/java-templates/org/apache/mahout/math/map/OpenKeyTypeValueTypeHashMap.java.t
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/math/src/main/java-templates/org/apache/mahout/math/map/OpenKeyTypeValueTypeHashMap.java.t?rev=901693&r1=901692&r2=901693&view=diff
==============================================================================
--- lucene/mahout/trunk/math/src/main/java-templates/org/apache/mahout/math/map/OpenKeyTypeValueTypeHashMap.java.t
(original)
+++ lucene/mahout/trunk/math/src/main/java-templates/org/apache/mahout/math/map/OpenKeyTypeValueTypeHashMap.java.t
Thu Jan 21 13:15:54 2010
@@ -97,7 +97,7 @@
   /** Removes all (key,value) associations from the receiver. Implicitly calls <tt>trimToSize()</tt>.
*/
   @Override
   public void clear() {
-    Arrays.fill(this.state, 0, state.length - 1, FREE);
+    Arrays.fill(this.state, FREE);
     distinct = 0;
     freeEntries = table.length; // delta
     trimToSize();



Mime
View raw message