mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-13 14:16:11 +00:00
[#625] Instead of '31' as a prime number for hashCode(), use something else. 31, probably owing to its inclusion in Effective Java, is overused, as proven by Maaartinus in issue 625. Switching to 277 instead. Also, 1231/1237 pair used for booleans has been replaced by 2591/2609.
This commit is contained in:
1 parent
685ddfd52e
commit
a40a86ad53
32 files changed
+72
-65
No files matched your search
@@ -57,7 +57,7 @@ import static lombok.AccessLevel.NONE;
|
||||
return (other instanceof EqualsAndHashCodeWithNoExistingMethods);
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() {
|
||||
final int PRIME = 31;
|
||||
final int PRIME = 277;
|
||||
int result = 1;
|
||||
result = ((result * PRIME) + this.x);
|
||||
return result;
|
||||
|
||||
Reference in new issue
Block a user