diff options
author | Reinier Zwitserloot <r.zwitserloot@projectlombok.org> | 2022-03-01 18:05:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-01 18:05:38 +0100 |
commit | 8c3ff7e9b08c4bf9c2b23cffb6042c31258e3ebb (patch) | |
tree | 56747d50cda77d9e96da9babfbd4cd1544766491 /test | |
parent | 560ded50127b12bd8168f8ae2bada47253f15bc8 (diff) | |
parent | c67909e2039cdac449808464ff28a8e71a56b7a1 (diff) | |
download | lombok-8c3ff7e9b08c4bf9c2b23cffb6042c31258e3ebb.tar.gz lombok-8c3ff7e9b08c4bf9c2b23cffb6042c31258e3ebb.tar.bz2 lombok-8c3ff7e9b08c4bf9c2b23cffb6042c31258e3ebb.zip |
Merge pull request #3121 from JohnPaulTaylorII/master
Fixes #3120
Diffstat (limited to 'test')
3 files changed, 52 insertions, 0 deletions
diff --git a/test/transform/resource/after-delombok/EqualsAndHashCodeWithNonNullByDefault.java b/test/transform/resource/after-delombok/EqualsAndHashCodeWithNonNullByDefault.java new file mode 100644 index 00000000..37711004 --- /dev/null +++ b/test/transform/resource/after-delombok/EqualsAndHashCodeWithNonNullByDefault.java @@ -0,0 +1,23 @@ +import javax.annotation.ParametersAreNonnullByDefault; +@ParametersAreNonnullByDefault +class EqualsAndHashCodeWithNonNullByDefault { + @java.lang.Override + @java.lang.SuppressWarnings("all") + public boolean equals(@javax.annotation.Nullable final java.lang.Object o) { + if (o == this) return true; + if (!(o instanceof EqualsAndHashCodeWithNonNullByDefault)) return false; + final EqualsAndHashCodeWithNonNullByDefault other = (EqualsAndHashCodeWithNonNullByDefault) o; + if (!other.canEqual((java.lang.Object) this)) return false; + return true; + } + @java.lang.SuppressWarnings("all") + protected boolean canEqual(@javax.annotation.Nullable final java.lang.Object other) { + return other instanceof EqualsAndHashCodeWithNonNullByDefault; + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public int hashCode() { + final int result = 1; + return result; + } +} diff --git a/test/transform/resource/after-ecj/EqualsAndHashCodeWithNonNullByDefault.java b/test/transform/resource/after-ecj/EqualsAndHashCodeWithNonNullByDefault.java new file mode 100644 index 00000000..0cd170b4 --- /dev/null +++ b/test/transform/resource/after-ecj/EqualsAndHashCodeWithNonNullByDefault.java @@ -0,0 +1,23 @@ +import javax.annotation.ParametersAreNonnullByDefault; +@lombok.EqualsAndHashCode @ParametersAreNonnullByDefault class EqualsAndHashCodeWithNonNullByDefault { + EqualsAndHashCodeWithNonNullByDefault() { + super(); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final @javax.annotation.Nullable java.lang.Object o) { + if ((o == this)) + return true; + if ((! (o instanceof EqualsAndHashCodeWithNonNullByDefault))) + return false; + final EqualsAndHashCodeWithNonNullByDefault other = (EqualsAndHashCodeWithNonNullByDefault) o; + if ((! other.canEqual((java.lang.Object) this))) + return false; + return true; + } + protected @java.lang.SuppressWarnings("all") boolean canEqual(final @javax.annotation.Nullable java.lang.Object other) { + return (other instanceof EqualsAndHashCodeWithNonNullByDefault); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { + final int result = 1; + return result; + } +}
\ No newline at end of file diff --git a/test/transform/resource/before/EqualsAndHashCodeWithNonNullByDefault.java b/test/transform/resource/before/EqualsAndHashCodeWithNonNullByDefault.java new file mode 100644 index 00000000..f91bce3c --- /dev/null +++ b/test/transform/resource/before/EqualsAndHashCodeWithNonNullByDefault.java @@ -0,0 +1,6 @@ +//CONF: lombok.addNullAnnotations = javax +import javax.annotation.ParametersAreNonnullByDefault; +@lombok.EqualsAndHashCode +@ParametersAreNonnullByDefault +class EqualsAndHashCodeWithNonNullByDefault { +}
\ No newline at end of file |