diff options
author | Andre Brait <andrebrait@gmail.com> | 2020-07-13 17:15:03 +0200 |
---|---|---|
committer | Roel Spilker <r.spilker@gmail.com> | 2020-09-24 22:25:15 +0200 |
commit | 4e0ffbc32913001082dd2387a20b480076ddd20a (patch) | |
tree | 2b4f761937c59192549348753a051b06f1c13a90 /test/transform/resource/after-delombok/EqualsAndHashCodeCache.java | |
parent | b78a6af49cb82dd1dc03e6839b33827688fda3f6 (diff) | |
download | lombok-4e0ffbc32913001082dd2387a20b480076ddd20a.tar.gz lombok-4e0ffbc32913001082dd2387a20b480076ddd20a.tar.bz2 lombok-4e0ffbc32913001082dd2387a20b480076ddd20a.zip |
Eclipse impl and tests
Diffstat (limited to 'test/transform/resource/after-delombok/EqualsAndHashCodeCache.java')
-rw-r--r-- | test/transform/resource/after-delombok/EqualsAndHashCodeCache.java | 151 |
1 files changed, 151 insertions, 0 deletions
diff --git a/test/transform/resource/after-delombok/EqualsAndHashCodeCache.java b/test/transform/resource/after-delombok/EqualsAndHashCodeCache.java new file mode 100644 index 00000000..e3e266aa --- /dev/null +++ b/test/transform/resource/after-delombok/EqualsAndHashCodeCache.java @@ -0,0 +1,151 @@ +class EqualsAndHashCode { + int x; + boolean[] y; + Object[] z; + String a; + String b; + @java.lang.Override + @java.lang.SuppressWarnings("all") + public boolean equals(final java.lang.Object o) { + if (o == this) return true; + if (!(o instanceof EqualsAndHashCode)) return false; + final EqualsAndHashCode other = (EqualsAndHashCode) o; + if (!other.canEqual((java.lang.Object) this)) return false; + 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; + 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") + protected boolean canEqual(final java.lang.Object other) { + return other instanceof EqualsAndHashCode; + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public int hashCode() { + final int PRIME = 59; + int result = 1; + result = result * PRIME + this.x; + result = result * PRIME + java.util.Arrays.hashCode(this.y); + result = result * PRIME + java.util.Arrays.deepHashCode(this.z); + final java.lang.Object $a = this.a; + result = result * PRIME + ($a == null ? 43 : $a.hashCode()); + final java.lang.Object $b = this.b; + result = result * PRIME + ($b == null ? 43 : $b.hashCode()); + return result; + } +} +final class EqualsAndHashCode2 { + int x; + long y; + float f; + double d; + boolean b; + private transient int $hashCodeCache = 0; + @java.lang.Override + @java.lang.SuppressWarnings("all") + public boolean equals(final java.lang.Object o) { + if (o == this) return true; + 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; + if (this.b != other.b) return false; + return true; + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public int hashCode() { + if ($hashCodeCache != 0) return $hashCodeCache; + final int PRIME = 59; + 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); + result = result * PRIME + (this.b ? 79 : 97); + $hashCodeCache = result; + return result; + } +} +final class EqualsAndHashCode3 extends EqualsAndHashCode { + private transient int $hashCodeCache = 0; + @java.lang.Override + @java.lang.SuppressWarnings("all") + public boolean equals(final java.lang.Object o) { + if (o == this) return true; + if (!(o instanceof EqualsAndHashCode3)) return false; + final EqualsAndHashCode3 other = (EqualsAndHashCode3) o; + if (!other.canEqual((java.lang.Object) this)) return false; + return true; + } + @java.lang.SuppressWarnings("all") + protected boolean canEqual(final java.lang.Object other) { + return other instanceof EqualsAndHashCode3; + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public int hashCode() { + if ($hashCodeCache != 0) return $hashCodeCache; + final int result = 1; + $hashCodeCache = result; + return result; + } +} +class EqualsAndHashCode4 extends EqualsAndHashCode { + @java.lang.Override + @java.lang.SuppressWarnings("all") + public boolean equals(final java.lang.Object o) { + if (o == this) return true; + if (!(o instanceof EqualsAndHashCode4)) return false; + final EqualsAndHashCode4 other = (EqualsAndHashCode4) o; + if (!other.canEqual((java.lang.Object) this)) return false; + if (!super.equals(o)) return false; + return true; + } + @java.lang.SuppressWarnings("all") + protected boolean canEqual(final java.lang.Object other) { + return other instanceof EqualsAndHashCode4; + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public int hashCode() { + final int result = super.hashCode(); + return result; + } +} +class EqualsAndHashCode5 extends EqualsAndHashCode { + private transient int $hashCodeCache = 0; + @java.lang.Override + @java.lang.SuppressWarnings("all") + public boolean equals(final java.lang.Object o) { + if (o == this) return true; + if (!(o instanceof EqualsAndHashCode5)) return false; + final EqualsAndHashCode5 other = (EqualsAndHashCode4) o; + if (!other.canEqual((java.lang.Object) this)) return false; + if (!super.equals(o)) return false; + return true; + } + @java.lang.SuppressWarnings("all") + protected boolean canEqual(final java.lang.Object other) { + return other instanceof EqualsAndHashCode5; + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public int hashCode() { + if ($hashCodeCache != 0) return $hashCodeCache; + final int result = super.hashCode(); + $hashCodeCache = result; + return result; + } +} |