diff options
author | Ingo Proetel <proetel@aicas.com> | 2003-09-18 06:34:00 +0000 |
---|---|---|
committer | Michael Koch <mkoch@gcc.gnu.org> | 2003-09-18 06:34:00 +0000 |
commit | 1ea8e73b809603d2c182b20899ca7824bd0d0209 (patch) | |
tree | 61bd85f20d1ef3c7e21d095638be5c58a494ab1a /libjava/java/util/Calendar.java | |
parent | fc08ad2815be2faea9c12ae978c39bc3e811af15 (diff) | |
download | gcc-1ea8e73b809603d2c182b20899ca7824bd0d0209.zip gcc-1ea8e73b809603d2c182b20899ca7824bd0d0209.tar.gz gcc-1ea8e73b809603d2c182b20899ca7824bd0d0209.tar.bz2 |
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
Diffstat (limited to 'libjava/java/util/Calendar.java')
-rw-r--r-- | libjava/java/util/Calendar.java | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/libjava/java/util/Calendar.java b/libjava/java/util/Calendar.java index 9a4e21f..271d1d1 100644 --- a/libjava/java/util/Calendar.java +++ b/libjava/java/util/Calendar.java @@ -361,11 +361,21 @@ public abstract class Calendar implements Serializable, Cloneable static final long serialVersionUID = -1807547505821590642L; /** - * 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. + */ + private static ResourceBundle getBundle(Locale locale) + { + return ResourceBundle.getBundle(bundleName, locale); + } + + /** * Constructs a new Calendar with the default time zone and the default * locale. */ @@ -385,7 +395,7 @@ public abstract class Calendar implements Serializable, Cloneable this.zone = zone; lenient = true; - ResourceBundle rb = ResourceBundle.getBundle(bundleName, locale); + ResourceBundle rb = getBundle(locale); firstDayOfWeek = ((Integer) rb.getObject("firstDayOfWeek")).intValue(); minimalDaysInFirstWeek = @@ -430,7 +440,7 @@ public abstract class Calendar implements Serializable, Cloneable public static synchronized Calendar getInstance(TimeZone zone, Locale locale) { String calendarClassName = null; - ResourceBundle rb = ResourceBundle.getBundle(bundleName, locale); + ResourceBundle rb = getBundle(locale); calendarClassName = rb.getString("calendarClass"); if (calendarClassName != null) { @@ -461,8 +471,7 @@ public abstract class Calendar implements Serializable, Cloneable */ public static synchronized Locale[] getAvailableLocales() { - ResourceBundle rb = ResourceBundle.getBundle(bundleName, - new Locale("", "")); + ResourceBundle rb = getBundle(new Locale("", "")); return (Locale[]) rb.getObject("availableLocales"); } |