summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew John Hughes <gnu_andrew@member.fsf.org>2008-07-07 02:38:58 +0000
committerAndrew John Hughes <gnu_andrew@member.fsf.org>2008-07-07 02:38:58 +0000
commitcb4ec06cf0cccfa5b6ff8a5a9bf8a5560baa17b3 (patch)
tree94f66ab112383905514889e900c0e0dcf3878a6d
parent1e833e8e38a1765a91fb0d98c71729e44a12d2d3 (diff)
downloadclasspath-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.
-rw-r--r--ChangeLog10
-rw-r--r--java/util/Calendar.java32
-rw-r--r--resource/java/util/iso4217.properties2
-rw-r--r--resource/java/util/weeks.properties80
4 files changed, 120 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 1f39aae3e..9ae4b7791 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
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.
+
+2008-07-07 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
* resource/gnu/java/locale/LocaleInformation.properties,
* resource/gnu/java/locale/LocaleInformation_aa.properties,
* resource/gnu/java/locale/LocaleInformation_af.properties,
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)
diff --git a/resource/java/util/iso4217.properties b/resource/java/util/iso4217.properties
index 1998bcb51..bc1c7582d 100644
--- a/resource/java/util/iso4217.properties
+++ b/resource/java/util/iso4217.properties
@@ -1,4 +1,4 @@
-# This document is automatically generated by gnu.currencygen
+# This document is automatically generated by gnu.supplementgen
AD.currency=EUR,ESP,FRF,ADP
AD.fractionDigits=0
diff --git a/resource/java/util/weeks.properties b/resource/java/util/weeks.properties
new file mode 100644
index 000000000..a2547f497
--- /dev/null
+++ b/resource/java/util/weeks.properties
@@ -0,0 +1,80 @@
+# This document is automatically generated by gnu.supplementgen
+
+firstDay.AF=sat
+firstDay.AS=sun
+firstDay.AZ=sun
+firstDay.BH=sat
+firstDay.BW=sun
+firstDay.CA=sun
+firstDay.CN=sun
+firstDay.DEFAULT=mon
+firstDay.DJ=sat
+firstDay.DZ=sat
+firstDay.EG=sat
+firstDay.ER=sat
+firstDay.ET=sat
+firstDay.FO=sun
+firstDay.GE=sun
+firstDay.GL=sun
+firstDay.GU=sun
+firstDay.HK=sun
+firstDay.IE=sun
+firstDay.IL=sun
+firstDay.IQ=sat
+firstDay.IR=sat
+firstDay.IS=sun
+firstDay.JM=sun
+firstDay.JO=sat
+firstDay.JP=sun
+firstDay.KE=sat
+firstDay.KG=sun
+firstDay.KR=sun
+firstDay.KW=sat
+firstDay.LA=sun
+firstDay.LY=sat
+firstDay.MA=sat
+firstDay.MH=sun
+firstDay.MN=sun
+firstDay.MO=sun
+firstDay.MP=sun
+firstDay.MT=sun
+firstDay.MV=fri
+firstDay.NZ=sun
+firstDay.OM=sat
+firstDay.PH=sun
+firstDay.PK=sun
+firstDay.QA=sat
+firstDay.SA=sat
+firstDay.SD=sat
+firstDay.SG=sun
+firstDay.SO=sat
+firstDay.SY=sun
+firstDay.TH=sun
+firstDay.TN=sat
+firstDay.TT=sun
+firstDay.TW=sun
+firstDay.UM=sun
+firstDay.US=sun
+firstDay.UZ=sun
+firstDay.VI=sun
+firstDay.YE=sat
+firstDay.ZW=sun
+minDays.AT=4
+minDays.BE=4
+minDays.CA=4
+minDays.CH=4
+minDays.DE=4
+minDays.DEFAULT=1
+minDays.DK=4
+minDays.FI=4
+minDays.FR=4
+minDays.IT=4
+minDays.LI=4
+minDays.LT=4
+minDays.LU=4
+minDays.MC=4
+minDays.MT=4
+minDays.NL=4
+minDays.NO=4
+minDays.SE=4
+minDays.SK=4