-
Bug
-
Resolution: Not an Issue
-
P4
-
None
-
11, 17, 19, 20
-
generic
-
generic
A DESCRIPTION OF THE PROBLEM :
According to https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/time/ZoneId.html#systemDefault(), it should be true, that "If the system default time-zone is changed, then the result of this method will also change."
This buggy (?) behavior was probably introduced with the following optimization:
https://bugs.openjdk.org/browse/JDK-8074002
I think that either implementation or javadoc should be fixed.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Run jshell, invoke ZoneId.systemDefault():
jshell> java.time.ZoneId.systemDefault()
=> Initial/Timezone
Do not close jshell!
2. In parallel, change system time zone:
$ sudo timedatectl set-timezone Other/Timezone
3. Go back to jshell, invoke ZoneId.systemDefault() again:
jshell> java.time.ZoneId.systemDefault()
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
=> Other/Timezone
ACTUAL -
=> Initial/Timezone
According to https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/time/ZoneId.html#systemDefault(), it should be true, that "If the system default time-zone is changed, then the result of this method will also change."
This buggy (?) behavior was probably introduced with the following optimization:
https://bugs.openjdk.org/browse/JDK-8074002
I think that either implementation or javadoc should be fixed.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Run jshell, invoke ZoneId.systemDefault():
jshell> java.time.ZoneId.systemDefault()
=> Initial/Timezone
Do not close jshell!
2. In parallel, change system time zone:
$ sudo timedatectl set-timezone Other/Timezone
3. Go back to jshell, invoke ZoneId.systemDefault() again:
jshell> java.time.ZoneId.systemDefault()
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
=> Other/Timezone
ACTUAL -
=> Initial/Timezone
- relates to
-
JDK-8074002 java.time.ZoneId.systemDefault() should be faster
-
- Resolved
-