6560981: (cal) unused local variables in GregorianCalendar, etc.
Reviewed-by: naoto, bchristi, iris
This commit is contained in:
parent
5dd851d872
commit
d4c9a88073
@ -2431,7 +2431,6 @@ public class GregorianCalendar extends Calendar {
|
||||
long fixedDateJan1 = calsys.getFixedDate(normalizedYear, 1, 1, cdate);
|
||||
int dayOfYear = (int)(fixedDate - fixedDateJan1) + 1;
|
||||
long fixedDateMonth1 = fixedDate - dayOfMonth + 1;
|
||||
int cutoverGap = 0;
|
||||
int cutoverYear = (calsys == gcal) ? gregorianCutoverYear : gregorianCutoverYearJulian;
|
||||
int relativeDayOfMonth = dayOfMonth - 1;
|
||||
|
||||
@ -2447,9 +2446,7 @@ public class GregorianCalendar extends Calendar {
|
||||
fixedDateMonth1 = getFixedDateMonth1(cdate, fixedDate);
|
||||
}
|
||||
}
|
||||
int realDayOfYear = (int)(fixedDate - fixedDateJan1) + 1;
|
||||
cutoverGap = dayOfYear - realDayOfYear;
|
||||
dayOfYear = realDayOfYear;
|
||||
dayOfYear = (int)(fixedDate - fixedDateJan1) + 1;
|
||||
relativeDayOfMonth = (int)(fixedDate - fixedDateMonth1);
|
||||
}
|
||||
internalSet(DAY_OF_YEAR, dayOfYear);
|
||||
|
@ -2118,7 +2118,6 @@ class JapaneseImperialCalendar extends Calendar {
|
||||
* @param fixedDate the fixed date representation of the date
|
||||
*/
|
||||
private long getFixedDateJan1(LocalGregorianCalendar.Date date, long fixedDate) {
|
||||
Era era = date.getEra();
|
||||
if (date.getEra() != null && date.getYear() == 1) {
|
||||
for (int eraIndex = getEraIndex(date); eraIndex > 0; eraIndex--) {
|
||||
CalendarDate d = eras[eraIndex].getSinceDate();
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2022, 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
|
||||
@ -494,7 +494,7 @@ public abstract class BaseCalendar extends AbstractCalendar {
|
||||
*/
|
||||
final int getGregorianYearFromFixedDate(long fixedDate) {
|
||||
long d0;
|
||||
int d1, d2, d3, d4;
|
||||
int d1, d2, d3;
|
||||
int n400, n100, n4, n1;
|
||||
int year;
|
||||
|
||||
@ -507,7 +507,6 @@ public abstract class BaseCalendar extends AbstractCalendar {
|
||||
n4 = d2 / 1461;
|
||||
d3 = d2 % 1461;
|
||||
n1 = d3 / 365;
|
||||
d4 = (d3 % 365) + 1;
|
||||
} else {
|
||||
d0 = fixedDate - 1;
|
||||
n400 = (int)CalendarUtils.floorDivide(d0, 146097L);
|
||||
@ -517,7 +516,6 @@ public abstract class BaseCalendar extends AbstractCalendar {
|
||||
n4 = CalendarUtils.floorDivide(d2, 1461);
|
||||
d3 = CalendarUtils.mod(d2, 1461);
|
||||
n1 = CalendarUtils.floorDivide(d3, 365);
|
||||
d4 = CalendarUtils.mod(d3, 365) + 1;
|
||||
}
|
||||
year = 400 * n400 + 100 * n100 + 4 * n4 + n1;
|
||||
if (!(n100 == 4 || n1 == 4)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user