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

@@ -611,7 +611,7 @@ public class AccountServlet extends HttpServlet {
if ((stateDeviceSerialNumber == null && device.serialNumber == null)
|| (stateDeviceSerialNumber != null && stateDeviceSerialNumber.equals(device.serialNumber))) {
List<PairedDevice> pairedDeviceList = state.getPairedDeviceList();
if (pairedDeviceList.size() > 0) {
if (!pairedDeviceList.isEmpty()) {
html.append("<table><tr><th align='left'>Name</th><th align='left'>Value</th></tr>");
for (PairedDevice pairedDevice : pairedDeviceList) {
html.append("<tr><td>");

View File

@@ -212,7 +212,7 @@ public class SmartHomeDevicesDiscovery extends AbstractDiscoveryService {
}
Set<SmartHomeDevice> supportedChildren = SmartHomeDeviceHandler.getSupportedSmartHomeDevices(shg,
deviceList);
if (supportedChildren.size() == 0) {
if (supportedChildren.isEmpty()) {
// No children with an supported interface
continue;
}