Reduce SAT warnings (#4187)

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
pull/4192/head
Holger Friedrich 2024-04-20 19:17:47 +02:00 committed by GitHub
parent 0db45fa168
commit a79a9c651b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 16 additions and 10 deletions

View File

@ -87,7 +87,7 @@ public class PipedAudioStream extends AudioStream {
if (closed.getAndSet(true)) {
return;
}
if (this.onCloseChain.size() > 0) {
if (!this.onCloseChain.isEmpty()) {
this.onCloseChain.forEach(Runnable::run);
this.onCloseChain.clear();
}

View File

@ -346,7 +346,6 @@ public final class DiscoveryServiceRegistryImpl implements DiscoveryServiceRegis
if (startScan(discoveryServices.iterator().next(), listener)) {
atLeastOneDiscoveryServiceHasBeenStarted = true;
}
}
return atLeastOneDiscoveryServiceHasBeenStarted;

View File

@ -169,9 +169,7 @@ public class AddonResource implements RESTResource, EventSubscriber {
}
private boolean lastModifiedIsValid() {
if (lastModified == null)
return false;
return (new Date().getTime() - lastModified.getTime()) <= 450 * 1000;
return (lastModified != null) && ((new Date().getTime() - lastModified.getTime()) <= 450 * 1000);
}
@GET

View File

@ -48,10 +48,12 @@ public class FirstTypeDTO implements YamlElement {
@Override
public boolean equals(Object o) {
if (this == o)
if (this == o) {
return true;
if (o == null || getClass() != o.getClass())
}
if (o == null || getClass() != o.getClass()) {
return false;
}
FirstTypeDTO that = (FirstTypeDTO) o;
return Objects.equals(uid, that.uid) && Objects.equals(description, that.description);
}

View File

@ -48,10 +48,12 @@ public class SecondTypeDTO implements YamlElement {
@Override
public boolean equals(Object o) {
if (this == o)
if (this == o) {
return true;
if (o == null || getClass() != o.getClass())
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SecondTypeDTO that = (SecondTypeDTO) o;
return Objects.equals(id, that.id) && Objects.equals(label, that.label);
}

View File

@ -12,7 +12,12 @@
*/
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.Stream;