zafarkhaja / jsemver

Java implementation of the SemVer Specification
MIT License
429 stars 82 forks source link

hashCode violates contract in Version 0.7.1 #8

Closed robertschaft closed 10 years ago

robertschaft commented 10 years ago

Quote from http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html#hashCode%28%29

If two objects are equal according to the equals(Object) method, then calling the hashCode method on each of the two objects must produce the same integer result.

Because two versions are equal independent of their build metadata, the hashCode must not include the build metadata.

zafarkhaja commented 10 years ago

Thank you very much for reporting. Fixed and scheduled for the next release 0.7.2 as of 591b183.

zafarkhaja commented 10 years ago

0.7.2 released. Thanks once again.