Use CollectionUtils.isEmpty() and StringUtils.hasLength()
See gh-40645
This commit is contained in:
committed by
Moritz Halbritter
parent
a67c8e4bbd
commit
0e450d602d
@@ -37,6 +37,7 @@ import org.springframework.boot.loader.tools.LaunchScript;
|
||||
import org.springframework.boot.loader.tools.LayoutFactory;
|
||||
import org.springframework.boot.loader.tools.Libraries;
|
||||
import org.springframework.boot.loader.tools.Repackager;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* Repackage existing JAR and WAR archives so that they can be executed from the command
|
||||
@@ -258,7 +259,7 @@ public class RepackageMojo extends AbstractPackagerMojo {
|
||||
private void putIfMissing(Properties properties, String key, String... valueCandidates) {
|
||||
if (!properties.containsKey(key)) {
|
||||
for (String candidate : valueCandidates) {
|
||||
if (candidate != null && !candidate.isEmpty()) {
|
||||
if (StringUtils.hasLength(candidate)) {
|
||||
properties.put(key, candidate);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user