Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

GaryQian
Copy link
Contributor

The equals override requires hashcode override as well. This class is private and the hashcode is (currently) unused.

@auto-assign auto-assign bot requested a review from gaaclarke April 10, 2020 20:25
@@ -75,6 +75,11 @@ public boolean equals(Object o) {
&& composingEnd == value.composingEnd
&& text.equals(value.text);
}

@Override
public int hashCode() {
Copy link
Member

Choose a reason for hiding this comment

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

The pattern followed elsewhere (I looked at AccessibilityViewEmbedder.java) seems to combine the hashcode with a prime. This one looks fine to me but it may be a good idea to isolate that into a helper so this doesn't have to be reinvented.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll follow the same style as AccessibilityViewEmbedder.java for now to unblock the G3 roll, but yeah, we should find a place to add prime hashing logic to share across the android embedder.

@GaryQian GaryQian added the waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land. label Apr 10, 2020
@GaryQian GaryQian removed the request for review from gaaclarke April 10, 2020 22:51
@fluttergithubbot fluttergithubbot merged commit 2d19576 into flutter:master Apr 10, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants