Skip to content

Commit

Permalink
Minor cleanup in AccessPathElement (#851)
Browse files Browse the repository at this point in the history
Remove an unused method and add a use of Objects.equals()
  • Loading branch information
msridhar authored Oct 20, 2023
1 parent f17c91c commit bc94dcc
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -31,18 +32,12 @@ public Element getJavaElement() {
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;
}
Expand Down

0 comments on commit bc94dcc

Please sign in to comment.