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

Unsafe publication of java.util.Properties.map

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • P3
    • Resolution: Fixed
    • 9, 10, 11
    • 11
    • core-libs
    • b19
    • Not verified

    Backports

      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).

        Attachments

          Issue Links

            Activity

              People

                redestad Claes Redestad
                redestad Claes Redestad
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: