mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-16 08:15:19 +00:00
[i660] canEqual is now protected instead of public.
Also fixed the total lack of canEqual in the usage examples.
This commit is contained in:
1 parent
db71f39c27
commit
4d24542dac
42 files changed
+160
-81
No files matched your search
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user