java.time.ZoneId.systemDefalut() overhead

Peter Levart peter.levart at gmail.com
Tue Feb 24 07:18:07 UTC 2015


On 02/24/2015 05:35 AM, Masayoshi Okutsu wrote:
> On 2/23/2015 5:21 AM, Peter Levart wrote:
>> I think that it was never meant to change TimeZone's ID 
>> (TimeZone.setID()) after such instance was put into operation (for 
>> example installed as default time zone with TimeZone.setDefault()). 
>> Such use is unintended and buggy. So I also changed the 
>> implementation of TimeZone.setDefault() to save a defensive copy of 
>> TimeZone object as default time zone instead of a reference to it.
>
> In TimeZone.setDefault() null needs to be checked if you want to 
> create a defensive copy. (The method allows for null.)
>
> Masayoshi
>

Thanks for pointing that out.

Regards, Peter



More information about the core-libs-dev mailing list