From b4c07e4926201f3c9548618c8ec229d961dcd46e Mon Sep 17 00:00:00 2001 From: Manu Sridharan Date: Wed, 18 Oct 2023 16:04:25 -0700 Subject: [PATCH] Minor cleanup in AccessPathElement --- .../com/uber/nullaway/dataflow/AccessPathElement.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/nullaway/src/main/java/com/uber/nullaway/dataflow/AccessPathElement.java b/nullaway/src/main/java/com/uber/nullaway/dataflow/AccessPathElement.java index 0d804668e5..1111d79e57 100644 --- a/nullaway/src/main/java/com/uber/nullaway/dataflow/AccessPathElement.java +++ b/nullaway/src/main/java/com/uber/nullaway/dataflow/AccessPathElement.java @@ -3,6 +3,7 @@ import com.google.common.collect.ImmutableList; import java.util.Arrays; import java.util.List; +import java.util.Objects; import javax.annotation.Nullable; import javax.lang.model.element.Element; @@ -31,18 +32,12 @@ public Element getJavaElement() { return this.javaElement; } - public @Nullable ImmutableList getConstantArguments() { - return this.constantArguments; - } - @Override public boolean equals(Object obj) { if (obj instanceof AccessPathElement) { AccessPathElement otherNode = (AccessPathElement) obj; return this.javaElement.equals(otherNode.javaElement) - && (constantArguments == null - ? otherNode.constantArguments == null - : constantArguments.equals(otherNode.constantArguments)); + && Objects.equals(constantArguments, otherNode.constantArguments); } else { return false; }