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

Initial value of user.timezone system property change

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P3 P3
    • 12
    • core-libs
    • None
    • behavioral
    • low
    • Hide
      The user.timezone system property is not specified to have any particular initial value and there is no expectation of a non-null value for the system property. With this change System.getProperty("user.timezone") may return null and code expecting a non-null will see a NullPointerException. The risk is minimal since the expectation is that without overriding the user.timezone the implementation will use the OS timezone when it is initialized on first use and that has been the implementation since 2007.
      Show
      The user.timezone system property is not specified to have any particular initial value and there is no expectation of a non-null value for the system property. With this change System.getProperty("user.timezone") may return null and code expecting a non-null will see a NullPointerException. The risk is minimal since the expectation is that without overriding the user.timezone the implementation will use the OS timezone when it is initialized on first use and that has been the implementation since 2007.
    • System or security property
    • SE

      Summary

      The initial value of the system property user.timezone is changed from the empty string to undefined.

      Problem

      The initial value used for the default timezone is unnecessarily split between native code and the java.util.TimeZone implementation.
      The split has a very small maintenance cost and very small performance impact.

      Solution

      Removing the initialization of user.timezone to the empty string enables some code cleanup and avoids the overhead of processing the property value when it is the default value.

      This change does not change the ability to set user.timezone property on the command line using -Duser.timezone=xxx.

      Specification

      This is a behavior change only, there is no specification of the initial value of the user.timezone property.

      The user.timezone system property will be undefined unless set using a command line argument -Duser.timezone=xxx.

            rriggs Roger Riggs
            alanb Alan Bateman
            Mandy Chung (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: