< prev index next >
src/java.base/share/classes/sun/util/locale/provider/CalendarDataProviderImpl.java
Print this page
rev 47734 : imported patch 8190918
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
@@ -44,18 +44,20 @@
this.langtags = langtags;
}
@Override
public int getFirstDayOfWeek(Locale locale) {
- return LocaleProviderAdapter.forType(type).getLocaleResources(locale)
+ String fw = LocaleProviderAdapter.forType(type).getLocaleResources(locale)
.getCalendarData(CalendarDataUtility.FIRST_DAY_OF_WEEK);
+ return fw.isEmpty() ? 0 : Integer.parseInt(fw);
}
@Override
public int getMinimalDaysInFirstWeek(Locale locale) {
- return LocaleProviderAdapter.forType(type).getLocaleResources(locale)
+ String md = LocaleProviderAdapter.forType(type).getLocaleResources(locale)
.getCalendarData(CalendarDataUtility.MINIMAL_DAYS_IN_FIRST_WEEK);
+ return md.isEmpty() ? 0 : Integer.parseInt(md);
}
@Override
public Locale[] getAvailableLocales() {
return LocaleProviderAdapter.toLocaleArray(langtags);
< prev index next >