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

@@ -74,11 +74,9 @@ public class Pair<A, B> {
if (obj == this) {
return true;
}
if (obj instanceof Pair) {
return Objects.equals(m_first, ((Pair) obj).getFirst())
&& Objects.equals(m_second, ((Pair) obj).getSecond());
}
return false;
return obj instanceof Pair<?, ?> other
&& Objects.equals(m_first, other.getFirst())
&& Objects.equals(m_second, other.getSecond());
}
@Override