< prev index next >

src/java.base/share/classes/java/time/chrono/JapaneseEra.java

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

*** 149,166 **** * The singleton instance for the 'Heisei' era (1989-01-08 - 2019-04-30) * which has the value 2. */ public static final JapaneseEra HEISEI = new JapaneseEra(2, LocalDate.of(1989, 1, 8)); /** ! * The singleton instance for the 'NewEra' era (2019-05-01 - current) * which has the value 3. */ ! private static final JapaneseEra NEWERA = new JapaneseEra(3, LocalDate.of(2019, 5, 1)); // The number of predefined JapaneseEra constants. // There may be a supplemental era defined by the property. ! private static final int N_ERA_CONSTANTS = NEWERA.getValue() + ERA_OFFSET; /** * Serialization version. */ private static final long serialVersionUID = 1466499369062886794L; --- 149,166 ---- * The singleton instance for the 'Heisei' era (1989-01-08 - 2019-04-30) * which has the value 2. */ public static final JapaneseEra HEISEI = new JapaneseEra(2, LocalDate.of(1989, 1, 8)); /** ! * The singleton instance for the 'Reiwa' era (2019-05-01 - ) * which has the value 3. */ ! private static final JapaneseEra REIWA = new JapaneseEra(3, LocalDate.of(2019, 5, 1)); // The number of predefined JapaneseEra constants. // There may be a supplemental era defined by the property. ! private static final int N_ERA_CONSTANTS = REIWA.getValue() + ERA_OFFSET; /** * Serialization version. */ private static final long serialVersionUID = 1466499369062886794L;
*** 174,184 **** KNOWN_ERAS = new JapaneseEra[ERA_CONFIG.length]; KNOWN_ERAS[0] = MEIJI; KNOWN_ERAS[1] = TAISHO; KNOWN_ERAS[2] = SHOWA; KNOWN_ERAS[3] = HEISEI; ! KNOWN_ERAS[4] = NEWERA; for (int i = N_ERA_CONSTANTS; i < ERA_CONFIG.length; i++) { CalendarDate date = ERA_CONFIG[i].getSinceDate(); LocalDate isoDate = LocalDate.of(date.getYear(), date.getMonth(), date.getDayOfMonth()); KNOWN_ERAS[i] = new JapaneseEra(i - ERA_OFFSET + 1, isoDate); } --- 174,184 ---- KNOWN_ERAS = new JapaneseEra[ERA_CONFIG.length]; KNOWN_ERAS[0] = MEIJI; KNOWN_ERAS[1] = TAISHO; KNOWN_ERAS[2] = SHOWA; KNOWN_ERAS[3] = HEISEI; ! KNOWN_ERAS[4] = REIWA; for (int i = N_ERA_CONSTANTS; i < ERA_CONFIG.length; i++) { CalendarDate date = ERA_CONFIG[i].getSinceDate(); LocalDate isoDate = LocalDate.of(date.getYear(), date.getMonth(), date.getDayOfMonth()); KNOWN_ERAS[i] = new JapaneseEra(i - ERA_OFFSET + 1, isoDate); }
< prev index next >