[lifx] Fix all code analysis findings (#13638)

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
This commit is contained in:
lolodomo 2022-11-01 15:31:37 +01:00 committed by GitHub
parent 7728bbc232
commit aea2fd4002
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 4 additions and 21 deletions

View File

@ -73,10 +73,7 @@ public class HevCycleState {
} else if (!duration.equals(other.duration)) { } else if (!duration.equals(other.duration)) {
return false; return false;
} }
if (enable != other.enable) { return enable == other.enable;
return false;
}
return true;
} }
@Override @Override

View File

@ -389,9 +389,6 @@ public abstract class Packet {
} }
public boolean isFulfilled(Packet somePacket) { public boolean isFulfilled(Packet somePacket) {
if (isExpectedResponse(somePacket.getPacketType())) { return isExpectedResponse(somePacket.getPacketType());
return true;
}
return false;
} }
} }

View File

@ -126,10 +126,7 @@ public class HSBK {
if (brightness != other.brightness) { if (brightness != other.brightness) {
return false; return false;
} }
if (kelvin != other.kelvin) { return kelvin == other.kelvin;
return false;
}
return true;
} }
@Override @Override

View File

@ -101,10 +101,6 @@ public class MACAddress {
} }
final MACAddress other = (MACAddress) obj; final MACAddress other = (MACAddress) obj;
if (!this.hex.equalsIgnoreCase(other.hex)) { return this.hex.equalsIgnoreCase(other.hex);
return false;
}
return true;
} }
} }

View File

@ -23,8 +23,6 @@ import java.util.concurrent.locks.ReentrantLock;
import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable; import org.eclipse.jdt.annotation.Nullable;
import org.openhab.binding.lifx.internal.fields.MACAddress; import org.openhab.binding.lifx.internal.fields.MACAddress;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
* The {@link LifxThrottlingUtil} is a utility class that regulates the frequency at which messages/packets are * The {@link LifxThrottlingUtil} is a utility class that regulates the frequency at which messages/packets are
@ -37,8 +35,6 @@ import org.slf4j.LoggerFactory;
@NonNullByDefault @NonNullByDefault
public final class LifxThrottlingUtil { public final class LifxThrottlingUtil {
private static final Logger LOGGER = LoggerFactory.getLogger(LifxThrottlingUtil.class);
private LifxThrottlingUtil() { private LifxThrottlingUtil() {
// hidden utility class constructor // hidden utility class constructor
} }