diff options
Diffstat (limited to 'test/transform/resource/after-delombok/EqualsAndHashCodeWithSomeExistingMethods.java')
-rw-r--r-- | test/transform/resource/after-delombok/EqualsAndHashCodeWithSomeExistingMethods.java | 22 |
1 files changed, 20 insertions, 2 deletions
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 |