Use .isEmpty() where feasible
See gh-38739
This commit is contained in:
committed by
Phillip Webb
parent
d3af5cce73
commit
ac18e3015c
@@ -227,7 +227,7 @@ public abstract class AbstractAotMojo extends AbstractDependencyFilterMojo {
|
||||
}
|
||||
|
||||
boolean hasReportedErrors() {
|
||||
return this.message.length() > 0;
|
||||
return !this.message.isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -329,7 +329,7 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo {
|
||||
try {
|
||||
StringBuilder classpath = new StringBuilder();
|
||||
for (URL ele : getClassPathUrls()) {
|
||||
if (classpath.length() > 0) {
|
||||
if (!classpath.isEmpty()) {
|
||||
classpath.append(File.pathSeparator);
|
||||
}
|
||||
classpath.append(new File(ele.toURI()));
|
||||
|
||||
@@ -98,7 +98,7 @@ final class CommandLineBuilder {
|
||||
static String build(List<URL> classpathElements) {
|
||||
StringBuilder classpath = new StringBuilder();
|
||||
for (URL element : classpathElements) {
|
||||
if (classpath.length() > 0) {
|
||||
if (!classpath.isEmpty()) {
|
||||
classpath.append(File.pathSeparator);
|
||||
}
|
||||
classpath.append(toFile(element));
|
||||
|
||||
Reference in New Issue
Block a user