RFR: 8073394: Clock.systemUTC() should return a constant
Peter Levart
peter.levart at gmail.com
Mon Feb 23 22:27:59 UTC 2015
Hi Daniel,
On 02/23/2015 06:41 PM, Daniel Fuchs wrote:
> Hi,
>
> Please find below a small patch for
> 8073394: Clock.systemUTC() should return a constant
>
> http://cr.openjdk.java.net/~dfuchs/webrev_8073394/webrev.00/
>
> best regards,
>
> -- daniel
What about the following idea:
- create a (maybe still package-private) instance method
ZoneId.getSystemClock() and cache the per-ZoneId Clock instance inside
the ZoneId.
- Clock.system(ZoneId) static method is then just delegating to
ZoneId.getSystemClock().
- Similarly Clock.systemDefaultZone() can just return
ZoneId.defaultSystem().getSystemClock().
- Similarly Clock.systemUTC() can just return
ZoneOffset.UTC.getSystemClock().
Or do we just want to cache systemUTC() Clock here?
Peter
More information about the core-libs-dev
mailing list