-
Sub-task
-
Resolution: Delivered
-
P3
-
9
-
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.
`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.