< prev index next >

test/jdk/java/util/Calendar/ZoneOffsets.java

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

*** 1,7 **** /* ! * Copyright (c) 2005, 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. --- 1,7 ---- /* ! * Copyright (c) 2005, 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.
*** 238,252 **** + ", gmtOffset=" + gmtOffset + ", dstOffset=" + dstOffset + ", cal1 time=" + t1 + ", cal2 time=" + cal2.getTime().getTime()); } private static void adjustJapaneseEra(Calendar cal) { ! // In case of Japanese calendar, explicitly set the last era; NEWERA so that // year 2005 won't throw exception if (!cal.isLenient() && cal.getCalendarType().equals("japanese") && ! System.currentTimeMillis() < 1556668800000L) { // Current time not in NEWERA cal.set(Calendar.ERA, 5); cal.add(Calendar.YEAR, -30); // -30: Subtract year-length of HEISEI era } return; } --- 238,252 ---- + ", gmtOffset=" + gmtOffset + ", dstOffset=" + dstOffset + ", cal1 time=" + t1 + ", cal2 time=" + cal2.getTime().getTime()); } private static void adjustJapaneseEra(Calendar cal) { ! // In case of Japanese calendar, explicitly set the last era; REIWA so that // year 2005 won't throw exception if (!cal.isLenient() && cal.getCalendarType().equals("japanese") && ! System.currentTimeMillis() < 1556668800000L) { // Current time not in REIWA cal.set(Calendar.ERA, 5); cal.add(Calendar.YEAR, -30); // -30: Subtract year-length of HEISEI era } return; }
< prev index next >