fix:4006修改

This commit is contained in:
wqh 2025-08-21 09:12:51 +08:00
parent 29bcdc91cd
commit 47aca4b2b5
3 changed files with 5 additions and 5 deletions

View File

@ -35,6 +35,7 @@ public class BoolArrayMatcher implements PartMatcher {
}
this.minValue = min;
}
@Override
public boolean match(Integer value) {
if (null == value || value >= bValues.length) {

View File

@ -50,7 +50,6 @@ public class DayOfMonthMatcher extends BoolArrayMatcher {
return value == Month.getLastDay(month - 1, isLeapYear);
}
public boolean isLast() {
return match(31);
}

View File

@ -193,8 +193,8 @@ public class PatternMatcher {
if (i == Part.DAY_OF_MONTH.ordinal()
&& matchers[i] instanceof DayOfMonthMatcher
&& ((DayOfMonthMatcher) matchers[i]).isLastDay(values[i],values[i+1],isLeapYear(values[Part.YEAR.ordinal()]))) {
int newMonth = values[Part.MONTH.ordinal()];
int newYear = values[Part.YEAR.ordinal()];
int newMonth = newValues[Part.MONTH.ordinal()];
int newYear = newValues[Part.YEAR.ordinal()];
nextValue = getLastDay(newMonth, newYear);
} else {
nextValue = matchers[i].nextAfter(values[i]);
@ -227,8 +227,8 @@ public class PatternMatcher {
} else if (i == Part.DAY_OF_MONTH.ordinal()
&& matchers[i] instanceof DayOfMonthMatcher
&& ((DayOfMonthMatcher) matchers[i]).isLastDay(values[i],values[i+1],isLeapYear(values[Part.YEAR.ordinal()]))) {
int newMonth = values[Part.MONTH.ordinal()];
int newYear = values[Part.YEAR.ordinal()];
int newMonth = newValues[Part.MONTH.ordinal()];
int newYear = newValues[Part.YEAR.ordinal()];
nextValue = getLastDay(newMonth, newYear);
} else {
nextValue = matchers[i].nextAfter(values[i] + 1);