JDK-8073394 : Clock.systemUTC() should return a constant
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.time
  • Affected Version: 8
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2015-02-18
  • Updated: 2015-06-04
  • Resolved: 2015-02-24
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
9 b53Fixed
Related Reports
Relates :  
Description
The java.time.Clock::systemUTC() method currently creates an instance every time it is called. It should return a private constant instead, as the returned instance is immutable and could be shared.

The spec does not constrain this method - "The returned implementation is immutable, thread-safe and {@code Serializable}. It is equivalent to {@code system(ZoneOffset.UTC)}." - which would still be satisfied by returning a constant instead of a new instance.