You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2015/12/14 19:31:46 UTC

[jira] [Updated] (COLLECTIONS-584) Deserializing an AbstractHashedMap expands the hash table exponentially

     [ https://issues.apache.org/jira/browse/COLLECTIONS-584?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebb updated COLLECTIONS-584:
-----------------------------
    Summary: Deserializing an AbstractHashedMap expands the hash table exponentially  (was: Deserializing an AbstractHashedMap expands the hash table exponencially)

> Deserializing an AbstractHashedMap expands the hash table exponentially
> -----------------------------------------------------------------------
>
>                 Key: COLLECTIONS-584
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-584
>             Project: Commons Collections
>          Issue Type: Bug
>    Affects Versions: 4.1
>            Reporter: Diogo Sousa
>
> When deserializing an {{AbstractHashedMap}} the size of the hashtable will be doubled at each element inserted because {{threshold}} = 0, so this
> {code}
> protected void checkCapacity() {
>         if(this.size >= this.threshold) {
>             int newCapacity = this.data.length * 2;
>             if(newCapacity <= 1073741824) {
>                 this.ensureCapacity(newCapacity);
>             }
>         }
>     }
> {code}
> will always expand the hashtable.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)