Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement equals/hashcode for RequestOptions and TransitionOptions #4917

Merged
merged 1 commit into from Oct 5, 2022

Conversation

sjudd
Copy link
Collaborator

@sjudd sjudd commented Oct 5, 2022

It's a little tricky to get this right because we've defined equals/hashcode in the base classes, but are implementing them in the concrete classes. I think this implementation is actually safe because the base classes are abstract. However making equals transitive requires the weird equals() only implementations in the classes that have no properties but are concrete implementations of the base classes.

A safer way to do this would be to move the the equals/hashcode implementation out of the base class and re-implement it in each subclass. However that would require exposing a bunch of internal instance variables to subclasses. Given the existing structure and the public nature of the base classes, this seems like a reasonable compromise.

Fixes #4916

…ncrete classes.

It's a little tricky to get this right because we've defined
equals/hashcode in the base classes, but are implementing them in the
concrete classes. I think this implementation is actually safe because
the base classes are abstract. However making equals transitive requires
the weird equals() only implementations in the classes that have no
properties but are concrete implementations of the base classes.

A safer way to do this would be to move the the equals/hashcode
implementation out of the base class and re-implement it in each
subclass. However that would require exposing a bunch of internal
instance variables to subclasses. Given the existing structure and the
public nature of the base classes, this seems like a reasonable
compromise.

Fixes bumptech#4916
@sjudd sjudd added the import-ready Indicates the PR is ready to be imported to Google. label Oct 5, 2022
@copybara-service copybara-service bot merged commit 293a202 into bumptech:master Oct 5, 2022
@sjudd sjudd deleted the fix_compose_model_updates branch October 6, 2022 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
import-ready Indicates the PR is ready to be imported to Google.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compose GlideImage does not repaint Image when model changed
1 participant