Use Collection.isEmpty (#10525)
Fixes 47 SAT UseCollectionIsEmpty findings. Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
@@ -243,7 +243,7 @@ public class VigiCruesHandler extends BaseThingHandler {
|
||||
}
|
||||
|
||||
private void updateRelativeMeasure(String channelId, List<QuantityType<?>> reference, double value) {
|
||||
if (reference.size() > 0) {
|
||||
if (!reference.isEmpty()) {
|
||||
double percent = value / reference.get(0).doubleValue() * 100;
|
||||
updateQuantity(channelId, percent, Units.PERCENT);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user