diff options
author | Andre Brait <andrebrait@gmail.com> | 2020-07-13 18:50:12 +0200 |
---|---|---|
committer | Roel Spilker <r.spilker@gmail.com> | 2020-09-24 22:25:15 +0200 |
commit | d00ab552e199410c283049cd8d9359a69855f1f2 (patch) | |
tree | d625204bafff70f938e8bc34c08cb5a3289fd235 /test/transform/resource/after-ecj | |
parent | 4e0ffbc32913001082dd2387a20b480076ddd20a (diff) | |
download | lombok-d00ab552e199410c283049cd8d9359a69855f1f2.tar.gz lombok-d00ab552e199410c283049cd8d9359a69855f1f2.tar.bz2 lombok-d00ab552e199410c283049cd8d9359a69855f1f2.zip |
Finish implementation, add tests
Diffstat (limited to 'test/transform/resource/after-ecj')
-rw-r--r-- | test/transform/resource/after-ecj/EqualsAndHashCodeCache.java | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/test/transform/resource/after-ecj/EqualsAndHashCodeCache.java b/test/transform/resource/after-ecj/EqualsAndHashCodeCache.java index 4eb4fbb3..3c4d0daa 100644 --- a/test/transform/resource/after-ecj/EqualsAndHashCodeCache.java +++ b/test/transform/resource/after-ecj/EqualsAndHashCodeCache.java @@ -48,12 +48,12 @@ } } final @lombok.EqualsAndHashCode(cacheStrategy = lombok.EqualsAndHashCode.CacheStrategy.LAZY) class EqualsAndHashCode2 { + private transient @java.lang.SuppressWarnings("all") int $hashCodeCache = 0; int x; long y; float f; double d; boolean b; - private transient int $hashCodeCache = 0; EqualsAndHashCode2() { super(); } @@ -76,8 +76,8 @@ final @lombok.EqualsAndHashCode(cacheStrategy = lombok.EqualsAndHashCode.CacheSt return true; } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { - if ($hashCodeCache != 0) - return $hashCodeCache; + if ((this.$hashCodeCache != 0)) + return this.$hashCodeCache; final int PRIME = 59; int result = 1; result = ((result * PRIME) + this.x); @@ -87,11 +87,12 @@ final @lombok.EqualsAndHashCode(cacheStrategy = lombok.EqualsAndHashCode.CacheSt final long $d = java.lang.Double.doubleToLongBits(this.d); result = ((result * PRIME) + (int) ($d ^ ($d >>> 32))); result = ((result * PRIME) + (this.b ? 79 : 97)); - $hashCodeCache = result; + this.$hashCodeCache = result; return result; } } -final @lombok.EqualsAndHashCode(callSuper=false, cacheStrategy = lombok.EqualsAndHashCode.CacheStrategy.LAZY) class EqualsAndHashCode3 extends EqualsAndHashCode { +final @lombok.EqualsAndHashCode(callSuper = false,cacheStrategy = lombok.EqualsAndHashCode.CacheStrategy.LAZY) class EqualsAndHashCode3 extends EqualsAndHashCode { + private transient @java.lang.SuppressWarnings("all") int $hashCodeCache = 0; EqualsAndHashCode3() { super(); } @@ -109,11 +110,14 @@ final @lombok.EqualsAndHashCode(callSuper=false, cacheStrategy = lombok.EqualsAn return (other instanceof EqualsAndHashCode3); } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { + if ((this.$hashCodeCache != 0)) + return this.$hashCodeCache; final int result = 1; + this.$hashCodeCache = result; return result; } } -@lombok.EqualsAndHashCode(callSuper=true, cacheStrategy = lombok.EqualsAndHashCode.CacheStrategy.LAZY) class EqualsAndHashCode4 extends EqualsAndHashCode { +@lombok.EqualsAndHashCode(callSuper = true,cacheStrategy = lombok.EqualsAndHashCode.CacheStrategy.LAZY) class EqualsAndHashCode4 extends EqualsAndHashCode { EqualsAndHashCode4() { super(); } @@ -137,10 +141,10 @@ final @lombok.EqualsAndHashCode(callSuper=false, cacheStrategy = lombok.EqualsAn return result; } } -@lombok.EqualsAndHashCode(callSuper=true, cacheStrategy = lombok.EqualsAndHashCode.CacheStrategy.LAZY) class EqualsAndHashCode5 extends EqualsAndHashCode { - private transient int $hashCodeCache = 0; +final @lombok.EqualsAndHashCode(callSuper = true,cacheStrategy = lombok.EqualsAndHashCode.CacheStrategy.LAZY) class EqualsAndHashCode5 extends EqualsAndHashCode { + private transient @java.lang.SuppressWarnings("all") int $hashCodeCache = 0; EqualsAndHashCode5() { - super(); + super(); } public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { if ((o == this)) @@ -149,19 +153,19 @@ final @lombok.EqualsAndHashCode(callSuper=false, cacheStrategy = lombok.EqualsAn return false; final EqualsAndHashCode5 other = (EqualsAndHashCode5) o; if ((! other.canEqual((java.lang.Object) this))) - return false; + return false; if ((! super.equals(o))) - return false; - return true; + return false; + return true; } protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof EqualsAndHashCode5); } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { - if ($hashCodeCache != 0) - return $hashCodeCache; + if ((this.$hashCodeCache != 0)) + return this.$hashCodeCache; final int result = super.hashCode(); - $hashCodeCache = result; + this.$hashCodeCache = result; return result; } } |