diff -r 588d5bf7a560 -r 9d46ae9d4a2e rt/emul/compact/src/main/java/java/util/TimeZone.java
--- a/rt/emul/compact/src/main/java/java/util/TimeZone.java Thu Oct 03 15:40:35 2013 +0200
+++ b/rt/emul/compact/src/main/java/java/util/TimeZone.java Tue May 10 04:52:05 2016 +0200
@@ -43,10 +43,6 @@
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.concurrent.ConcurrentHashMap;
-import sun.security.action.GetPropertyAction;
-import sun.util.TimeZoneNameUtility;
-import sun.util.calendar.ZoneInfo;
-import sun.util.calendar.ZoneInfoFile;
/**
* TimeZone
represents a time zone offset, and also figures out daylight
@@ -411,7 +407,7 @@
if (daylight) {
offset += getDSTSavings();
}
- return ZoneInfoFile.toCustomID(offset);
+ // return ZoneInfoFile.toCustomID(offset);
}
int index = daylight ? 3 : 1;
@@ -440,7 +436,7 @@
if (names != null) {
return names;
}
- names = TimeZoneNameUtility.retrieveDisplayNames(id, locale);
+ names = null; // TimeZoneNameUtility.retrieveDisplayNames(id, locale);
if (names != null) {
perLocale.put(locale, names);
}
@@ -448,7 +444,7 @@
}
}
- String[] names = TimeZoneNameUtility.retrieveDisplayNames(id, locale);
+ String[] names = null; // TimeZoneNameUtility.retrieveDisplayNames(id, locale);
if (names != null) {
Map perLocale = new ConcurrentHashMap();
perLocale.put(locale, names);
@@ -556,14 +552,15 @@
}
private static TimeZone getTimeZone(String ID, boolean fallback) {
- TimeZone tz = ZoneInfo.getTimeZone(ID);
- if (tz == null) {
- tz = parseCustomTimeZone(ID);
- if (tz == null && fallback) {
- tz = new ZoneInfo(GMT_ID, 0);
- }
- }
- return tz;
+// TimeZone tz = ZoneInfo.getTimeZone(ID);
+// if (tz == null) {
+// tz = parseCustomTimeZone(ID);
+// if (tz == null && fallback) {
+// tz = new ZoneInfo(GMT_ID, 0);
+// }
+// }
+// return tz;
+ return TimeZone.NO_TIMEZONE;
}
/**
@@ -576,7 +573,7 @@
* @see #getRawOffset()
*/
public static synchronized String[] getAvailableIDs(int rawOffset) {
- return ZoneInfo.getAvailableIDs(rawOffset);
+ return new String[0];//ZoneInfo.getAvailableIDs(rawOffset);
}
/**
@@ -584,7 +581,7 @@
* @return an array of IDs.
*/
public static synchronized String[] getAvailableIDs() {
- return ZoneInfo.getAvailableIDs();
+ return new String[0];//return ZoneInfo.getAvailableIDs();
}
/**
@@ -615,12 +612,12 @@
* method doesn't create a clone.
*/
static TimeZone getDefaultRef() {
- TimeZone defaultZone = defaultZoneTL.get();
+ TimeZone defaultZone = null;//defaultZoneTL.get();
if (defaultZone == null) {
defaultZone = defaultTimeZone;
if (defaultZone == null) {
// Need to initialize the default time zone.
- defaultZone = setDefaultZone();
+ defaultZone = TimeZone.NO_TIMEZONE;
assert defaultZone != null;
}
}
@@ -628,68 +625,8 @@
return defaultZone;
}
- private static synchronized TimeZone setDefaultZone() {
- TimeZone tz = null;
- // get the time zone ID from the system properties
- String zoneID = AccessController.doPrivileged(
- new GetPropertyAction("user.timezone"));
-
- // if the time zone ID is not set (yet), perform the
- // platform to Java time zone ID mapping.
- if (zoneID == null || zoneID.equals("")) {
- String country = AccessController.doPrivileged(
- new GetPropertyAction("user.country"));
- String javaHome = AccessController.doPrivileged(
- new GetPropertyAction("java.home"));
- try {
- zoneID = getSystemTimeZoneID(javaHome, country);
- if (zoneID == null) {
- zoneID = GMT_ID;
- }
- } catch (NullPointerException e) {
- zoneID = GMT_ID;
- }
- }
-
- // Get the time zone for zoneID. But not fall back to
- // "GMT" here.
- tz = getTimeZone(zoneID, false);
-
- if (tz == null) {
- // If the given zone ID is unknown in Java, try to
- // get the GMT-offset-based time zone ID,
- // a.k.a. custom time zone ID (e.g., "GMT-08:00").
- String gmtOffsetID = getSystemGMTOffsetID();
- if (gmtOffsetID != null) {
- zoneID = gmtOffsetID;
- }
- tz = getTimeZone(zoneID, true);
- }
- assert tz != null;
-
- final String id = zoneID;
- AccessController.doPrivileged(new PrivilegedAction