Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8074023

Clock.system(ZoneId) could be optimized to always return the same clock for a given zone.

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: tbd_minor
    • Component/s: core-libs
    • Labels:
      None

      Description

      Clock.systemUTC() has been optimized to return a constant.
      It would be good if Clock.systemDefaultZone() and Clock.system(ZoneId) could also be optimized to avoid creating new instance of Clock.SystemClock every time they are called.

      One possible solution was proposed on core-libs-dev:
      http://mail.openjdk.java.net/pipermail/core-libs-dev/2015-February/031759.html

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                naoto Naoto Sato
                Reporter:
                dfuchs Daniel Fuchs
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: