diff options
Diffstat (limited to 'test')
36 files changed, 131 insertions, 58 deletions
diff --git a/test/transform/resource/after-delombok/Accessors.java b/test/transform/resource/after-delombok/Accessors.java index 8b984236..0d15fe43 100644 --- a/test/transform/resource/after-delombok/Accessors.java +++ b/test/transform/resource/after-delombok/Accessors.java @@ -78,7 +78,7 @@ class AccessorsPrefix3 { return true; } @java.lang.SuppressWarnings("all") - public boolean canEqual(final java.lang.Object other) { + protected boolean canEqual(final java.lang.Object other) { return other instanceof AccessorsPrefix3; } @java.lang.Override diff --git a/test/transform/resource/after-delombok/ConflictingStaticConstructorNames.java b/test/transform/resource/after-delombok/ConflictingStaticConstructorNames.java index 172ed298..ae0c46bc 100644 --- a/test/transform/resource/after-delombok/ConflictingStaticConstructorNames.java +++ b/test/transform/resource/after-delombok/ConflictingStaticConstructorNames.java @@ -9,7 +9,7 @@ class ConflictingStaticConstructorNames { return true; } @java.lang.SuppressWarnings("all") - public boolean canEqual(final java.lang.Object other) { + protected boolean canEqual(final java.lang.Object other) { return other instanceof ConflictingStaticConstructorNames; } @java.lang.Override diff --git a/test/transform/resource/after-delombok/DataExtended.java b/test/transform/resource/after-delombok/DataExtended.java index 07aa1f7e..6a5e7fa2 100644 --- a/test/transform/resource/after-delombok/DataExtended.java +++ b/test/transform/resource/after-delombok/DataExtended.java @@ -22,7 +22,7 @@ class DataExtended { return true; } @java.lang.SuppressWarnings("all") - public boolean canEqual(final java.lang.Object other) { + protected boolean canEqual(final java.lang.Object other) { return other instanceof DataExtended; } @java.lang.Override diff --git a/test/transform/resource/after-delombok/DataIgnore.java b/test/transform/resource/after-delombok/DataIgnore.java index fa729ada..922de01b 100644 --- a/test/transform/resource/after-delombok/DataIgnore.java +++ b/test/transform/resource/after-delombok/DataIgnore.java @@ -21,7 +21,7 @@ class DataIgnore { return true; } @java.lang.SuppressWarnings("all") - public boolean canEqual(final java.lang.Object other) { + protected boolean canEqual(final java.lang.Object other) { return other instanceof DataIgnore; } @java.lang.Override diff --git a/test/transform/resource/after-delombok/DataOnLocalClass.java b/test/transform/resource/after-delombok/DataOnLocalClass.java index bbd9ae4b..5d73e584 100644 --- a/test/transform/resource/after-delombok/DataOnLocalClass.java +++ b/test/transform/resource/after-delombok/DataOnLocalClass.java @@ -33,7 +33,7 @@ class DataOnLocalClass1 { return true; } @java.lang.SuppressWarnings("all") - public boolean canEqual(final java.lang.Object other) { + protected boolean canEqual(final java.lang.Object other) { return other instanceof Local; } @java.lang.Override @@ -93,7 +93,7 @@ class DataOnLocalClass2 { return true; } @java.lang.SuppressWarnings("all") - public boolean canEqual(final java.lang.Object other) { + protected boolean canEqual(final java.lang.Object other) { return other instanceof Local.InnerLocal; } @java.lang.Override @@ -130,7 +130,7 @@ class DataOnLocalClass2 { return true; } @java.lang.SuppressWarnings("all") - public boolean canEqual(final java.lang.Object other) { + protected boolean canEqual(final java.lang.Object other) { return other instanceof Local; } @java.lang.Override diff --git a/test/transform/resource/after-delombok/DataPlain.java b/test/transform/resource/after-delombok/DataPlain.java index 6d536c8a..8988dc6f 100644 --- a/test/transform/resource/after-delombok/DataPlain.java +++ b/test/transform/resource/after-delombok/DataPlain.java @@ -32,7 +32,7 @@ class Data1 { return true; } @java.lang.SuppressWarnings("all") - public boolean canEqual(final java.lang.Object other) { + protected boolean canEqual(final java.lang.Object other) { return other instanceof Data1; } @java.lang.Override @@ -85,7 +85,7 @@ class Data2 { return true; } @java.lang.SuppressWarnings("all") - public boolean canEqual(final java.lang.Object other) { + protected boolean canEqual(final java.lang.Object other) { return other instanceof Data2; } @java.lang.Override @@ -181,7 +181,7 @@ final class Data4 extends java.util.Timer { return true; } @java.lang.SuppressWarnings("all") - public boolean canEqual(final java.lang.Object other) { + protected boolean canEqual(final java.lang.Object other) { return other instanceof Data4; } @java.lang.Override @@ -208,7 +208,7 @@ class Data5 { return true; } @java.lang.SuppressWarnings("all") - public boolean canEqual(final java.lang.Object other) { + protected boolean canEqual(final java.lang.Object other) { return other instanceof Data5; } @java.lang.Override diff --git a/test/transform/resource/after-delombok/DataWithGetter.java b/test/transform/resource/after-delombok/DataWithGetter.java index b429fe53..91f392ec 100644 --- a/test/transform/resource/after-delombok/DataWithGetter.java +++ b/test/transform/resource/after-delombok/DataWithGetter.java @@ -30,7 +30,7 @@ class DataWithGetter { return true; } @java.lang.SuppressWarnings("all") - public boolean canEqual(final java.lang.Object other) { + protected boolean canEqual(final java.lang.Object other) { return other instanceof DataWithGetter; } @java.lang.Override diff --git a/test/transform/resource/after-delombok/DataWithGetterNone.java b/test/transform/resource/after-delombok/DataWithGetterNone.java index b063b4ff..5986ee9f 100644 --- a/test/transform/resource/after-delombok/DataWithGetterNone.java +++ b/test/transform/resource/after-delombok/DataWithGetterNone.java @@ -30,7 +30,7 @@ class DataWithGetterNone { return true; } @java.lang.SuppressWarnings("all") - public boolean canEqual(final java.lang.Object other) { + protected boolean canEqual(final java.lang.Object other) { return other instanceof DataWithGetterNone; } @java.lang.Override diff --git a/test/transform/resource/after-delombok/EqualsAndHashCode.java b/test/transform/resource/after-delombok/EqualsAndHashCode.java index afe03dea..02ca2c42 100644 --- a/test/transform/resource/after-delombok/EqualsAndHashCode.java +++ b/test/transform/resource/after-delombok/EqualsAndHashCode.java @@ -23,7 +23,7 @@ class EqualsAndHashCode { return true; } @java.lang.SuppressWarnings("all") - public boolean canEqual(final java.lang.Object other) { + protected boolean canEqual(final java.lang.Object other) { return other instanceof EqualsAndHashCode; } @java.lang.Override @@ -86,7 +86,7 @@ final class EqualsAndHashCode3 extends EqualsAndHashCode { return true; } @java.lang.SuppressWarnings("all") - public boolean canEqual(final java.lang.Object other) { + protected boolean canEqual(final java.lang.Object other) { return other instanceof EqualsAndHashCode3; } @java.lang.Override @@ -108,7 +108,7 @@ class EqualsAndHashCode4 extends EqualsAndHashCode { return true; } @java.lang.SuppressWarnings("all") - public boolean canEqual(final java.lang.Object other) { + protected boolean canEqual(final java.lang.Object other) { return other instanceof EqualsAndHashCode4; } @java.lang.Override diff --git a/test/transform/resource/after-delombok/EqualsAndHashCodeWithExistingMethods.java b/test/transform/resource/after-delombok/EqualsAndHashCodeWithExistingMethods.java index 93b20e25..ac189f42 100644 --- a/test/transform/resource/after-delombok/EqualsAndHashCodeWithExistingMethods.java +++ b/test/transform/resource/after-delombok/EqualsAndHashCodeWithExistingMethods.java @@ -12,7 +12,27 @@ final class EqualsAndHashCodeWithExistingMethods2 { } final class EqualsAndHashCodeWithExistingMethods3 extends EqualsAndHashCodeWithExistingMethods { int x; - public boolean canEqual(Object other) { + private boolean canEqual(Object other) { return true; } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public boolean equals(final java.lang.Object o) { + if (o == this) return true; + if (!(o instanceof EqualsAndHashCodeWithExistingMethods3)) return false; + final EqualsAndHashCodeWithExistingMethods3 other = (EqualsAndHashCodeWithExistingMethods3)o; + if (!other.canEqual((java.lang.Object)this)) return false; + if (!super.equals(o)) return false; + if (this.x != other.x) return false; + return true; + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public int hashCode() { + final int PRIME = 59; + int result = 1; + result = result * PRIME + super.hashCode(); + result = result * PRIME + this.x; + return result; + } }
\ No newline at end of file diff --git a/test/transform/resource/after-delombok/EqualsAndHashCodeWithSomeExistingMethods.java b/test/transform/resource/after-delombok/EqualsAndHashCodeWithSomeExistingMethods.java index aa9b984f..37eeb8df 100644 --- a/test/transform/resource/after-delombok/EqualsAndHashCodeWithSomeExistingMethods.java +++ b/test/transform/resource/after-delombok/EqualsAndHashCodeWithSomeExistingMethods.java @@ -17,7 +17,7 @@ class EqualsAndHashCodeWithSomeExistingMethods { } class EqualsAndHashCodeWithSomeExistingMethods2 { int x; - public boolean canEqual(Object other) { + protected boolean canEqual(Object other) { return false; } @java.lang.SuppressWarnings("all") @@ -25,6 +25,24 @@ class EqualsAndHashCodeWithSomeExistingMethods2 { } @java.lang.Override @java.lang.SuppressWarnings("all") + public boolean equals(final java.lang.Object o) { + if (o == this) return true; + if (!(o instanceof EqualsAndHashCodeWithSomeExistingMethods2)) return false; + final EqualsAndHashCodeWithSomeExistingMethods2 other = (EqualsAndHashCodeWithSomeExistingMethods2)o; + if (!other.canEqual((java.lang.Object)this)) return false; + if (this.x != other.x) return false; + return true; + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public int hashCode() { + final int PRIME = 59; + int result = 1; + result = result * PRIME + this.x; + return result; + } + @java.lang.Override + @java.lang.SuppressWarnings("all") public java.lang.String toString() { return "EqualsAndHashCodeWithSomeExistingMethods2(x=" + this.x + ")"; } @@ -63,7 +81,7 @@ class EqualsAndHashCodeWithNoExistingMethods { return true; } @java.lang.SuppressWarnings("all") - public boolean canEqual(final java.lang.Object other) { + protected boolean canEqual(final java.lang.Object other) { return other instanceof EqualsAndHashCodeWithNoExistingMethods; } @java.lang.Override diff --git a/test/transform/resource/after-delombok/GetterLazyBoolean.java b/test/transform/resource/after-delombok/GetterLazyBoolean.java index eb6662e2..f684fc07 100644 --- a/test/transform/resource/after-delombok/GetterLazyBoolean.java +++ b/test/transform/resource/after-delombok/GetterLazyBoolean.java @@ -15,7 +15,7 @@ class GetterLazyBoolean { return true; } @java.lang.SuppressWarnings("all") - public boolean canEqual(final java.lang.Object other) { + protected boolean canEqual(final java.lang.Object other) { return other instanceof GetterLazyBoolean; } @java.lang.Override diff --git a/test/transform/resource/after-delombok/GetterLazyEahcToString.java b/test/transform/resource/after-delombok/GetterLazyEahcToString.java index 3e98a25e..65c63fba 100644 --- a/test/transform/resource/after-delombok/GetterLazyEahcToString.java +++ b/test/transform/resource/after-delombok/GetterLazyEahcToString.java @@ -20,7 +20,7 @@ class GetterLazyEahcToString { } @java.lang.SuppressWarnings("all") - public boolean canEqual(final java.lang.Object other) { + protected boolean canEqual(final java.lang.Object other) { return other instanceof GetterLazyEahcToString; } diff --git a/test/transform/resource/after-delombok/GetterSetterJavadoc.java b/test/transform/resource/after-delombok/GetterSetterJavadoc.java index 743a3aac..7a782434 100644 --- a/test/transform/resource/after-delombok/GetterSetterJavadoc.java +++ b/test/transform/resource/after-delombok/GetterSetterJavadoc.java @@ -35,7 +35,7 @@ class GetterSetterJavadoc1 { return true; } @java.lang.SuppressWarnings("all") - public boolean canEqual(final java.lang.Object other) { + protected boolean canEqual(final java.lang.Object other) { return other instanceof GetterSetterJavadoc1; } @java.lang.Override diff --git a/test/transform/resource/after-delombok/ValuePlain.java b/test/transform/resource/after-delombok/ValuePlain.java index e880454b..64e5b9b9 100644 --- a/test/transform/resource/after-delombok/ValuePlain.java +++ b/test/transform/resource/after-delombok/ValuePlain.java @@ -74,7 +74,7 @@ class Value2 { return true; } @java.lang.SuppressWarnings("all") - public boolean canEqual(final java.lang.Object other) { + protected boolean canEqual(final java.lang.Object other) { return other instanceof Value2; } @java.lang.Override diff --git a/test/transform/resource/after-ecj/Accessors.java b/test/transform/resource/after-ecj/Accessors.java index c8fdc3bf..6b8976d0 100644 --- a/test/transform/resource/after-ecj/Accessors.java +++ b/test/transform/resource/after-ecj/Accessors.java @@ -86,7 +86,7 @@ class AccessorsChain { return false; return true; } - public @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof AccessorsPrefix3); } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { diff --git a/test/transform/resource/after-ecj/ConflictingStaticConstructorNames.java b/test/transform/resource/after-ecj/ConflictingStaticConstructorNames.java index 8da11258..f8aff69c 100644 --- a/test/transform/resource/after-ecj/ConflictingStaticConstructorNames.java +++ b/test/transform/resource/after-ecj/ConflictingStaticConstructorNames.java @@ -9,7 +9,7 @@ return false; return true; } - public @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof ConflictingStaticConstructorNames); } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { diff --git a/test/transform/resource/after-ecj/DataExtended.java b/test/transform/resource/after-ecj/DataExtended.java index bcfd26e3..c2652ba4 100644 --- a/test/transform/resource/after-ecj/DataExtended.java +++ b/test/transform/resource/after-ecj/DataExtended.java @@ -18,7 +18,7 @@ return false; return true; } - public @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof DataExtended); } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { diff --git a/test/transform/resource/after-ecj/DataIgnore.java b/test/transform/resource/after-ecj/DataIgnore.java index d0e72e15..d077a5db 100644 --- a/test/transform/resource/after-ecj/DataIgnore.java +++ b/test/transform/resource/after-ecj/DataIgnore.java @@ -16,7 +16,7 @@ return false; return true; } - public @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof DataIgnore); } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { diff --git a/test/transform/resource/after-ecj/DataOnLocalClass.java b/test/transform/resource/after-ecj/DataOnLocalClass.java index 511291c2..3f4832ff 100644 --- a/test/transform/resource/after-ecj/DataOnLocalClass.java +++ b/test/transform/resource/after-ecj/DataOnLocalClass.java @@ -32,7 +32,7 @@ class DataOnLocalClass1 { return false; return true; } - public @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof Local); } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { @@ -82,7 +82,7 @@ class DataOnLocalClass2 { return false; return true; } - public @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof Local.InnerLocal); } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { @@ -120,7 +120,7 @@ class DataOnLocalClass2 { return false; return true; } - public @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof Local); } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { diff --git a/test/transform/resource/after-ecj/DataPlain.java b/test/transform/resource/after-ecj/DataPlain.java index aa47fdaa..858f46dd 100644 --- a/test/transform/resource/after-ecj/DataPlain.java +++ b/test/transform/resource/after-ecj/DataPlain.java @@ -27,7 +27,7 @@ import lombok.Data; return false; return true; } - public @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof Data1); } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { @@ -74,7 +74,7 @@ import lombok.Data; return false; return true; } - public @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof Data2); } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { @@ -163,7 +163,7 @@ final @Data @lombok.EqualsAndHashCode(callSuper = true) class Data4 extends java return false; return true; } - public @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof Data4); } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { @@ -185,7 +185,7 @@ final @Data @lombok.EqualsAndHashCode(callSuper = true) class Data4 extends java return false; return true; } - public @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof Data5); } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { diff --git a/test/transform/resource/after-ecj/DataWithGetter.java b/test/transform/resource/after-ecj/DataWithGetter.java index 2ce74ceb..ee74ed4e 100644 --- a/test/transform/resource/after-ecj/DataWithGetter.java +++ b/test/transform/resource/after-ecj/DataWithGetter.java @@ -26,7 +26,7 @@ return false; return true; } - public @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof DataWithGetter); } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { diff --git a/test/transform/resource/after-ecj/DataWithGetterNone.java b/test/transform/resource/after-ecj/DataWithGetterNone.java index 087d0762..056e071d 100644 --- a/test/transform/resource/after-ecj/DataWithGetterNone.java +++ b/test/transform/resource/after-ecj/DataWithGetterNone.java @@ -26,7 +26,7 @@ return false; return true; } - public @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof DataWithGetterNone); } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { diff --git a/test/transform/resource/after-ecj/EqualsAndHashCode.java b/test/transform/resource/after-ecj/EqualsAndHashCode.java index 625a0f87..05cbf2a3 100644 --- a/test/transform/resource/after-ecj/EqualsAndHashCode.java +++ b/test/transform/resource/after-ecj/EqualsAndHashCode.java @@ -31,7 +31,7 @@ return false; return true; } - public @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof EqualsAndHashCode); } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { @@ -101,7 +101,7 @@ final @lombok.EqualsAndHashCode(callSuper = false) class EqualsAndHashCode3 exte return false; return true; } - public @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof EqualsAndHashCode3); } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { @@ -125,7 +125,7 @@ final @lombok.EqualsAndHashCode(callSuper = false) class EqualsAndHashCode3 exte return false; return true; } - public @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof EqualsAndHashCode4); } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { diff --git a/test/transform/resource/after-ecj/EqualsAndHashCodeWithExistingMethods.java b/test/transform/resource/after-ecj/EqualsAndHashCodeWithExistingMethods.java index 50b219f1..feda33ce 100644 --- a/test/transform/resource/after-ecj/EqualsAndHashCodeWithExistingMethods.java +++ b/test/transform/resource/after-ecj/EqualsAndHashCodeWithExistingMethods.java @@ -21,7 +21,28 @@ final @lombok.EqualsAndHashCode(callSuper = true) class EqualsAndHashCodeWithExi EqualsAndHashCodeWithExistingMethods3() { super(); } - public boolean canEqual(Object other) { + private boolean canEqual(Object other) { return true; } + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { + if ((o == this)) + return true; + if ((! (o instanceof EqualsAndHashCodeWithExistingMethods3))) + return false; + final @java.lang.SuppressWarnings("all") EqualsAndHashCodeWithExistingMethods3 other = (EqualsAndHashCodeWithExistingMethods3) o; + if ((! other.canEqual((java.lang.Object) this))) + return false; + if ((! super.equals(o))) + return false; + if ((this.x != other.x)) + return false; + return true; + } + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { + final int PRIME = 59; + int result = 1; + result = ((result * PRIME) + super.hashCode()); + result = ((result * PRIME) + this.x); + return result; + } }
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/EqualsAndHashCodeWithSomeExistingMethods.java b/test/transform/resource/after-ecj/EqualsAndHashCodeWithSomeExistingMethods.java index 05f7ad97..ee846c64 100644 --- a/test/transform/resource/after-ecj/EqualsAndHashCodeWithSomeExistingMethods.java +++ b/test/transform/resource/after-ecj/EqualsAndHashCodeWithSomeExistingMethods.java @@ -14,9 +14,27 @@ import static lombok.AccessLevel.NONE; } @Data @Getter(NONE) @Setter(NONE) class EqualsAndHashCodeWithSomeExistingMethods2 { int x; - public boolean canEqual(Object other) { + protected boolean canEqual(Object other) { return false; } + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { + if ((o == this)) + return true; + if ((! (o instanceof EqualsAndHashCodeWithSomeExistingMethods2))) + return false; + final @java.lang.SuppressWarnings("all") EqualsAndHashCodeWithSomeExistingMethods2 other = (EqualsAndHashCodeWithSomeExistingMethods2) o; + if ((! other.canEqual((java.lang.Object) this))) + return false; + if ((this.x != other.x)) + return false; + return true; + } + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { + final int PRIME = 59; + int result = 1; + result = ((result * PRIME) + this.x); + return result; + } public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (("EqualsAndHashCodeWithSomeExistingMethods2(x=" + this.x) + ")"); } @@ -53,7 +71,7 @@ import static lombok.AccessLevel.NONE; return false; return true; } - public @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof EqualsAndHashCodeWithNoExistingMethods); } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { diff --git a/test/transform/resource/after-ecj/GetterLazyBoolean.java b/test/transform/resource/after-ecj/GetterLazyBoolean.java index c37eece2..cd5bac20 100644 --- a/test/transform/resource/after-ecj/GetterLazyBoolean.java +++ b/test/transform/resource/after-ecj/GetterLazyBoolean.java @@ -53,7 +53,7 @@ return false; return true; } - public @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof GetterLazyBoolean); } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { diff --git a/test/transform/resource/after-ecj/GetterLazyEahcToString.java b/test/transform/resource/after-ecj/GetterLazyEahcToString.java index da9f6a83..df26f912 100644 --- a/test/transform/resource/after-ecj/GetterLazyEahcToString.java +++ b/test/transform/resource/after-ecj/GetterLazyEahcToString.java @@ -42,7 +42,7 @@ return false; return true; } - public @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof GetterLazyEahcToString); } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { diff --git a/test/transform/resource/after-ecj/GetterSetterJavadoc.java b/test/transform/resource/after-ecj/GetterSetterJavadoc.java index b7fc15b8..9f3bb9bd 100644 --- a/test/transform/resource/after-ecj/GetterSetterJavadoc.java +++ b/test/transform/resource/after-ecj/GetterSetterJavadoc.java @@ -18,7 +18,7 @@ return false; return true; } - public @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof GetterSetterJavadoc1); } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { diff --git a/test/transform/resource/after-ecj/ValuePlain.java b/test/transform/resource/after-ecj/ValuePlain.java index 5ca32af8..8162ab93 100644 --- a/test/transform/resource/after-ecj/ValuePlain.java +++ b/test/transform/resource/after-ecj/ValuePlain.java @@ -64,7 +64,7 @@ final @lombok.Value class Value1 { return false; return true; } - public @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof Value2); } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { diff --git a/test/transform/resource/before/EqualsAndHashCodeWithExistingMethods.java b/test/transform/resource/before/EqualsAndHashCodeWithExistingMethods.java index be90d871..e21b82d9 100644 --- a/test/transform/resource/before/EqualsAndHashCodeWithExistingMethods.java +++ b/test/transform/resource/before/EqualsAndHashCodeWithExistingMethods.java @@ -20,7 +20,7 @@ final class EqualsAndHashCodeWithExistingMethods2 { final class EqualsAndHashCodeWithExistingMethods3 extends EqualsAndHashCodeWithExistingMethods { int x; - public boolean canEqual(Object other) { + private boolean canEqual(Object other) { return true; } }
\ No newline at end of file diff --git a/test/transform/resource/before/EqualsAndHashCodeWithSomeExistingMethods.java b/test/transform/resource/before/EqualsAndHashCodeWithSomeExistingMethods.java index 784e3b3f..debe75b9 100644 --- a/test/transform/resource/before/EqualsAndHashCodeWithSomeExistingMethods.java +++ b/test/transform/resource/before/EqualsAndHashCodeWithSomeExistingMethods.java @@ -18,7 +18,7 @@ class EqualsAndHashCodeWithSomeExistingMethods { class EqualsAndHashCodeWithSomeExistingMethods2 { int x; - public boolean canEqual(Object other) { + protected boolean canEqual(Object other) { return false; } } diff --git a/test/transform/resource/messages-delombok/EqualsAndHashCodeWithExistingMethods.java.messages b/test/transform/resource/messages-delombok/EqualsAndHashCodeWithExistingMethods.java.messages index b3490fd0..6f42cd7d 100644 --- a/test/transform/resource/messages-delombok/EqualsAndHashCodeWithExistingMethods.java.messages +++ b/test/transform/resource/messages-delombok/EqualsAndHashCodeWithExistingMethods.java.messages @@ -1,3 +1,2 @@ -1 Not generating equals, hashCode and canEquals: A method with one of those names already exists. (Either all or none of these methods will be generated). -10 Not generating equals and hashCode: A method with one of those names already exists. (Either all or none of these methods will be generated). -19 Not generating equals, hashCode and canEquals: A method with one of those names already exists. (Either all or none of these methods will be generated). +1 Not generating equals and hashCode: A method with one of those names already exists. (Either both or none of these methods will be generated). +10 Not generating equals and hashCode: A method with one of those names already exists. (Either both or none of these methods will be generated). diff --git a/test/transform/resource/messages-delombok/EqualsAndHashCodeWithSomeExistingMethods.java.messages b/test/transform/resource/messages-delombok/EqualsAndHashCodeWithSomeExistingMethods.java.messages index 75ddfa54..d3119bd6 100644 --- a/test/transform/resource/messages-delombok/EqualsAndHashCodeWithSomeExistingMethods.java.messages +++ b/test/transform/resource/messages-delombok/EqualsAndHashCodeWithSomeExistingMethods.java.messages @@ -1,2 +1 @@ -4 Not generating equals: One of equals, hashCode, and canEqual exists. You should either write all of these or none of these (in the latter case, lombok generates them). -15 Not generating equals and hashCode: One of equals, hashCode, and canEqual exists. You should either write all of these or none of these (in the latter case, lombok generates them). +4 Not generating equals: One of equals or hashCode exists. You should either write both of these or none of these (in the latter case, lombok generates them). diff --git a/test/transform/resource/messages-ecj/EqualsAndHashCodeWithExistingMethods.java.messages b/test/transform/resource/messages-ecj/EqualsAndHashCodeWithExistingMethods.java.messages index b3490fd0..6f42cd7d 100644 --- a/test/transform/resource/messages-ecj/EqualsAndHashCodeWithExistingMethods.java.messages +++ b/test/transform/resource/messages-ecj/EqualsAndHashCodeWithExistingMethods.java.messages @@ -1,3 +1,2 @@ -1 Not generating equals, hashCode and canEquals: A method with one of those names already exists. (Either all or none of these methods will be generated). -10 Not generating equals and hashCode: A method with one of those names already exists. (Either all or none of these methods will be generated). -19 Not generating equals, hashCode and canEquals: A method with one of those names already exists. (Either all or none of these methods will be generated). +1 Not generating equals and hashCode: A method with one of those names already exists. (Either both or none of these methods will be generated). +10 Not generating equals and hashCode: A method with one of those names already exists. (Either both or none of these methods will be generated). diff --git a/test/transform/resource/messages-ecj/EqualsAndHashCodeWithSomeExistingMethods.java.messages b/test/transform/resource/messages-ecj/EqualsAndHashCodeWithSomeExistingMethods.java.messages index 75ddfa54..d3119bd6 100644 --- a/test/transform/resource/messages-ecj/EqualsAndHashCodeWithSomeExistingMethods.java.messages +++ b/test/transform/resource/messages-ecj/EqualsAndHashCodeWithSomeExistingMethods.java.messages @@ -1,2 +1 @@ -4 Not generating equals: One of equals, hashCode, and canEqual exists. You should either write all of these or none of these (in the latter case, lombok generates them). -15 Not generating equals and hashCode: One of equals, hashCode, and canEqual exists. You should either write all of these or none of these (in the latter case, lombok generates them). +4 Not generating equals: One of equals or hashCode exists. You should either write both of these or none of these (in the latter case, lombok generates them). |