Reduce SAT warnings (#4187)

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
This commit is contained in:
Holger Friedrich
2024-04-20 19:17:47 +02:00
committed by GitHub
parent 0db45fa168
commit a79a9c651b
6 changed files with 16 additions and 10 deletions
@@ -87,7 +87,7 @@ public class PipedAudioStream extends AudioStream {
if (closed.getAndSet(true)) { if (closed.getAndSet(true)) {
return; return;
} }
if (this.onCloseChain.size() > 0) { if (!this.onCloseChain.isEmpty()) {
this.onCloseChain.forEach(Runnable::run); this.onCloseChain.forEach(Runnable::run);
this.onCloseChain.clear(); this.onCloseChain.clear();
} }
@@ -346,7 +346,6 @@ public final class DiscoveryServiceRegistryImpl implements DiscoveryServiceRegis
if (startScan(discoveryServices.iterator().next(), listener)) { if (startScan(discoveryServices.iterator().next(), listener)) {
atLeastOneDiscoveryServiceHasBeenStarted = true; atLeastOneDiscoveryServiceHasBeenStarted = true;
} }
} }
return atLeastOneDiscoveryServiceHasBeenStarted; return atLeastOneDiscoveryServiceHasBeenStarted;
@@ -169,9 +169,7 @@ public class AddonResource implements RESTResource, EventSubscriber {
} }
private boolean lastModifiedIsValid() { private boolean lastModifiedIsValid() {
if (lastModified == null) return (lastModified != null) && ((new Date().getTime() - lastModified.getTime()) <= 450 * 1000);
return false;
return (new Date().getTime() - lastModified.getTime()) <= 450 * 1000;
} }
@GET @GET
@@ -48,10 +48,12 @@ public class FirstTypeDTO implements YamlElement {
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) if (this == o) {
return true; return true;
if (o == null || getClass() != o.getClass()) }
if (o == null || getClass() != o.getClass()) {
return false; return false;
}
FirstTypeDTO that = (FirstTypeDTO) o; FirstTypeDTO that = (FirstTypeDTO) o;
return Objects.equals(uid, that.uid) && Objects.equals(description, that.description); return Objects.equals(uid, that.uid) && Objects.equals(description, that.description);
} }
@@ -48,10 +48,12 @@ public class SecondTypeDTO implements YamlElement {
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) if (this == o) {
return true; return true;
if (o == null || getClass() != o.getClass()) }
if (o == null || getClass() != o.getClass()) {
return false; return false;
}
SecondTypeDTO that = (SecondTypeDTO) o; SecondTypeDTO that = (SecondTypeDTO) o;
return Objects.equals(id, that.id) && Objects.equals(label, that.label); return Objects.equals(id, that.id) && Objects.equals(label, that.label);
} }
@@ -12,7 +12,12 @@
*/ */
package org.openhab.core.thing.link; package org.openhab.core.thing.link;
import java.util.*; import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;