More on DateFormatString
Anthony Green
green@redhat.com
Mon Sep 17 19:16:00 GMT 2001
I think my browser is telling Tomcat to use Locale("en", "") now.
Without my recent controversial LocaleInformation patch, the
DataFormatString constructor throws a MissingResourceException when it
tries to access the "zoneStrings".
Here's a test program...
import java.text.DateFormatSymbols;
import java.util.Locale;
public class dfs
{
public static void main (String args[])
{
try {
DateFormatSymbols d = new DateFormatSymbols (new Locale ("en", ""));
String s[][] = d.getZoneStrings ();
int i = 0;
while (i < s.length)
{
System.out.println (s[i][0]);
i = i + 1;
}
} catch (Exception e) {
System.err.println (e);
}
}
}
So without my patch, the program throws an exception.
With my patch, it prints out...
AST
CNT
CST
CTT
ECT
EST
GMT
HST
IET
JST
MST
PNT
PRT
PST
The JRE 1.3, on the other hand, produces...
Africa/Cairo
Africa/Casablanca
Africa/Tripoli
America/Anchorage
America/Chicago
America/Denver
America/Halifax
America/Indianapolis
America/Los_Angeles
America/Manaus
America/Montreal
America/New_York
America/Phoenix
America/St_Johns
Asia/Jerusalem
Asia/Seoul
Asia/Shanghai
Asia/Tehran
Asia/Tokyo
AST
Australia/Adelaide
Australia/Brisbane
Australia/Broken_Hill
Australia/Darwin
Australia/Hobart
Australia/Sydney
CNT
CST
CTT
ECT
EET
EST
Europe/Berlin
Europe/Bucharest
Europe/Helsinki
Europe/Istanbul
Europe/Lisbon
Europe/London
Europe/Moscow
Europe/Paris
GMT
HST
IET
IST
JST
MST
Pacific/Honolulu
PNT
PST
WET
So this suggests that my patch is probably correct, no?
AG
More information about the Java
mailing list