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

add test case for hashcode in attribute #840

Closed
wants to merge 1 commit into from

Conversation

danglotb
Copy link
Contributor

Hello,

I propose this changes to specify the hashCode of the object org.jsoup.nodes.Attribute.

@cketti
Copy link
Contributor

cketti commented Feb 27, 2017

Why? The return value of hashCode() is typically an implementation detail, not part of the public API.

@danglotb
Copy link
Contributor Author

The return value of hashCode() is typically an implementation detail, not part of the public API.

I totally agree with you.

But I think the hashCode() method worth a test case since it has to be deterministic.

@cketti
Copy link
Contributor

cketti commented Feb 27, 2017

Test the contract then. The documentation is very explicit on what that includes: https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--

You might find this helpful: http://jqno.nl/equalsverifier/

@jhy
Copy link
Owner

jhy commented Jun 8, 2017

Thanks. I agree with @cketti, this does not test the functionality or the contract, and the impl is trivial anyway.

@jhy jhy closed this Jun 8, 2017
@jhy jhy added the wont-fix label Jun 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants