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
commit 189b4f8e0cd979a05e04c818f6b139328980e50b Author: Gary Gregory <[email protected]> AuthorDate: Thu Dec 8 11:06:55 2022 -0500 Use Java Objects class --- .../compress/harmony/unpack200/bytecode/CPFieldRef.java | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPFieldRef.java b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPFieldRef.java index 6d219511..3a807b0c 100644 --- a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPFieldRef.java +++ b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPFieldRef.java @@ -18,6 +18,7 @@ package org.apache.commons.compress.harmony.unpack200.bytecode; import java.io.DataOutputStream; import java.io.IOException; +import java.util.Objects; /** * Field reference constant pool entry. @@ -90,18 +91,10 @@ public class CPFieldRef extends ConstantPoolEntry { return false; } final CPFieldRef other = (CPFieldRef) obj; - if (className == null) { - if (other.className != null) { - return false; - } - } else if (!className.equals(other.className)) { + if (!Objects.equals(className, other.className)) { return false; } - if (nameAndType == null) { - if (other.nameAndType != null) { - return false; - } - } else if (!nameAndType.equals(other.nameAndType)) { + if (!Objects.equals(nameAndType, other.nameAndType)) { return false; } return true;
