aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManu Sridharan <msridhar@gmail.com>2023-10-20 14:29:52 -0700
committerGitHub <noreply@github.com>2023-10-20 21:29:52 +0000
commitbc94dcc8a9c90a35cbb1387d1e1ae3e1f7d4c9d7 (patch)
treef18c2483009920b736a8d81fc230fe2870edf6e1
parentf17c91c21faf6f22e527ed214a731d4b8492d4d4 (diff)
downloadnullaway-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.java9
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;
}