Project: fitnotifications File: ZoneMeta.java View source code 6 votes vote down vote up
/**
* Returns an immutable set of system time zone IDs.
* Etc/Unknown is excluded.
* @return An immutable set of system time zone IDs.
*/
private static synchronized Set<String> getSystemZIDs() {
Set<String> systemZones = null;
if (REF_SYSTEM_ZONES != null) {
systemZones = REF_SYSTEM_ZONES.get();
}
if (systemZones == null) {
Set<String> systemIDs = new TreeSet<String>();
String[] allIDs = getZoneIDs();
for (String id : allIDs) {
// exclude Etc/Unknown
if (id.equals(TimeZone.UNKNOWN_ZONE_ID)) {
continue;
}
systemIDs.add(id);
}
systemZones = Collections.unmodifiableSet(systemIDs);
REF_SYSTEM_ZONES = new SoftReference<Set<String>>(systemZones);
}
return systemZones;
}
SoftReference
最新推荐文章于 2024-06-15 19:39:46 发布