-
Improvement
-
Resolution: Done
-
Medium
-
None
-
None
We currently generate the following code for single-entry classes:
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + Objects.hashCode(_lockName); return result; }
This is wasteful, as we could simply delegate to _lockName(), which could be caching hashCode (as String does), thus arithmetics from hashCode().
We should end up with:
@Override public int hashCode() { return Objects.hashCode(_lockName); }
which is a change in hashCode() specification, hence runtime needs to be updated accordingly.