mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-12 20:15:55 +00:00
Issue 625: use (even) better primes for hashcodes
This commit is contained in:
1 parent
2ab6cc809d
commit
14cc545276
34 files changed
+82
-65
No files matched your search
@@ -36,7 +36,7 @@ class DataOnLocalClass1 {
|
||||
return (other instanceof Local);
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() {
|
||||
final int PRIME = 277;
|
||||
final int PRIME = 59;
|
||||
int result = 1;
|
||||
result = ((result * PRIME) + this.getX());
|
||||
final java.lang.Object $name = this.getName();
|
||||
@@ -86,7 +86,7 @@ class DataOnLocalClass2 {
|
||||
return (other instanceof Local.InnerLocal);
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() {
|
||||
final int PRIME = 277;
|
||||
final int PRIME = 59;
|
||||
int result = 1;
|
||||
final java.lang.Object $name = this.getName();
|
||||
result = ((result * PRIME) + (($name == null) ? 0 : $name.hashCode()));
|
||||
@@ -124,7 +124,7 @@ class DataOnLocalClass2 {
|
||||
return (other instanceof Local);
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() {
|
||||
final int PRIME = 277;
|
||||
final int PRIME = 59;
|
||||
int result = 1;
|
||||
result = ((result * PRIME) + this.getX());
|
||||
return result;
|
||||
|
||||
Reference in new issue
Block a user