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:
Wouter Born
2021-03-16 12:38:16 +01:00
committed by GitHub
parent 16fba31556
commit f3503430b4
257 changed files with 906 additions and 1125 deletions

View File

@@ -20,7 +20,14 @@ import java.math.RoundingMode;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
@@ -31,7 +38,6 @@ import javax.measure.Unit;
import javax.measure.quantity.Dimensionless;
import javax.measure.quantity.Temperature;
import org.apache.commons.lang.StringUtils;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.jetty.client.HttpClient;
@@ -112,13 +118,13 @@ public class VenstarThermostatHandler extends ConfigStatusThingHandler {
public Collection<ConfigStatusMessage> getConfigStatus() {
Collection<ConfigStatusMessage> status = new ArrayList<>();
VenstarThermostatConfiguration config = getConfigAs(VenstarThermostatConfiguration.class);
if (StringUtils.isBlank(config.username)) {
if (config.username.isBlank()) {
log.warn("username is empty");
status.add(ConfigStatusMessage.Builder.error(CONFIG_USERNAME).withMessageKeySuffix(EMPTY_INVALID)
.withArguments(CONFIG_USERNAME).build());
}
if (StringUtils.isBlank(config.password)) {
if (config.password.isBlank()) {
log.warn("password is empty");
status.add(ConfigStatusMessage.Builder.error(CONFIG_PASSWORD).withMessageKeySuffix(EMPTY_INVALID)
.withArguments(CONFIG_PASSWORD).build());