mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-02 02:51:42 +00:00
Use Java 17 features (#6691)
Uses enhanced instanceof (and simplify equals methods) Uses switch expressions and arrow labels Seal and finalize some Shuffleboard classes Co-authored-by: Sam Carlberg <sam@slfc.dev>
This commit is contained in:
@@ -286,14 +286,9 @@ public final class MutableMeasure<U extends Unit<U>> implements Measure<U> {
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (!(o instanceof Measure)) {
|
||||
return false;
|
||||
}
|
||||
Measure<?> that = (Measure<?>) o;
|
||||
return Objects.equals(m_unit, that.unit()) && this.isEquivalent(that);
|
||||
return o instanceof Measure<?> that
|
||||
&& Objects.equals(m_unit, that.unit())
|
||||
&& this.isEquivalent(that);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user