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

Optimize search algorithm for determining default time zone

    XMLWordPrintable

Details

    • b15
    • Not verified

    Backports

      Description

        This seems to be a regression from JDK-6456628

        Effectively, if /etc/localtime is a binary (not a symlink to somewhere in /usr/share/zoneinfo), java.util.TimeZone.getDefault may return any of the
        timezones that match the binary.

        This can be done easily by using the oraclelinux:6 docker image as by default this has /etc/localtime as a binary that matches UTC.

        Code to reproduce:

        import java.util.TimeZone;
        public class TZBug {
            public static void main(String[] args) {
                System.out.println(TimeZone.getDefault().getID());
            }
        }

        Attachments

          Issue Links

            Activity

              People

                coffeys Sean Coffey
                shadowbug Shadow Bug
                Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: