summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew John Hughes <gnu_andrew@member.fsf.org>2008-07-07 22:10:42 +0000
committerAndrew John Hughes <gnu_andrew@member.fsf.org>2008-07-07 22:10:42 +0000
commit4fc2d39cc1d861176fd8207116613bd3764fbe0d (patch)
treea3541bbcbedab2ac01632126c065b03f7be44514
parent1e0961eb9dda05a8c2b2b84f5970fb7672411069 (diff)
downloadclasspath-4fc2d39cc1d861176fd8207116613bd3764fbe0d.tar.gz
Add missing standard zone names.
2008-07-07 Andrew John Hughes <gnu_andrew@member.fsf.org> * java/text/DateFormatSymbols.java: (getZoneStrings(ResourceBundle,Locale)): Handle missing standard zone names.
-rw-r--r--ChangeLog6
-rw-r--r--java/text/DateFormatSymbols.java27
2 files changed, 32 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index cc61e3062..eb6f0f960 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,12 @@
* java/text/DateFormatSymbols.java:
(getZoneStrings(ResourceBundle,Locale)):
+ Handle missing standard zone names.
+
+2008-07-07 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * java/text/DateFormatSymbols.java:
+ (getZoneStrings(ResourceBundle,Locale)):
Fallback on to parent locales.
2008-07-07 Andrew John Hughes <gnu_andrew@member.fsf.org>
diff --git a/java/text/DateFormatSymbols.java b/java/text/DateFormatSymbols.java
index cdd95ff2f..ed953dd07 100644
--- a/java/text/DateFormatSymbols.java
+++ b/java/text/DateFormatSymbols.java
@@ -174,7 +174,32 @@ public class DateFormatSymbols implements java.io.Serializable, Cloneable
LocaleHelper.getFallbackLocale(res.getLocale()),
ClassLoader.getSystemClassLoader());
}
- allZones.addAll(systemZones.values());
+ /* Final sanity check for missing values */
+ for (String[] zstrings : systemZones.values())
+ {
+ if (zstrings[1].equals("") && zstrings[2].equals(""))
+ {
+ for (Map.Entry<Object,Object> entry : properties.entrySet())
+ {
+ String val = (String) entry.getValue();
+ if (val.equals(zstrings[0]))
+ {
+ String key = (String) entry.getKey();
+ String metazone = key.substring(0, key.indexOf("."));
+ String type = properties.getProperty(metazone + "." + locale.getCountry());
+ if (type == null)
+ type = properties.getProperty(metazone + ".DEFAULT");
+ if (type != null)
+ {
+ String[] ostrings = systemZones.get(type);
+ zstrings[1] = ostrings[1];
+ zstrings[2] = ostrings[2];
+ }
+ }
+ }
+ }
+ }
+ allZones.addAll(systemZones.values());
}
catch (MissingResourceException e)
{