JDK-8175789 : Release Note: De-synchronize java.util.Properties getter methods
  • Type: Sub-task
  • Component: core-libs
  • Sub-Component: java.util
  • Affected Version: 9
  • Priority: P3
  • Status: Closed
  • Resolution: Delivered
  • Submitted: 2017-02-23
  • Updated: 2017-09-22
  • Resolved: 2017-02-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9Resolved
Description
`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.