diff options
author | Manu Sridharan <msridhar@gmail.com> | 2023-10-20 14:29:52 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-20 21:29:52 +0000 |
commit | bc94dcc8a9c90a35cbb1387d1e1ae3e1f7d4c9d7 (patch) | |
tree | f18c2483009920b736a8d81fc230fe2870edf6e1 | |
parent | f17c91c21faf6f22e527ed214a731d4b8492d4d4 (diff) | |
download | nullaway-bc94dcc8a9c90a35cbb1387d1e1ae3e1f7d4c9d7.tar.gz |
Minor cleanup in AccessPathElement (#851)
Remove an unused method and add a use of Objects.equals()
-rw-r--r-- | nullaway/src/main/java/com/uber/nullaway/dataflow/AccessPathElement.java | 9 |
1 files 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 0d80466..1111d79 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 @@ package com.uber.nullaway.dataflow; 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 final class AccessPathElement { return this.javaElement; } - public @Nullable ImmutableList<String> 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; } |