commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scolebou...@apache.org
Subject svn commit: r169102 - in /jakarta/commons/proper/collections/trunk: RELEASE-NOTES.html src/java/org/apache/commons/collections/map/AbstractHashedMap.java
Date Sat, 07 May 2005 18:04:33 GMT
Author: scolebourne
Date: Sat May  7 11:04:32 2005
New Revision: 169102

URL: http://svn.apache.org/viewcvs?rev=169102&view=rev
Log:
Calculate threshold before putting data in deserialization to avoid memory issue
bug 34265, reported by Marcos Cesar de Oliveira

Modified:
    jakarta/commons/proper/collections/trunk/RELEASE-NOTES.html
    jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/map/AbstractHashedMap.java

Modified: jakarta/commons/proper/collections/trunk/RELEASE-NOTES.html
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/collections/trunk/RELEASE-NOTES.html?rev=169102&r1=169101&r2=169102&view=diff
==============================================================================
--- jakarta/commons/proper/collections/trunk/RELEASE-NOTES.html (original)
+++ jakarta/commons/proper/collections/trunk/RELEASE-NOTES.html Sat May  7 11:04:32 2005
@@ -64,6 +64,7 @@
 <li>AbstractLinkedMap.init() - Now calls createEntry() to create the map entry object
[33706]</li>
 <li>BeanMap.initialize() - Internal variable now correctly initialised with only write
methods that actually exist [15895]</li>
 <li>TransformedMap.putAll - Now allows putAll of an empty map [34686]</li>
+<li>AbstractHashedMap deserialization - Fix to prevent doubling of internal data array
[34265]</li>
 </ul>
 
 <center><h3>JAVADOC</h3></center>

Modified: jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/map/AbstractHashedMap.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/map/AbstractHashedMap.java?rev=169102&r1=169101&r2=169102&view=diff
==============================================================================
--- jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/map/AbstractHashedMap.java
(original)
+++ jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/map/AbstractHashedMap.java
Sat May  7 11:04:32 2005
@@ -1204,13 +1204,13 @@
         int capacity = in.readInt();
         int size = in.readInt();
         init();
+        threshold = calculateThreshold(capacity, loadFactor);
         data = new HashEntry[capacity];
         for (int i = 0; i < size; i++) {
             Object key = in.readObject();
             Object value = in.readObject();
             put(key, value);
         }
-        threshold = calculateThreshold(data.length, loadFactor);
     }
     
     //-----------------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message