File tree Expand file tree Collapse file tree 3 files changed +26
-2
lines changed
src/java.base/share/classes/sun/util/calendar
test/jdk/java/util/Calendar/CalendarTestScripts Expand file tree Collapse file tree 3 files changed +26
-2
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2003, 2011 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2003, 2021 , Oracle and/or its affiliates. All rights reserved.
33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44 *
55 * This code is free software; you can redistribute it and/or modify it
@@ -277,6 +277,10 @@ void normalizeMonth(CalendarDate date) {
277277 long xm = 1L - month ;
278278 year -= (int )((xm / 12 ) + 1 );
279279 month = 13 - (xm % 12 );
280+ if (month == 13 ) {
281+ year ++;
282+ month = 1 ;
283+ }
280284 bdate .setNormalizedYear (year );
281285 bdate .setMonth ((int ) month );
282286 } else if (month > DECEMBER ) {
Original file line number Diff line number Diff line change 2424/*
2525 * @test
2626 * @summary tests Japanese Calendar.
27- * @bug 4609228 8187649
27+ * @bug 4609228 8187649 8273924
2828 * @modules java.base/sun.util
2929 * java.base/sun.util.calendar
3030 * @compile
Original file line number Diff line number Diff line change @@ -354,6 +354,26 @@ test add MONTH
354354# check date Heisei $max Aug 16
355355# check timeofday 23 59 59 999
356356
357+ # JDK - 8273924
358+ set date Reiwa 2 Mar 1
359+ add month - 10
360+ check date Reiwa 1 May 1
361+ set date Reiwa 2 Mar 1
362+ add month - 11
363+ check date Heisei 31 Apr 1
364+ set date Reiwa 2 Mar 1
365+ add month - 12
366+ check date Heisei 31 Mar 1
367+ set date Reiwa 2 Mar 1
368+ add month - 13
369+ check date Heisei 31 Feb 1
370+ set date Reiwa 2 Mar 1
371+ add month - 14
372+ check date Heisei 31 Jan 1
373+ set date Reiwa 2 Mar 1
374+ add month - 15
375+ check date Heisei 30 Dec 1
376+
357377test add WEEK_OF_YEAR
358378 use jcal
359379 clear all
You can’t perform that action at this time.
0 commit comments