Use Collection.isEmpty (#10525)

Fixes 47 SAT UseCollectionIsEmpty findings.

Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
Wouter Born
2021-04-15 21:00:47 +02:00
committed by GitHub
parent 7a22d65406
commit 1633c705a1
35 changed files with 67 additions and 68 deletions

View File

@@ -949,7 +949,7 @@ public class ShellyBaseHandler extends BaseThingHandler implements ShellyDeviceL
public boolean updateWakeupReason(@Nullable List<Object> valueArray) {
boolean changed = false;
if ((valueArray != null) && (valueArray.size() > 0)) {
if (valueArray != null && !valueArray.isEmpty()) {
String reason = getString((String) valueArray.get(0));
String newVal = valueArray.toString();
changed = updateChannel(CHANNEL_GROUP_DEV_STATUS, CHANNEL_DEVST_WAKEUP, getStringType(reason));

View File

@@ -492,7 +492,7 @@ public class ShellyLightHandler extends ShellyBaseHandler {
logger.debug("{}: Setting effect to {}", thingName, newCol.effect);
parms.put(SHELLY_COLOR_EFFECT, newCol.effect.toString());
}
if (parms.size() > 0) {
if (!parms.isEmpty()) {
logger.debug("{}: Send light settings: {}", thingName, parms);
api.setLightParms(lightId, parms);
updateCurrentColors(lightId, newCol);