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

map.StaticBucketMap.size() needs to synchronize access to lock

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.2.2, 4.0-alpha1, 4.0
    • Component/s: Collection
    • Labels:
      None
    • Environment:

      collections_jdk5_branch

      Description

      The field Lock.size is updated using synchronization, however the StaticBucketMap.size() method reads the values without synch.

      If the read is done in a different thread from the updates, there is no guarantee that the reading thread will see the most recent value.

        Attachments

          Activity

            People

            • Assignee:
              jochen@apache.org Jochen Wiedmann
              Reporter:
              sebb@apache.org Sebb
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: