You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary Gregory (JIRA)" <ji...@apache.org> on 2017/11/06 15:52:00 UTC
[jira] [Updated] (COLLECTIONS-599) HashEntry array object naming
data initialized with double the size during deserialization
[ https://issues.apache.org/jira/browse/COLLECTIONS-599?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gary Gregory updated COLLECTIONS-599:
-------------------------------------
Description:
Common collections 3.1 and 3.2 are used at many places and frameworks including struts2.
Supose a LinkedMap object it is created and have size greater than zero is serialized. While deserializing this object , array of HashEntry naming data delacred in AbstractHashedMap always initialises with a new capacity of double its double of the serialized object.
Please see the below API declared in AbstractHashedMap class :
{code:java}
protected void checkCapacity()
{
if (this.size >= this.threshold)
{
int newCapacity = this.data.length * 2;
if (newCapacity <= 1073741824) {
ensureCapacity(newCapacity);
}
}
}
{code}
was:
Common collections 3.1 and 3.2 are used at many places and frameworks including struts2.
Supose a LinkedMap object it is created and have size greater than zero is serialized. While deserializing this object , array of HashEntry naming data delacred in AbstractHashedMap always initialises with a new capacity of double its double of the serialized object.
Please see the below API declared in AbstractHashedMap class :
protected void checkCapacity()
{
if (this.size >= this.threshold)
{
int newCapacity = this.data.length * 2;
if (newCapacity <= 1073741824) {
ensureCapacity(newCapacity);
}
}
}
> HashEntry array object naming data initialized with double the size during deserialization
> ------------------------------------------------------------------------------------------
>
> Key: COLLECTIONS-599
> URL: https://issues.apache.org/jira/browse/COLLECTIONS-599
> Project: Commons Collections
> Issue Type: Bug
> Components: Collection, Map
> Affects Versions: 3.1
> Reporter: Tejas Patel
> Priority: Critical
> Fix For: 4.1
>
>
> Common collections 3.1 and 3.2 are used at many places and frameworks including struts2.
> Supose a LinkedMap object it is created and have size greater than zero is serialized. While deserializing this object , array of HashEntry naming data delacred in AbstractHashedMap always initialises with a new capacity of double its double of the serialized object.
> Please see the below API declared in AbstractHashedMap class :
> {code:java}
> protected void checkCapacity()
> {
> if (this.size >= this.threshold)
> {
> int newCapacity = this.data.length * 2;
> if (newCapacity <= 1073741824) {
> ensureCapacity(newCapacity);
> }
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)