public DateTimeZone getZone ( String id ) { if ( id == null ) { return null ; } Object obj = iZoneInfoMap . get ( id ) ; if ( obj == null ) { return null ; } if ( id . equals ( obj ) ) { // Load zone data for the first time. return loadZoneData ( id ) ; } if ( obj instanceof SoftReference < ? > ) { @ SuppressWarnings ( "unchecked" ) SoftReference < DateTimeZone > ref = ( SoftReference < DateTimeZone > ) obj ; DateTimeZone tz = ref . get ( ) ; if ( tz != null ) { return tz ; } // Reference cleared; load data again. return loadZoneData ( id ) ; } // If this point is reached, mapping must link to another. return getZone ( ( String ) obj ) ; }
If an error is thrown while loading zone data the exception is logged to system error and null is returned for this and all future requests .