mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-13 14:16:11 +00:00
add tests to ensure onlyExplicitlyIncluded means nothing if no fields are annotated. Fixes #1772
This commit is contained in:
1 parent
7ee4ebb1a5
commit
89294fe03c
6 files changed
+70
No files matched your search
@@ -0,0 +1,23 @@
|
||||
@lombok.EqualsAndHashCode(onlyExplicitlyIncluded = true) class EqualsAndHashCodeExplicitInclude {
|
||||
int x;
|
||||
EqualsAndHashCodeExplicitInclude() {
|
||||
super();
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) {
|
||||
if ((o == this))
|
||||
return true;
|
||||
if ((! (o instanceof EqualsAndHashCodeExplicitInclude)))
|
||||
return false;
|
||||
final EqualsAndHashCodeExplicitInclude other = (EqualsAndHashCodeExplicitInclude) o;
|
||||
if ((! other.canEqual((java.lang.Object) this)))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) {
|
||||
return (other instanceof EqualsAndHashCodeExplicitInclude);
|
||||
}
|
||||
public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() {
|
||||
int result = 1;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user