Use isEmpty() where possible
See gh-20370
This commit is contained in:
committed by
Stephane Nicoll
parent
4598680692
commit
9588188800
@@ -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(" ");
|
||||
}
|
||||
|
||||
@@ -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<...>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user