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

@@ -289,11 +289,10 @@ public class Unit<U extends Unit<U>> {
if (this == o) {
return true;
}
if (!(o instanceof Unit)) {
return false;
}
Unit<?> that = (Unit<?>) o;
return m_name.equals(that.m_name) && m_symbol.equals(that.m_symbol) && this.equivalent(that);
return o instanceof Unit<?> that
&& m_name.equals(that.m_name)
&& m_symbol.equals(that.m_symbol)
&& this.equivalent(that);
}
@Override