< prev index next >

src/java.base/share/classes/java/util/JapaneseImperialCalendar.java

Print this page
rev 54350 : 8205432: Replace the placeholder Japanese era name
Reviewed-by: rriggs

*** 48,58 **** * 0 N/A N/A * 1 Meiji 1868-01-01T00:00:00 local time * 2 Taisho 1912-07-30T00:00:00 local time * 3 Showa 1926-12-25T00:00:00 local time * 4 Heisei 1989-01-08T00:00:00 local time ! * 5 NewEra 2019-05-01T00:00:00 local time * ------------------------------------------------------ * }</pre> * * <p>{@code ERA} value 0 specifies the years before Meiji and * the Gregorian year values are used. Unlike --- 48,58 ---- * 0 N/A N/A * 1 Meiji 1868-01-01T00:00:00 local time * 2 Taisho 1912-07-30T00:00:00 local time * 3 Showa 1926-12-25T00:00:00 local time * 4 Heisei 1989-01-08T00:00:00 local time ! * 5 Reiwa 2019-05-01T00:00:00 local time * ------------------------------------------------------ * }</pre> * * <p>{@code ERA} value 0 specifies the years before Meiji and * the Gregorian year values are used. Unlike
*** 127,139 **** * The ERA constant designating the Heisei era. */ public static final int HEISEI = 4; /** ! * The ERA constant designating the NewEra era. */ ! private static final int NEWERA = 5; private static final int EPOCH_OFFSET = 719163; // Fixed date of January 1, 1970 (Gregorian) // Useful millisecond constants. Although ONE_DAY and ONE_WEEK can fit // into ints, they must be longs in order to prevent arithmetic overflow --- 127,139 ---- * The ERA constant designating the Heisei era. */ public static final int HEISEI = 4; /** ! * The ERA constant designating the Reiwa era. */ ! private static final int REIWA = 5; private static final int EPOCH_OFFSET = 719163; // Fixed date of January 1, 1970 (Gregorian) // Useful millisecond constants. Although ONE_DAY and ONE_WEEK can fit // into ints, they must be longs in order to prevent arithmetic overflow
*** 1759,1774 **** if (d.isLeapYear()) { --prevJan1; } } else if (transitionYear) { if (jdate.getYear() == 1) { ! // As of NewEra (since Meiji) there's no case // that there are multiple transitions in a // year. Historically there was such // case. There might be such case again in the // future. ! if (era > NEWERA) { CalendarDate pd = eras[era - 1].getSinceDate(); if (normalizedYear == pd.getYear()) { d.setMonth(pd.getMonth()).setDayOfMonth(pd.getDayOfMonth()); } } else { --- 1759,1774 ---- if (d.isLeapYear()) { --prevJan1; } } else if (transitionYear) { if (jdate.getYear() == 1) { ! // As of Reiwa (since Meiji) there's no case // that there are multiple transitions in a // year. Historically there was such // case. There might be such case again in the // future. ! if (era > REIWA) { CalendarDate pd = eras[era - 1].getSinceDate(); if (normalizedYear == pd.getYear()) { d.setMonth(pd.getMonth()).setDayOfMonth(pd.getDayOfMonth()); } } else {
< prev index next >