mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-02 02:51:42 +00:00
[build] Upgrade to PMD 7.2.0 (#6718)
This commit is contained in:
@@ -299,11 +299,9 @@ public interface Measure<U extends Unit<U>> extends Comparable<Measure<U>> {
|
||||
* @return true if this measure is equivalent, false otherwise
|
||||
*/
|
||||
default boolean isEquivalent(Measure<?> other) {
|
||||
if (!this.unit().getBaseUnit().equals(other.unit().getBaseUnit())) {
|
||||
return false; // Disjoint units, not compatible
|
||||
}
|
||||
|
||||
return Math.abs(baseUnitMagnitude() - other.baseUnitMagnitude()) <= EQUIVALENCE_THRESHOLD;
|
||||
// Check for disjoint units that aren't compatible
|
||||
return this.unit().getBaseUnit().equals(other.unit().getBaseUnit())
|
||||
&& Math.abs(baseUnitMagnitude() - other.baseUnitMagnitude()) <= EQUIVALENCE_THRESHOLD;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
|
||||
Reference in New Issue
Block a user