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

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -277,10 +277,10 @@ public final class TestPropertyValues {
}
private static Pair of(String name, String value) {
if (StringUtils.isEmpty(name) && StringUtils.isEmpty(value)) {
return null;
if (StringUtils.hasLength(name) || StringUtils.hasLength(value)) {
return new Pair(name, value);
}
return new Pair(name, value);
return null;
}
}
@@ -309,7 +309,7 @@ public final class TestPropertyValues {
private String setOrClear(String name, String value) {
Assert.notNull(name, "Name must not be null");
if (StringUtils.isEmpty(value)) {
if (!StringUtils.hasLength(value)) {
return (String) System.getProperties().remove(name);
}
return (String) System.getProperties().setProperty(name, value);