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

Fix equal / hashCode inconsistencies around Array #513

Merged
merged 2 commits into from Mar 23, 2018

Conversation

Projects
None yet
3 participants
@eed3si9n
Copy link
Member

commented Mar 23, 2018

This bumps Contraband to 0.4.0 to fix equal/hashCode inconsistencies (sbt/contraband#119).

originally reported by @smarter on zinc-contrib Gitter:

Observe: https://github.com/sbt/zinc/blob/1.x/internal/compiler-interface/src/main/contraband-java/xsbti/api/Path.java
equals uses Arrays.deepEquals to compare arrays, but hashcode uses the regular array hashCode instead of Arrays.deepHashCode.

eed3si9n added some commits Mar 23, 2018

@eed3si9n eed3si9n changed the title bump IO, Util, and LM Fix equal / hashCode inconsistencies around Array Mar 23, 2018

}
}
public int hashCode() {
return 37 * (37 * (37 * (17 + "xsbti.api.Annotated".hashCode()) + baseType().hashCode()) + annotations().hashCode());
return 37 * (37 * (37 * (17 + "xsbti.api.Annotated".hashCode()) + baseType().hashCode()) + java.util.Arrays.deepHashCode(annotations()));

This comment has been minimized.

Copy link
@eed3si9n

eed3si9n Mar 23, 2018

Author Member

See hashCode has been changed to java.util.Arrays.deepHashCode.

@eed3si9n eed3si9n requested review from dwijnand and jvican Mar 23, 2018

@eed3si9n eed3si9n added this to the 1.1.2 milestone Mar 23, 2018

@jvican

jvican approved these changes Mar 23, 2018

@jvican jvican merged commit 0c5422a into sbt:1.1.x Mar 23, 2018

1 check passed

continuous-integration/drone/pr the build was successful
Details

@eed3si9n eed3si9n deleted the eed3si9n:wip/bump branch Mar 23, 2018

@jvican jvican referenced this pull request Mar 23, 2018

Merged

Update zinc #384

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.