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

Unsafe publication of java.util.Properties.map

    Details

    • Type: Bug
    • Status: Open
    • Priority: P3
    • Resolution: Unresolved
    • Affects Version/s: 9, 10, 11
    • Fix Version/s: 11
    • Component/s: core-libs
    • Labels:
      None

      Description

      JDK-8029891 refactored java.util.Properties to use a transient ConcurrentHashMap that is read from without synchronization. However, I think this implementation opens up the possibility of the map being observed as null in certain methods (such as get) when called from other threads.

      One way to fix this would be by making the map field final (which would necessitate using something like Unsafe.putObjectVolatile to set the field during deserialization).

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            bchristi Brent Christian
            Reporter:
            redestad Claes Redestad
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: