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

@@ -80,6 +80,7 @@ public abstract class AbstractWeatherHandler extends BaseThingHandler {
}
@Override
@SuppressWarnings("PMD.CompareObjectsWithEquals")
public void handleCommand(ChannelUID channelUID, Command command) {
if (RefreshType.REFRESH == command) {
ScheduledFuture<?> prevFuture = updateChannelsFutureRef.get();
@@ -94,6 +95,7 @@ public abstract class AbstractWeatherHandler extends BaseThingHandler {
logger.trace("REFRESH received. Delaying by {} ms to avoid throttle excessive REFRESH",
delayRemainingMillis);
}
// Compare by reference to check if the future changed
if (prevFuture == newFuture) {
logger.trace("REFRESH received. Previous refresh ongoing, will wait for it to complete in {} ms",
lastRefreshMillis + REFRESH_THROTTLE_MILLIS - System.currentTimeMillis());