8263668: Update java.time to use instanceof pattern variable

Reviewed-by: lancea, ryadav, naoto, rriggs, dfuchs, scolebourne, chegar
This commit is contained in:
Patrick Concannon 2021-04-22 10:17:43 +00:00
parent a93d911954
commit 28af31db34
34 changed files with 129 additions and 176 deletions

View file

@ -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);
}
/**