diff options
author | Roel Spilker <r.spilker@gmail.com> | 2014-03-26 21:11:30 +0100 |
---|---|---|
committer | Roel Spilker <r.spilker@gmail.com> | 2014-03-26 21:11:30 +0100 |
commit | 4d24542dac058fcd7c341f9d17c4e8170a8d83a2 (patch) | |
tree | 945083ad989cb2abfb84f02ed88bc8b21ef87827 /test/transform/resource/after-delombok | |
parent | db71f39c271f1f8124fac96daa68d8b012fbf390 (diff) | |
download | lombok-4d24542dac058fcd7c341f9d17c4e8170a8d83a2.tar.gz lombok-4d24542dac058fcd7c341f9d17c4e8170a8d83a2.tar.bz2 lombok-4d24542dac058fcd7c341f9d17c4e8170a8d83a2.zip |
[i660] canEqual is now protected instead of public.
Also fixed the total lack of canEqual in the usage examples.
Diffstat (limited to 'test/transform/resource/after-delombok')
15 files changed, 61 insertions, 23 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 |