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:
Gold856
2024-06-05 00:09:10 -04:00
committed by GitHub
parent d6b66bfa55
commit b99d9c1710
95 changed files with 957 additions and 1594 deletions

View File

@@ -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