This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-vfs.git
The following commit(s) were added to refs/heads/master by this push: new 45a2af7 Use isEmpty(). 45a2af7 is described below commit 45a2af722b05e05e2b3e7162572b4ae2032a31c5 Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Sun Jan 17 09:33:37 2021 -0500 Use isEmpty(). --- .../main/java/org/apache/commons/vfs2/provider/GenericFileName.java | 4 ++-- .../src/main/java/org/apache/commons/vfs2/util/CombinedResources.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/GenericFileName.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/GenericFileName.java index f7b4a0c..5d17da5 100644 --- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/GenericFileName.java +++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/GenericFileName.java @@ -128,9 +128,9 @@ public class GenericFileName extends AbstractFileName { * @param addPassword flag if password should be added or replaced with placeholder (false). */ protected void appendCredentials(final StringBuilder buffer, final boolean addPassword) { - if (userName != null && userName.length() != 0) { + if (userName != null && !userName.isEmpty()) { UriParser.appendEncoded(buffer, userName, USERNAME_RESERVED); - if (password != null && password.length() != 0) { + if (password != null && !password.isEmpty()) { buffer.append(':'); if (addPassword) { UriParser.appendEncoded(buffer, password, PASSWORD_RESERVED); diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/CombinedResources.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/CombinedResources.java index 550c4a5..fa54bb6 100644 --- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/CombinedResources.java +++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/CombinedResources.java @@ -62,7 +62,7 @@ public class CombinedResources extends ResourceBundle { for (int j = 0; j < i; j++) { sb.append('_').append(parts[j]); } - if (parts[i].length() != 0) { + if (!parts[i].isEmpty()) { sb.append('_').append(parts[i]); loadResources(sb.toString()); }