Use isEmpty() where possible

See gh-20370
This commit is contained in:
dreis2211
2020-03-02 20:36:46 +01:00
committed by Stephane Nicoll
parent 4598680692
commit 9588188800
7 changed files with 13 additions and 13 deletions

View File

@@ -63,7 +63,7 @@ public class TotalProgressBar implements Consumer<TotalProgressEvent> {
public TotalProgressBar(String prefix, char progressChar, boolean bookend, PrintStream out) {
this.progressChar = progressChar;
this.bookend = bookend;
if (prefix != null && prefix.length() > 0) {
if (prefix != null && !prefix.isEmpty()) {
out.print(prefix);
out.print(" ");
}

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.
@@ -154,7 +154,7 @@ class TypeUtils {
if (((TypeElement) this.types.asElement(type)).getQualifiedName().contentEquals(Collection.class.getName())) {
DeclaredType declaredType = (DeclaredType) type;
// raw type, just "Collection"
if (declaredType.getTypeArguments().size() == 0) {
if (declaredType.getTypeArguments().isEmpty()) {
return this.types.getDeclaredType(this.env.getElementUtils().getTypeElement(Object.class.getName()));
}
// return type argument to Collection<...>

View File

@@ -62,7 +62,7 @@ class Context {
return null;
}
String relativePath = sourcePath.substring(workingPath.length() + 1);
return (relativePath.length() > 0) ? relativePath : null;
return !relativePath.isEmpty() ? relativePath : null;
}
/**