TimeZone.java: Initialize lazily.

2003-09-18  Ingo Proetel  <proetel@aicas.com>

	* java/util/TimeZone.java: Initialize lazily.
	* java/util/Locale.java (readManifest): Fix check for country.
	* java/util/GregorianCalendar.java: Make use of ResourceBundle better
	traceable
	* java/util/Calendar.java: Make use of ResourceBundle better
	traceable.

From-SVN: r71509
This commit is contained in:
Ingo Proetel
2003-09-18 06:34:00 +00:00
committed by Michael Koch
parent fc08ad2815
commit 1ea8e73b80
5 changed files with 736 additions and 694 deletions
+12 -2
View File
@@ -78,10 +78,20 @@ public class GregorianCalendar extends Calendar
static final long serialVersionUID = -8125100834729963327L;
/**
* The name of the resource bundle.
* The name of the resource bundle. Used only by getBundle()
*/
private static final String bundleName = "gnu.java.locale.Calendar";
/**
* get resource bundle:
* The resources should be loaded via this method only. Iff an application
* uses this method, the resourcebundle is required. --Fridi.
*/
private static ResourceBundle getBundle(Locale locale)
{
return ResourceBundle.getBundle(bundleName, locale);
}
/**
* Constructs a new GregorianCalender representing the current
* time, using the default time zone and the default locale.
@@ -120,7 +130,7 @@ public class GregorianCalendar extends Calendar
public GregorianCalendar(TimeZone zone, Locale locale)
{
super(zone, locale);
ResourceBundle rb = ResourceBundle.getBundle(bundleName, locale);
ResourceBundle rb = getBundle(locale);
gregorianCutover = ((Date) rb.getObject("gregorianCutOver")).getTime();
setTimeInMillis(System.currentTimeMillis());
}