< prev index next >
src/java.base/share/classes/sun/util/locale/provider/CalendarNameProviderImpl.java
Print this page
rev 54350 : 8205432: Replace the placeholder Japanese era name
Reviewed-by: rriggs
*** 1,7 ****
/*
! * Copyright (c) 2012, 2018, 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
--- 1,7 ----
/*
! * Copyright (c) 2012, 2019, 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
*** 82,95 ****
} else if (value >= strings.length) {
if (field == ERA && "japanese".equals(calendarType)) {
Era[] jeras = CalendarSystem.forName("japanese").getEras();
if (value <= jeras.length) {
// Localized era name could not be retrieved from this provider.
! // This can occur either for NewEra or SupEra.
//
// If it's CLDR provider, try COMPAT first, which is guaranteed to have
! // the name for NewEra.
if (type == LocaleProviderAdapter.Type.CLDR) {
lr = LocaleProviderAdapter.forJRE().getLocaleResources(locale);
key = getResourceKeyFor(LocaleProviderAdapter.Type.JRE,
calendarType, field, style, javatime);
strings =
--- 82,95 ----
} else if (value >= strings.length) {
if (field == ERA && "japanese".equals(calendarType)) {
Era[] jeras = CalendarSystem.forName("japanese").getEras();
if (value <= jeras.length) {
// Localized era name could not be retrieved from this provider.
! // This can occur either for Reiwa or SupEra.
//
// If it's CLDR provider, try COMPAT first, which is guaranteed to have
! // the name for Reiwa.
if (type == LocaleProviderAdapter.Type.CLDR) {
lr = LocaleProviderAdapter.forJRE().getLocaleResources(locale);
key = getResourceKeyFor(LocaleProviderAdapter.Type.JRE,
calendarType, field, style, javatime);
strings =
< prev index next >