Fix or suppress SAT CompareObjectsWithEquals findings (#10631)

* Fix or suppress SAT CompareObjectsWithEquals findings

Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
Wouter Born
2021-05-05 21:06:04 +02:00
committed by GitHub
parent 582ef280e5
commit f5f922eaf4
14 changed files with 34 additions and 43 deletions

View File

@@ -13,6 +13,7 @@
package org.openhab.binding.russound.internal.rio;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
@@ -94,13 +95,8 @@ public class StatefulHandlerCallback implements RioHandlerCallback {
final State oldState = state.get(channelId);
// If both null OR the same value (enums), nothing changed
if (oldState == newState) {
return;
}
// If they are equal - nothing changed
if (oldState != null && oldState.equals(newState)) {
if (Objects.equals(oldState, newState)) {
return;
}