Skip to content
This repository was archived by the owner on Jan 19, 2022. It is now read-only.

Commit 12ddfc8

Browse files
authored
Remove usage of StringUtils.isEmpty (#740)
`StringUtils.isEmpty` has been deprecated in spring-framework 5.3.
1 parent 7015d74 commit 12ddfc8

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

spring-cloud-aws-autoconfigure/src/main/java/org/springframework/cloud/aws/autoconfigure/jdbc/AmazonRdsDatabaseProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public static class RdsInstance {
8282
private boolean readReplicaSupport = false;
8383

8484
public boolean hasRequiredPropertiesSet() {
85-
return !StringUtils.isEmpty(this.getDbInstanceIdentifier()) && !StringUtils.isEmpty(this.getPassword());
85+
return StringUtils.hasLength(this.getDbInstanceIdentifier()) && StringUtils.hasLength(this.getPassword());
8686
}
8787

8888
public String getDbInstanceIdentifier() {

spring-cloud-aws-context/src/main/java/org/springframework/cloud/aws/context/config/xml/StackConfigurationBeanDefinitionParser.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,10 @@ protected void doParse(Element element, ParserContext parserContext, BeanDefinit
107107
String stackName = element.getAttribute(STACK_NAME_ATTRIBUTE_NAME);
108108

109109
builder.addConstructorArgReference(amazonCloudFormationClientBeanName);
110-
AbstractBeanDefinition stackNameProviderBeanDefinition = StringUtils.isEmpty(stackName)
111-
? buildAutoDetectingStackNameProviderBeanDefinition(amazonCloudFormationClientBeanName,
112-
amazonEc2ClientBeanName)
113-
: buildStaticStackNameProviderBeanDefinition(stackName);
110+
AbstractBeanDefinition stackNameProviderBeanDefinition = StringUtils.hasLength(stackName)
111+
? buildStaticStackNameProviderBeanDefinition(stackName)
112+
: buildAutoDetectingStackNameProviderBeanDefinition(amazonCloudFormationClientBeanName,
113+
amazonEc2ClientBeanName);
114114
builder.addConstructorArgValue(stackNameProviderBeanDefinition);
115115

116116
buildAndRegisterStackUserTagsIfNeeded(element, parserContext, amazonCloudFormationClientBeanName,

spring-cloud-aws-core/src/main/java/org/springframework/cloud/aws/core/env/stack/config/StackResourceRegistryFactoryBean.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ private Map<String, StackResource> convertToStackResourceMappings(String prefix,
115115
}
116116

117117
private String toNestedResourceId(String prefix, String logicalResourceId) {
118-
return StringUtils.isEmpty(prefix) ? logicalResourceId : prefix + "." + logicalResourceId;
118+
return StringUtils.hasLength(prefix) ? prefix + "." + logicalResourceId : logicalResourceId;
119119
}
120120

121121
/**

spring-cloud-aws-core/src/main/java/org/springframework/cloud/aws/core/io/s3/SimpleStorageNameUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ static String getVersionIdFromLocation(String location) {
102102

103103
static String getContentTypeFromLocation(String location) {
104104
String objectName = getObjectNameFromLocation(location);
105-
if (!StringUtils.isEmpty(objectName)) {
105+
if (StringUtils.hasLength(objectName)) {
106106
return URLConnection.guessContentTypeFromName(objectName);
107107
}
108108
return null;

spring-cloud-aws-parameter-store-config/src/main/java/org/springframework/cloud/aws/paramstore/AwsParamStoreProperties.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,15 @@ public boolean supports(Class clazz) {
9292
public void validate(Object target, Errors errors) {
9393
AwsParamStoreProperties properties = (AwsParamStoreProperties) target;
9494

95-
if (StringUtils.isEmpty(properties.getPrefix())) {
95+
if (!StringUtils.hasLength(properties.getPrefix())) {
9696
errors.rejectValue("prefix", "NotEmpty", "prefix should not be empty or null.");
9797
}
9898

99-
if (StringUtils.isEmpty(properties.getDefaultContext())) {
99+
if (!StringUtils.hasLength(properties.getDefaultContext())) {
100100
errors.rejectValue("defaultContext", "NotEmpty", "defaultContext should not be empty or null.");
101101
}
102102

103-
if (StringUtils.isEmpty(properties.getProfileSeparator())) {
103+
if (!StringUtils.hasLength(properties.getProfileSeparator())) {
104104
errors.rejectValue("profileSeparator", "NotEmpty", "profileSeparator should not be empty or null.");
105105
}
106106

spring-cloud-aws-secrets-manager-config/src/main/java/org/springframework/cloud/aws/secretsmanager/AwsSecretsManagerProperties.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,15 @@ public boolean supports(Class<?> clazz) {
9292
public void validate(Object target, Errors errors) {
9393
AwsSecretsManagerProperties properties = (AwsSecretsManagerProperties) target;
9494

95-
if (StringUtils.isEmpty(properties.getPrefix())) {
95+
if (!StringUtils.hasLength(properties.getPrefix())) {
9696
errors.rejectValue("prefix", "NotEmpty", "prefix should not be empty or null.");
9797
}
9898

99-
if (StringUtils.isEmpty(properties.getDefaultContext())) {
99+
if (!StringUtils.hasLength(properties.getDefaultContext())) {
100100
errors.rejectValue("defaultContext", "NotEmpty", "defaultContext should not be empty or null.");
101101
}
102102

103-
if (StringUtils.isEmpty(properties.getProfileSeparator())) {
103+
if (!StringUtils.hasLength(properties.getProfileSeparator())) {
104104
errors.rejectValue("profileSeparator", "NotEmpty", "profileSeparator should not be empty or null.");
105105
}
106106

0 commit comments

Comments
 (0)