Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4948459

ObjectName creation is not thread safe

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 1.2.1
    • Fix Version/s: 5.0
    • Component/s: core-svc
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b32
    • CPU:
      generic
    • OS:
      generic

      Description

      The ObjectName class contains a space optimization that causes pairs of integer values (lengths of keys and values) to be shared between different ObjectName instances. So for example, if two ObjectNames have keys and values with the same length, they will use the same objects to represent these pairs of integers. Unfortunately, access to the WeakHashMap that contains these integer pairs is not synchronized. So if two ObjectNames are created at the same time, the WeakHashMap may be modified by two threads concurrently and become corrupted. Thereafter, of course, further ObjectName creation is unlikely to work correctly either.

        Attachments

          Activity

            People

            Assignee:
            lmalvent Luis-Miguel Alventosa (Inactive)
            Reporter:
            emcmanus Eamonn McManus
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: