Uploaded image for project: 'Commons Collections'
  1. Commons Collections
  2. COLLECTIONS-599

HashEntry array object naming data initialized with double the size during deserialization

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 3.1
    • Fix Version/s: 4.1
    • Component/s: Collection, Map
    • Labels:
      None
    • Flags:
      Important

      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 :

      protected void checkCapacity()
        {
          if (this.size >= this.threshold)
          {
            int newCapacity = this.data.length * 2;
            if (newCapacity <= 1073741824) {
              ensureCapacity(newCapacity);
            }
          }
        }
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              tejast5 Tejas Patel
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: