- 
    Type:
Bug
 - 
    Resolution: Fixed
 - 
    Priority:
  P3                     
     - 
    Affects Version/s: 11.0.9, 17, 18
 - 
    Component/s: core-libs
 
- 
        b01
 - 
        b27
 - 
        generic
 - 
        generic
 - 
        Verified
 
| Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build | 
|---|---|---|---|---|---|---|
| JDK-8278684 | 19 | Naoto Sato | P3 | Resolved | Fixed | team | 
| JDK-8304340 | 17.0.8-oracle | Ryan Wallace | P3 | Resolved | Fixed | b01 | 
| JDK-8305373 | 17.0.8 | Goetz Lindenmaier | P3 | Resolved | Fixed | b01 | 
| JDK-8304343 | 11.0.20-oracle | Ryan Wallace | P3 | Resolved | Fixed | b01 | 
| JDK-8305372 | 11.0.20 | Goetz Lindenmaier | P3 | Resolved | Fixed | b01 | 
$ uname -a
Linux gonzo 5.10.0-8-amd64 #1 SMP Debian 5.10.46-4 (2021-08-03) x86_64 GNU/Linux
$ java -version
openjdk version "17" 2021-09-14
OpenJDK Runtime Environment (build 17+35-Debian-1)
OpenJDK 64-Bit Server VM (build 17+35-Debian-1, mixed mode, sharing)
A DESCRIPTION OF THE PROBLEM :
Name of timezone UTC in locale 'zh-MO' according to JDK is 協調世界時間. However, if an unrelated code (requesting the name in a different, though related, locale) is executed first, name changes to 世界標準時間.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile and run the short attached program like this:
$ javac test.java && java test && java test broken
Observe that the name in the same locale changes between two runs.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
zh-MO: 協調世界時間
zh-Hant-HK: 世界標準時間
zh-MO: 協調世界時間
ACTUAL -
zh-MO: 協調世界時間
zh-Hant-HK: 世界標準時間
zh-MO: 世界標準時間
---------- BEGIN SOURCE ----------
import java.time.*;
import java.time.format.*;
import java.util.*;
public class test
{
public static void main (String[] args) throws Exception
{
if (args.length == 1 && args[0].equals ("broken"))
System.out.println (utcNameIn ("zh-Hant-HK"));
System.out.println (utcNameIn ("zh-MO"));
System.out.println ();
}
protected static String utcNameIn (String locale)
{
return locale + ": " + DateTimeFormatter.ofPattern ("zzzz", Locale.forLanguageTag (locale)).format (ZonedDateTime.ofInstant (Instant.ofEpochSecond (0), ZoneId.of ("UTC")));
}
}
---------- END SOURCE ----------
FREQUENCY : always
- backported by
 - 
                    
JDK-8278684 Name of UTC timezone in a locale changes depending on previous code
-         
     - Resolved
 
 -         
 - 
                    
JDK-8304340 Name of UTC timezone in a locale changes depending on previous code
-         
     - Resolved
 
 -         
 - 
                    
JDK-8304343 Name of UTC timezone in a locale changes depending on previous code
-         
     - Resolved
 
 -         
 - 
                    
JDK-8305372 Name of UTC timezone in a locale changes depending on previous code
-         
     - Resolved
 
 -         
 - 
                    
JDK-8305373 Name of UTC timezone in a locale changes depending on previous code
-         
     - Resolved
 
 -         
 
- duplicates
 - 
                    
JDK-8294889 JDK11 throws the RuntimeException, but JDK8 executes normally
-         
     - Closed
 
 -         
 - 
                    
JDK-8300752 JDK11 throws the RuntimeException, but JDK8 executes normally
-         
     - Closed
 
 -         
 
- relates to
 - 
                    
JDK-8278434 timeouts in test java/time/test/java/time/format/TestZoneTextPrinterParser.java
-         
     - Closed
 
 -         
 
- links to
 - 
                    
        
        Commit
        openjdk/jdk11u-dev/00b7647f
    
 - 
                    
        
        Commit
        openjdk/jdk17u-dev/590256dd
    
 - 
                    
        
        Commit
        openjdk/jdk/543d1a8c
    
 - 
                    
        
        Review
        openjdk/jdk11u-dev/1818
    
 - 
                    
        
        Review
        openjdk/jdk17u-dev/1217
    
 - 
                    
        
        Review
        openjdk/jdk/6709