Adapt to deprecation of StringUtils.isEmpty(Object)

See gh-23774
This commit is contained in:
Andy Wilkinson
2020-10-22 17:09:33 +01:00
parent 3bfe1b00b5
commit 2d8528d5bd
10 changed files with 21 additions and 20 deletions

View File

@@ -296,11 +296,11 @@ public final class ConditionMessage {
* @return a built {@link ConditionMessage}
*/
public ConditionMessage because(String reason) {
if (StringUtils.isEmpty(reason)) {
return new ConditionMessage(ConditionMessage.this, this.condition);
if (StringUtils.hasLength(reason)) {
return new ConditionMessage(ConditionMessage.this,
StringUtils.hasLength(this.condition) ? this.condition + " " + reason : reason);
}
return new ConditionMessage(ConditionMessage.this,
StringUtils.isEmpty(this.condition) ? reason : this.condition + " " + reason);
return new ConditionMessage(ConditionMessage.this, this.condition);
}
}

View File

@@ -140,7 +140,7 @@ public class EntityScanPackages {
}
if (packagesToScan.isEmpty()) {
String packageName = ClassUtils.getPackageName(metadata.getClassName());
Assert.state(!StringUtils.isEmpty(packageName), "@EntityScan cannot be used with the default package");
Assert.state(StringUtils.hasLength(packageName), "@EntityScan cannot be used with the default package");
return Collections.singleton(packageName);
}
return packagesToScan;