-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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(), and isSimilar() for bounding volumes #2252
Conversation
94b52ef
to
aa55d7f
Compare
@pspeed42: If you've got a moment, I'd like your opinion on whether |
It probably should ignore... but probably also that's up to the class that contains the field. It would maybe be more forward-thinking of these subclasses called super.equals() and super.hashCode() as part of their processing rather than hoping to grab the right fields from the super class (which in my opinion should have been private fields in the first place... but that's a different religious hill to die on another day). |
Thanks for your insights, Paul. |
3177879
to
37375bb
Compare
ready for review |
…2252) * implement equals() and hashCode() for BoundingBox * implement equals() and hashCode() for BoundingSphere * implement isSimilar() for BoundingBox * implement isSimilar() for BoundingSphere * BoundingSphere: add comments to emphasize the treatment of checkPlane * TestBoundingSphere: test equals() and isSimilar() * jme3-core tests: add the TestBoundingBox class * BoundingVolume: add equals() and hashCode() methods * utilize super.equals() and super.hashCode() * refactor to utilize Objects.hash()
This PR addresses the enhancements request in issue #2249.
Since the PR overrides
equals()
, it must also overridehashCode()
because the contract ofhashCode()
specifies that objects that are equal must return the same code.The new methods intentionally ignore the
checkPlane
field, which holds auxiliary data used by theCamera
class.