mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-16 06:14:36 +00:00
Issue 366: don't call the getter twice, fixed for javac.
This commit is contained in:
1 parent
d8e933223f
commit
5a13db5dc9
10 files changed
+170
-93
No files matched your search
@@ -3,6 +3,7 @@ class EqualsAndHashCode {
|
||||
boolean[] y;
|
||||
Object[] z;
|
||||
String a;
|
||||
String b;
|
||||
@java.lang.Override
|
||||
@java.lang.SuppressWarnings("all")
|
||||
public boolean equals(final java.lang.Object o) {
|
||||
@@ -13,7 +14,12 @@ class EqualsAndHashCode {
|
||||
if (this.x != other.x) return false;
|
||||
if (!java.util.Arrays.equals(this.y, other.y)) return false;
|
||||
if (!java.util.Arrays.deepEquals(this.z, other.z)) return false;
|
||||
if (this.a == null ? other.a != null : !this.a.equals((java.lang.Object)other.a)) return false;
|
||||
final java.lang.Object this$a = this.a;
|
||||
final java.lang.Object other$a = other.a;
|
||||
if (this$a == null ? other$a != null : !this$a.equals(other$a)) return false;
|
||||
final java.lang.Object this$b = this.b;
|
||||
final java.lang.Object other$b = other.b;
|
||||
if (this$b == null ? other$b != null : !this$b.equals(other$b)) return false;
|
||||
return true;
|
||||
}
|
||||
@java.lang.SuppressWarnings("all")
|
||||
@@ -28,12 +34,18 @@ class EqualsAndHashCode {
|
||||
result = result * PRIME + this.x;
|
||||
result = result * PRIME + java.util.Arrays.hashCode(this.y);
|
||||
result = result * PRIME + java.util.Arrays.deepHashCode(this.z);
|
||||
result = result * PRIME + (this.a == null ? 0 : this.a.hashCode());
|
||||
final java.lang.Object $a = this.a;
|
||||
result = result * PRIME + ($a == null ? 0 : $a.hashCode());
|
||||
final java.lang.Object $b = this.b;
|
||||
result = result * PRIME + ($b == null ? 0 : $b.hashCode());
|
||||
return result;
|
||||
}
|
||||
}
|
||||
final class EqualsAndHashCode2 {
|
||||
int x;
|
||||
long y;
|
||||
float f;
|
||||
double d;
|
||||
@java.lang.Override
|
||||
@java.lang.SuppressWarnings("all")
|
||||
public boolean equals(final java.lang.Object o) {
|
||||
@@ -41,6 +53,9 @@ final class EqualsAndHashCode2 {
|
||||
if (!(o instanceof EqualsAndHashCode2)) return false;
|
||||
final EqualsAndHashCode2 other = (EqualsAndHashCode2)o;
|
||||
if (this.x != other.x) return false;
|
||||
if (this.y != other.y) return false;
|
||||
if (java.lang.Float.compare(this.f, other.f) != 0) return false;
|
||||
if (java.lang.Double.compare(this.d, other.d) != 0) return false;
|
||||
return true;
|
||||
}
|
||||
@java.lang.Override
|
||||
@@ -49,6 +64,11 @@ final class EqualsAndHashCode2 {
|
||||
final int PRIME = 31;
|
||||
int result = 1;
|
||||
result = result * PRIME + this.x;
|
||||
final long $y = this.y;
|
||||
result = result * PRIME + (int)($y >>> 32 ^ $y);
|
||||
result = result * PRIME + java.lang.Float.floatToIntBits(this.f);
|
||||
final long $d = java.lang.Double.doubleToLongBits(this.d);
|
||||
result = result * PRIME + (int)($d >>> 32 ^ $d);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user