Community
Participate
Working Groups
There is a inconsistency between the legacy generated hashCode and the new "Java 7" generated hashCode : Legacy : @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((param1 == null) ? 0 : param1.hashCode()); result = prime * result + ((param2 == null) ? 0 : param2.hashCode()); return result; } Java 7 : @Override public int hashCode() { return Objects.hash(param1, param2); } The new version does not take in account the super.hashCode() in the computation, leading to inconsistency between generated hashCode and equals. I think the Java 7 version should be somethings like this : @Override public int hashCode() { return 31 * super.hashCode() + Objects.hash(param1, param2); }
Thanks for reporting, that is already fixed for 4.10 *** This bug has been marked as a duplicate of bug 539589 ***