diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/ConfigStore.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/ConfigStore.java index c59cf07c04832..15af0ea76b1ab 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/ConfigStore.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/ConfigStore.java @@ -15,7 +15,7 @@ import java.net.InetAddress; import java.net.UnknownHostException; import java.util.Collections; -import java.util.HashSet; +import java.util.LinkedHashSet; import java.util.Map; import java.util.Set; import java.util.UUID; @@ -197,7 +197,7 @@ public void modified(Map properties) { discoveryIps = Collections.unmodifiableSet(Stream.of(config.discoveryIps.split(",")).map(String::trim) .map(this::byName).filter(e -> e != null).collect(Collectors.toSet())); } else { - discoveryIps = new HashSet<>(); + discoveryIps = new LinkedHashSet<>(); configuredAddress = byName(networkAddressService.getPrimaryIpv4HostAddress()); if (configuredAddress != null) { discoveryIps.add(configuredAddress); @@ -211,7 +211,7 @@ public void modified(Map properties) { } } - if (discoveryIps.size() < 1) { + if (discoveryIps.isEmpty()) { try { logger.info("No discovery ip specified. Trying to determine the host address"); configuredAddress = InetAddress.getLocalHost(); @@ -318,7 +318,7 @@ public String mapItemUIDtoHueID(Item item) { } public boolean isReady() { - return discoveryIps.size() > 0; + return !discoveryIps.isEmpty(); } public HueEmulationConfig getConfig() {