mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8263668: Update java.time to use instanceof pattern variable
Reviewed-by: lancea, ryadav, naoto, rriggs, dfuchs, scolebourne, chegar
This commit is contained in:
parent
a93d911954
commit
28af31db34
34 changed files with 129 additions and 176 deletions
|
@ -421,12 +421,10 @@ public final class ZoneOffsetTransition
|
|||
if (other == this) {
|
||||
return true;
|
||||
}
|
||||
if (other instanceof ZoneOffsetTransition) {
|
||||
ZoneOffsetTransition d = (ZoneOffsetTransition) other;
|
||||
return epochSecond == d.epochSecond &&
|
||||
offsetBefore.equals(d.offsetBefore) && offsetAfter.equals(d.offsetAfter);
|
||||
}
|
||||
return false;
|
||||
return (other instanceof ZoneOffsetTransition d)
|
||||
&& epochSecond == d.epochSecond
|
||||
&& offsetBefore.equals(d.offsetBefore)
|
||||
&& offsetAfter.equals(d.offsetAfter);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -519,17 +519,16 @@ public final class ZoneOffsetTransitionRule implements Serializable {
|
|||
if (otherRule == this) {
|
||||
return true;
|
||||
}
|
||||
if (otherRule instanceof ZoneOffsetTransitionRule) {
|
||||
ZoneOffsetTransitionRule other = (ZoneOffsetTransitionRule) otherRule;
|
||||
return month == other.month && dom == other.dom && dow == other.dow &&
|
||||
timeDefinition == other.timeDefinition &&
|
||||
time.equals(other.time) &&
|
||||
timeEndOfDay == other.timeEndOfDay &&
|
||||
standardOffset.equals(other.standardOffset) &&
|
||||
offsetBefore.equals(other.offsetBefore) &&
|
||||
offsetAfter.equals(other.offsetAfter);
|
||||
}
|
||||
return false;
|
||||
return (otherRule instanceof ZoneOffsetTransitionRule other)
|
||||
&& month == other.month
|
||||
&& dom == other.dom
|
||||
&& dow == other.dow
|
||||
&& timeDefinition == other.timeDefinition
|
||||
&& timeEndOfDay == other.timeEndOfDay
|
||||
&& time.equals(other.time)
|
||||
&& standardOffset.equals(other.standardOffset)
|
||||
&& offsetBefore.equals(other.offsetBefore)
|
||||
&& offsetAfter.equals(other.offsetAfter);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1027,15 +1027,12 @@ public final class ZoneRules implements Serializable {
|
|||
if (this == otherRules) {
|
||||
return true;
|
||||
}
|
||||
if (otherRules instanceof ZoneRules) {
|
||||
ZoneRules other = (ZoneRules) otherRules;
|
||||
return Arrays.equals(standardTransitions, other.standardTransitions) &&
|
||||
Arrays.equals(standardOffsets, other.standardOffsets) &&
|
||||
Arrays.equals(savingsInstantTransitions, other.savingsInstantTransitions) &&
|
||||
Arrays.equals(wallOffsets, other.wallOffsets) &&
|
||||
Arrays.equals(lastRules, other.lastRules);
|
||||
}
|
||||
return false;
|
||||
return (otherRules instanceof ZoneRules other)
|
||||
&& Arrays.equals(standardTransitions, other.standardTransitions)
|
||||
&& Arrays.equals(standardOffsets, other.standardOffsets)
|
||||
&& Arrays.equals(savingsInstantTransitions, other.savingsInstantTransitions)
|
||||
&& Arrays.equals(wallOffsets, other.wallOffsets)
|
||||
&& Arrays.equals(lastRules, other.lastRules);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue