[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-core-libs-dev
Subject:    Re: jdk9 vs. jdk8 : TimeZone getDisplayName(Locale.GERMAN) for TZ=MET
From:       Naoto Sato <naoto.sato () oracle ! com>
Date:       2017-05-31 21:53:54
Message-ID: cc877170-a649-cd2f-ef97-0c783bfc3d61 () oracle ! com
[Download RAW message or body]

Hi Matthias, Dalibor,

Yes, the result you are seeing is due to the default locale provider 
change to CLDR. CLDR does not provide localized display names for those 
abbreviated three letter time zones. In such a case, English name from 
the COMPAT provider (i.e., the same locale data from JDK8. The resource 
bundle file you are seeing below belongs to this provider) is 
supplemented. To see the same behavior with JDK8, you can set the 
"java.locale.providers" system property to "COMPAT" so that it will use 
the COMPAT locale provider as the default.

HTH,
Naoto

On 5/31/17 8:18 AM, dalibor topic wrote:
> On 31.05.2017 17:11, Baesken, Matthias wrote:
>>
>> I wonder why the display names for timezone MET changed ( I observed 
>> this on Linux and Solaris) when I compare
>> jdk8 to jdk9 .
>>
>> The test is very small, it just outputs for Locale.GERMAN  the display 
>> name.
>> With jdk8 we get a translated german timezone name, but not with jdk9  
>> (this is a bit strange because  the jdk9 rsource file
>> src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_de.java 
>>
>> still contains the translation).
>>
>> Is this intentional  or a bug ?
> 
> Hi Matthias,
> 
> it might be a side effect of http://openjdk.java.net/jeps/252 .
> 
> cheers,
> dalibor topic
> 
>> Best regards, Matthias
>>
>>
>>
>> TimeZoneTest.java
>> ------------------------
>> import java.util.TimeZone;
>> import java.util.Locale;
>>
>> public class TimeZoneTest {
>>
>>     public static void main(String[] args)
>>     {
>>         TimeZone tz = TimeZone.getDefault();
>>         // now test for german
>>         String dng = tz.getDisplayName(Locale.GERMAN);
>>         System.out.println("timezone display name for Locale.GERMAN " 
>> + dng);
>>     }
>> }
>> ------------------------
>>
>> for environment variable TZ=MET  (export TZ=MET) we get :
>> ../output-jdk8/images/j2sdk-image/bin/java  TimeZoneTest
>> timezone display name for Locale.GERMAN Zentraleuropäische Zeit
>>
>> ../output-jdk9/images/jdk/bin/java  TimeZoneTest
>> timezone display name for Locale.GERMAN Middle Europe Time
>>
> 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic