Replace usage of deprecated StringUtils.isEmpty with !StringUtils.hasLength (#275)
* spring-cloud/spring-cloud-zookeeper#274
This commit is contained in:
@@ -49,7 +49,7 @@ public class ZookeeperConfigBootstrapConfiguration {
|
||||
@ConditionalOnMissingBean
|
||||
public ZookeeperConfigProperties zookeeperConfigProperties(Environment env) {
|
||||
ZookeeperConfigProperties properties = new ZookeeperConfigProperties();
|
||||
if (StringUtils.isEmpty(properties.getName())) {
|
||||
if (!StringUtils.hasLength(properties.getName())) {
|
||||
properties.setName(env.getProperty("spring.application.name", "application"));
|
||||
}
|
||||
return properties;
|
||||
|
||||
@@ -106,7 +106,7 @@ public class ZookeeperConfigDataLocationResolver implements ConfigDataLocationRe
|
||||
}
|
||||
|
||||
protected List<String> getCustomContexts(UriComponents uriComponents) {
|
||||
if (StringUtils.isEmpty(uriComponents.getPath())) {
|
||||
if (!StringUtils.hasLength(uriComponents.getPath())) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ public class ZookeeperConfigDataLocationResolver implements ConfigDataLocationRe
|
||||
.bind(ZookeeperConfigProperties.PREFIX, Bindable.of(ZookeeperConfigProperties.class))
|
||||
.orElse(new ZookeeperConfigProperties());
|
||||
|
||||
if (StringUtils.isEmpty(properties.getName())) {
|
||||
if (!StringUtils.hasLength(properties.getName())) {
|
||||
properties.setName(binder.bind("spring.application.name", String.class).orElse("application"));
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ public class ZookeeperAutoServiceRegistrationTests {
|
||||
* registration.getServiceId(), service.getId());
|
||||
* assertEquals("service name was wrong", "myTestService1-FF-something",
|
||||
* service.getService()); assertFalse("service address must not be empty",
|
||||
* StringUtils.isEmpty(service.getAddress()));
|
||||
* !StringUtils.hasLength(service.getAddress()));
|
||||
* assertEquals("service address must equals hostname from discovery properties",
|
||||
* discoveryProperties.getHostname(), service.getAddress());
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user