Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce SAT warnings #4187

Merged
merged 1 commit into from
Apr 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public void close() throws IOException {
if (closed.getAndSet(true)) {
return;
}
if (this.onCloseChain.size() > 0) {
if (!this.onCloseChain.isEmpty()) {
this.onCloseChain.forEach(Runnable::run);
this.onCloseChain.clear();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,6 @@ private boolean startScans(Set<DiscoveryService> discoveryServices, @Nullable Sc
if (startScan(discoveryServices.iterator().next(), listener)) {
atLeastOneDiscoveryServiceHasBeenStarted = true;
}

}

return atLeastOneDiscoveryServiceHasBeenStarted;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,7 @@ public void receive(Event event) {
}

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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,12 @@ public boolean isValid() {

@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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,12 @@ public boolean isValid() {

@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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down