highsource / jaxb2-basics

Useful plugins and tools for JAXB2.
BSD 2-Clause "Simplified" License
109 stars 54 forks source link

DefaultHashCodeStrategy.hashCode does not compute a hashCode for modified object #67

Closed halfdan87 closed 8 years ago

halfdan87 commented 8 years ago
@Override
public int hashCode(ObjectLocator locator, int hashCode, Object value,
        boolean valueSet) {
    return valueSet ? (hashCode * iConstant + 1) : hashCode(locator,
            hashCode * iConstant, value);
}

Is this code correct? If the value was changed (valueSet == true) than we skip hashCode calculation. It is opposite to the DefaultEqualsStrategy's equals methods behavior.

highsource commented 8 years ago

Indeed. A major bug, I wonder how it went undetected for so long.

adischerrer commented 8 years ago

The latest release 0.11 still contains this bug (#67). Are you going to create a new version containing this fix?

highsource commented 8 years ago

Does the latest snapshot work for you?

adischerrer commented 8 years ago

Just created a 0.11.1-SNAPSHOT from master and... YES, it works as expected. Could you please create an official 0.11.1 please?

highsource commented 8 years ago

Will do. Thank you for confirmation.

highsource commented 8 years ago

Released.

adischerrer commented 8 years ago

Great. Thank you. Is the new release number 1.11.1 by design or should it rather be 0.11.1 ?

highsource commented 8 years ago

Oh. :( 0.11.1 My Bad.

On Thu, Jun 30, 2016 at 8:46 AM, Adrian Scherrer notifications@github.com wrote:

Great. Thank you. Is the new release number 1.11.1 by design or should it rather be 0.11.1 ?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/highsource/jaxb2-basics/issues/67#issuecomment-229574080, or mute the thread https://github.com/notifications/unsubscribe/AGZbHHllWgQQUVrIs7h8PeRlm-G7gQI4ks5qQ2ZMgaJpZM4HwO8p .

highsource commented 8 years ago

0.11.1 released now. 1.11.1 is marked as PUBLISHED-BY-MISTAKE.