Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Equals cleanup #1434

Merged
merged 4 commits into from
May 13, 2019
Merged

Equals cleanup #1434

merged 4 commits into from
May 13, 2019

Conversation

shemnon
Copy link
Contributor

@shemnon shemnon commented May 10, 2019

PR description

  • Don't copy collections if we don't need to. Change types higher up if needed.
  • Don't use Guava's Object.equal, use Java's Objects.equals.

Fixed Issue(s)

* Don't copy collections if we don't need to.  Change types higher up if needed.
* Don't use Guava's Object.equal, use Java's Objects.equals.
@shemnon shemnon requested a review from mbaxter May 10, 2019 21:24
# Conflicts:
#	pantheon/src/main/java/tech/pegasys/pantheon/cli/EthNetworkConfig.java
#	pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java
#	pantheon/src/test/java/tech/pegasys/pantheon/cli/PantheonCommandTest.java
#	util/src/main/java/tech/pegasys/pantheon/util/enode/EnodeURL.java
@shemnon shemnon marked this pull request as ready for review May 13, 2019 15:35
Copy link
Contributor

@mbaxter mbaxter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎉

@@ -68,7 +68,7 @@ public boolean equals(final Object o) {
}
final PreparedCertificate that = (PreparedCertificate) o;
return Objects.equals(proposalPayload, that.proposalPayload)
&& Objects.equals(new ArrayList<>(preparePayloads), new ArrayList<>(that.preparePayloads));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice cleanup 👍

@shemnon shemnon merged commit 162cb23 into PegaSysEng:master May 13, 2019
notlesh pushed a commit to notlesh/pantheon that referenced this pull request May 14, 2019
* Don't copy collections if we don't need to.  Change types higher up if needed.
* Don't use Guava's Object.equal, use Java's Objects.equals.
** add errorprone test to enforce the banning of Guava's Objects class.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants