Skip to content

Conversation

@nastra
Copy link

@nastra nastra commented Feb 20, 2019

@jorgebay
Copy link
Contributor

Can we add some unit tests around this? For example:

  • assert that different instances with same values produce the same hash
  • assert that same values in different order produces different hash

@nastra
Copy link
Author

nastra commented Feb 21, 2019

@jorgebay force pushed two tests.
Ideally we should be using e.g. guava's EqualsTester to make sure equals/hashCode are properly implemented. The problem however is that Java's equals/hashCode contract allows hash collisions if two objects are equal but that doesn't mean that one should produce hash collisions as otherwise perf will be negatively affected when using those objects in data structures relying on hashCode

@jorgebay
Copy link
Contributor

Looks good, thanks!

VOTE +1

@spmallette
Copy link
Contributor

VOTE +1

@robertdale
Copy link
Member

docker/build.sh -i -t -n success
VOTE +1

@dkuppitz
Copy link
Contributor

VOTE +1

@spmallette spmallette merged commit a440e88 into apache:tp33 Feb 21, 2019
@nastra nastra deleted the TINKERPOP-2164 branch February 22, 2019 07:41
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

Successfully merging this pull request may close these issues.

5 participants