Fix/suppress PMD CompareObjectsWithEquals findings (#11476)

Newer PMD versions discover more CompareObjectsWithEquals findings.

Related to https://github.com/openhab/static-code-analysis/pull/423

Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
Wouter Born
2021-11-02 10:43:53 +01:00
committed by GitHub
parent b67b9fcb25
commit 589400e223
82 changed files with 175 additions and 141 deletions

View File

@@ -171,11 +171,11 @@ public class Enums {
* @return the enum value representing the given measure unit
*/
public static MeasureUnit fromUnit(Unit<?> unit) {
if (unit == SIUnits.CELSIUS) {
if (SIUnits.CELSIUS.equals(unit)) {
return CELSIUS;
} else if (unit == ImperialUnits.FAHRENHEIT) {
} else if (ImperialUnits.FAHRENHEIT.equals(unit)) {
return FAHRENHEIT;
} else if (unit == Units.PERCENT) {
} else if (Units.PERCENT.equals(unit)) {
return PERCENTAGE;
} else {
return DIMENSIONLESS;