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 1
1
/*
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.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
@@ -277,6 +277,10 @@ void normalizeMonth(CalendarDate date) {
277
277
long xm = 1L - month ;
278
278
year -= (int )((xm / 12 ) + 1 );
279
279
month = 13 - (xm % 12 );
280
+ if (month == 13 ) {
281
+ year ++;
282
+ month = 1 ;
283
+ }
280
284
bdate .setNormalizedYear (year );
281
285
bdate .setMonth ((int ) month );
282
286
} else if (month > DECEMBER ) {
Original file line number Diff line number Diff line change 24
24
/*
25
25
* @test
26
26
* @summary tests Japanese Calendar.
27
- * @bug 4609228 8187649
27
+ * @bug 4609228 8187649 8273924
28
28
* @modules java.base/sun.util
29
29
* java.base/sun.util.calendar
30
30
* @compile
Original file line number Diff line number Diff line change @@ -354,6 +354,26 @@ test add MONTH
354
354
# check date Heisei $max Aug 16
355
355
# check timeofday 23 59 59 999
356
356
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
+
357
377
test add WEEK_OF_YEAR
358
378
use jcal
359
379
clear all
You can’t perform that action at this time.
0 commit comments