Rework more commons-lang usages (#10314)
* Reworks many commons-lang usages to use standard Java * Updates all remaining commons.lang imports to commons.lang3 Related to openhab/openhab-addons#7722 Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
@@ -17,7 +17,6 @@ import java.util.Collections;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.openhab.binding.orvibo.internal.OrviboBindingConstants;
|
||||
import org.openhab.core.config.discovery.AbstractDiscoveryService;
|
||||
import org.openhab.core.config.discovery.DiscoveryResult;
|
||||
@@ -102,7 +101,7 @@ public class SocketDiscoveryService extends AbstractDiscoveryService implements
|
||||
private DiscoveryResult createDiscoveryResult(Socket socket) {
|
||||
ThingUID thingUID = getUID(socket);
|
||||
String label = socket.getLabel();
|
||||
if (StringUtils.isBlank(label)) {
|
||||
if (label == null || label.isBlank()) {
|
||||
label = "S20";
|
||||
}
|
||||
return DiscoveryResultBuilder.create(thingUID).withLabel(label)
|
||||
|
||||
@@ -18,7 +18,6 @@ import java.net.SocketException;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.openhab.core.library.types.OnOffType;
|
||||
import org.openhab.core.thing.ChannelUID;
|
||||
import org.openhab.core.thing.Thing;
|
||||
@@ -98,7 +97,7 @@ public class S20Handler extends BaseThingHandler implements SocketStateListener
|
||||
|
||||
@Override
|
||||
public void socketDidChangeLabel(Socket socket, String label) {
|
||||
if (!StringUtils.isBlank(label)) {
|
||||
if (label != null && !label.isBlank()) {
|
||||
logger.debug("Updating thing label to {}", label);
|
||||
thing.setLabel(label);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user