<i18n dev> Code Review for JDK-8141243: Unexpected timezone returned after parsing a date

Masayoshi Okutsu masayoshi.okutsu at oracle.com
Tue Nov 17 08:54:21 UTC 2015


Hi Ramanand,

I don't think this fix is correct. This change mixes up time zone IDs 
and display names. SimpleDateFomat should parse only display names.

There's no perfect solution on the issue because the short display names 
(abbreviations) can't be unique. So, I'd suggest that the UTC display 
names in all resource bundles (all TimeZoneNames*.java under 
sun.util.resources) move up to the compatibility group.

BTW, the symptom is reproducible in JDK 9 with the legacy time zone 
names (run java with -Djava.locale.providers=COMPAT). So, the fix should 
be done in JDK 9 first.

Thanks,
Masayoshi

On 11/16/2015 10:38 PM, Ramanand Patil wrote:
> Hi all,
>
>   
>
> Please review a fix for Bug Id - HYPERLINK "https://bugs.openjdk.java.net/browse/JDK-8141243"JDK-8141243.
>
> <https://bugs.openjdk.java.net/browse/JDK-8141243>
>
>   
>
> Issue - When parsing the virtual timezone "UTC" with java.text.SimpleDateFormat, the timezone is set to the first timezone that matches an actual timezone in the UTC group, which is Antarctica/Troll. When comparing this timezone with the result of TimeZone.getTimeZone("UTC"), we fail.
>
>   
>
> Webrev - http://cr.openjdk.java.net/~aefimov/8141243/webrev.00/
>
>   
>
>   
>
> Regards,
>
> Ramanand.
>
>   



More information about the i18n-dev mailing list