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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user