java.time.ZoneId.systemDefalut() overhead

Masayoshi Okutsu masayoshi.okutsu at oracle.com
Tue Feb 24 04:35:00 UTC 2015


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




More information about the core-libs-dev mailing list