Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8029891 Deadlock detected in java/lang/ClassLoader/deadlock/GetResource.java
  3. JDK-8175789

Release Note: De-synchronize java.util.Properties getter methods

XMLWordPrintable

    • Verified

      `java.util.Properties` is a subclass of the legacy `Hashtable` class, which synchronizes on itself for any access. System properties are stored in a `Properties` object. They are a common way to change default settings, and sometimes must be read during classloading.

      `System.getProperties()` returns the same `Properties` instance accessed by the system, which any application code might synchronize on. This situation has lead to deadlocks in the past, such as 6977738.

      The `Properties` class has been updated to store its values in an internal `ConcurrentHashMap` (instead of using the inherited `Hashtable` mechanism), and its getter methods and legacy `Enumeration`s are no longer synchronized. This should reduce the potential for deadlocks. It also means that since `Properties`' `Iterator`s are now generated by `ConcurrentHashMap`, they don't *fail-fast* - `ConcurrentModificationException`s are no longer thrown.

            bchristi Brent Christian
            bchristi Brent Christian
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: