(commons-compress) branch master updated: Use String#isEmpty()

2023-11-28 Thread ggregory
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-compress.git


The following commit(s) were added to refs/heads/master by this push:
 new d931c529d Use String#isEmpty()
d931c529d is described below

commit d931c529d9bd1a1c63b0cf533d9012e94ff8d13e
Author: Gary Gregory 
AuthorDate: Tue Nov 28 11:11:30 2023 -0500

Use String#isEmpty()
---
 .../java/org/apache/commons/compress/harmony/unpack200/Segment.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/src/main/java/org/apache/commons/compress/harmony/unpack200/Segment.java 
b/src/main/java/org/apache/commons/compress/harmony/unpack200/Segment.java
index 4c4687831..00fbc0294 100644
--- a/src/main/java/org/apache/commons/compress/harmony/unpack200/Segment.java
+++ b/src/main/java/org/apache/commons/compress/harmony/unpack200/Segment.java
@@ -394,7 +394,7 @@ public class Segment {
 for (int i = 0; i < numberOfFiles; i++) {
 String name = fileName[i];
 
-final boolean nameIsEmpty = name == null || name.equals("");
+final boolean nameIsEmpty = name == null || name.isEmpty();
 final boolean isClass = (fileOptions[i] & 2) == 2 || nameIsEmpty;
 if (isClass && nameIsEmpty) {
 name = 
cpBands.getCpClass()[classBands.getClassThisInts()[classNum]] + ".class";



[commons-compress] branch master updated: Use String#isEmpty().

2020-12-31 Thread ggregory
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-compress.git


The following commit(s) were added to refs/heads/master by this push:
 new 505feaf  Use String#isEmpty().
505feaf is described below

commit 505feaff7874c77a62d67fb5bfc311cc16bb45c2
Author: Gary Gregory 
AuthorDate: Thu Dec 31 11:26:12 2020 -0500

Use String#isEmpty().
---
 .../org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java
 
b/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java
index 71451c7..c1b46de 100644
--- 
a/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java
+++ 
b/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java
@@ -219,7 +219,7 @@ public class ArArchiveInputStream extends 
ArchiveInputStream {
 
 private int asInt(final byte[] byteArray, final int offset, final int len, 
final int base, final boolean treatBlankAsZero) {
 final String string = ArchiveUtils.toAsciiString(byteArray, offset, 
len).trim();
-if (string.length() == 0 && treatBlankAsZero) {
+if (string.isEmpty() && treatBlankAsZero) {
 return 0;
 }
 return Integer.parseInt(string, base);