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

FileSet Instances with Identical Contents Fail Equality, Have Inconsistent Hash Codes #43

Closed
michaelahlers opened this issue Aug 15, 2016 · 1 comment

Comments

@michaelahlers
Copy link

Two FileSet instances with identical contents are reflexively equal (by reference) but not intrinsically equal (by contents), and they exhibit inconsistent hash codes. The same statement is true of FileSet.Entry. Apart from missing implementations on FileSet itself, this is caused by FileSet.Entry#_matchingPattern participating in equality and hashCode but java.util.regex.Pattern does not implement either.

@michaelahlers
Copy link
Author

There's a straightforward solution using Pattern#pattern() for equality and hashing. I'll be submitting a pull request with a patch and unit tests shortly.

michaelahlers pushed a commit to michaelahlers/flapdoodle-embed-process that referenced this issue Aug 15, 2016
…odle-oss/de.flapdoodle.embed.process/43)
michaelahlers pushed a commit to michaelahlers/flapdoodle-embed-process that referenced this issue Aug 15, 2016
…odle-oss#43)

These make sense when the class itself is final, but I won't make that assumption. If upstream maintainers make `FileSet.Entry` final, this suppression can (and should) be removed.
michaelahlers pushed a commit to michaelahlers/flapdoodle-embed-process that referenced this issue Aug 15, 2016
michaelahlers pushed a commit to michaelahlers/flapdoodle-embed-process that referenced this issue Aug 15, 2016
michaelahlers pushed a commit to michaelahlers/flapdoodle-embed-process that referenced this issue Aug 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants