mirror of
https://github.com/danieldemus/openhab-core.git
synced 2026-07-29 12:34:22 +02:00
Reduce SAT warnings (#4187)
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
This commit is contained in:
+1
-1
@@ -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();
|
||||
}
|
||||
|
||||
-1
@@ -346,7 +346,6 @@ public final class DiscoveryServiceRegistryImpl implements DiscoveryServiceRegis
|
||||
if (startScan(discoveryServices.iterator().next(), listener)) {
|
||||
atLeastOneDiscoveryServiceHasBeenStarted = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return atLeastOneDiscoveryServiceHasBeenStarted;
|
||||
|
||||
+1
-3
@@ -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
|
||||
|
||||
+4
-2
@@ -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);
|
||||
}
|
||||
|
||||
+4
-2
@@ -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);
|
||||
}
|
||||
|
||||
+6
-1
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user