From 18c943760d8ab3b2144111213d0144f6f14ed268 Mon Sep 17 00:00:00 2001 From: Andrew Gallagher Date: Tue, 3 Oct 2017 06:52:50 -0700 Subject: [PATCH] PatternMatchedCollection: implement `equals`/`hashCode` Test Plan: CI Reviewed By: ttsugriy fbshipit-source-id: dc422dc --- .../coercer/PatternMatchedCollection.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/com/facebook/buck/rules/coercer/PatternMatchedCollection.java b/src/com/facebook/buck/rules/coercer/PatternMatchedCollection.java index 47cbb1ee03c..b85c5ac6c60 100644 --- a/src/com/facebook/buck/rules/coercer/PatternMatchedCollection.java +++ b/src/com/facebook/buck/rules/coercer/PatternMatchedCollection.java @@ -82,6 +82,25 @@ public PatternMatchedCollection map(Function func) { .toImmutableList()); } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof PatternMatchedCollection)) { + return false; + } + + PatternMatchedCollection that = (PatternMatchedCollection) o; + + return values.equals(that.values); + } + + @Override + public int hashCode() { + return values.hashCode(); + } + public static Builder builder() { return new Builder<>(); }