commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Diogo Sousa (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (COLLECTIONS-584) Deserializing an AbstractHashedMap expands the hash table exponentially
Date Mon, 14 Dec 2015 22:49:46 GMT

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

Diogo Sousa closed COLLECTIONS-584.
-----------------------------------

See comment.

> 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)

Mime
View raw message