diff options
author | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2008-07-07 02:38:58 +0000 |
---|---|---|
committer | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2008-07-07 02:38:58 +0000 |
commit | cb4ec06cf0cccfa5b6ff8a5a9bf8a5560baa17b3 (patch) | |
tree | 94f66ab112383905514889e900c0e0dcf3878a6d /java/util | |
parent | 1e833e8e38a1765a91fb0d98c71729e44a12d2d3 (diff) | |
download | classpath-cb4ec06cf0cccfa5b6ff8a5a9bf8a5560baa17b3.tar.gz |
Use weeks.properties instead of bundles for week data.
2008-07-07 Andrew John Hughes <gnu_andrew@member.fsf.org>
* java/util/Calendar.java:
(Calendar(TimeZone,Locale)): Use weeks.properties
instead of LocaleInformation bundles.
* resource/java/util/iso4217.properties:
Updated with new supplementgen header.
* resource/java/util/weeks.properties:
New resource file.
Diffstat (limited to 'java/util')
-rw-r--r-- | java/util/Calendar.java | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/java/util/Calendar.java b/java/util/Calendar.java index 4f4314c5c..0449e126d 100644 --- a/java/util/Calendar.java +++ b/java/util/Calendar.java @@ -487,6 +487,28 @@ public abstract class Calendar } /** + * The set of properties for obtaining the minimum number of days in + * the first week. + */ + private static transient final Properties properties; + + /** + * Reads in the properties. + */ + static + { + properties = new Properties(); + try + { + properties.load(Calendar.class.getResourceAsStream("weeks.properties")); + } + catch (IOException exception) + { + System.out.println("Failed to load weeks resource: " + exception); + } + } + + /** * Constructs a new Calendar with the default time zone and the default * locale. */ @@ -507,9 +529,13 @@ public abstract class Calendar lenient = true; String[] days = { "", "sun", "mon", "tue", "wed", "thu", "fri", "sat" }; - ResourceBundle rb = getBundle(locale); - String min = (String) rb.getObject("minNumberOfDaysInFirstWeek"); - String first = (String) rb.getObject("firstDayOfWeek"); + String country = locale.getCountry(); + String min = properties.getProperty("minDays." + country); + if (min == null) + min = properties.getProperty("minDays.DEFAULT"); + String first = properties.getProperty("firstDay." + country); + if (first == null) + first = properties.getProperty("firstDay.DEFAULT"); try { if (min != null) |