mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8265746: Update java.time to use instanceof pattern variable (part II)
Reviewed-by: dfuchs, lancea, rriggs, chegar, naoto
This commit is contained in:
parent
a85f6cbbaa
commit
45c5da0fd3
20 changed files with 104 additions and 152 deletions
|
@ -618,11 +618,9 @@ public abstract class Clock {
|
|||
}
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof FixedClock) {
|
||||
FixedClock other = (FixedClock) obj;
|
||||
return instant.equals(other.instant) && zone.equals(other.zone);
|
||||
}
|
||||
return false;
|
||||
return obj instanceof FixedClock other
|
||||
&& instant.equals(other.instant)
|
||||
&& zone.equals(other.zone);
|
||||
}
|
||||
@Override
|
||||
public int hashCode() {
|
||||
|
@ -670,11 +668,9 @@ public abstract class Clock {
|
|||
}
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof OffsetClock) {
|
||||
OffsetClock other = (OffsetClock) obj;
|
||||
return baseClock.equals(other.baseClock) && offset.equals(other.offset);
|
||||
}
|
||||
return false;
|
||||
return obj instanceof OffsetClock other
|
||||
&& baseClock.equals(other.baseClock)
|
||||
&& offset.equals(other.offset);
|
||||
}
|
||||
@Override
|
||||
public int hashCode() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue