summaryrefslogtreecommitdiff
path: root/java/util
diff options
context:
space:
mode:
Diffstat (limited to 'java/util')
-rw-r--r--java/util/Calendar.java32
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)