aboutsummaryrefslogtreecommitdiff
path: root/test/transform/resource/after-delombok/EqualsAndHashCodeWithNNBD.java
diff options
context:
space:
mode:
authorReinier Zwitserloot <r.zwitserloot@projectlombok.org>2020-01-08 01:06:35 +0100
committerReinier Zwitserloot <r.zwitserloot@projectlombok.org>2020-01-08 01:06:35 +0100
commit9ad2bd563b001c0742d767fea9ddaaeb60400ec7 (patch)
tree82d9653d555b46b1a42f7c8086e87bd6aefd16a8 /test/transform/resource/after-delombok/EqualsAndHashCodeWithNNBD.java
parent0b0656ae3c38ae915c86e17c2744d5e3d8fc805c (diff)
downloadlombok-9ad2bd563b001c0742d767fea9ddaaeb60400ec7.tar.gz
lombok-9ad2bd563b001c0742d767fea9ddaaeb60400ec7.tar.bz2
lombok-9ad2bd563b001c0742d767fea9ddaaeb60400ec7.zip
[fixes #788] lombok generated equals method plus a non-null-by-default annotation no longer clash.
Diffstat (limited to 'test/transform/resource/after-delombok/EqualsAndHashCodeWithNNBD.java')
-rw-r--r--test/transform/resource/after-delombok/EqualsAndHashCodeWithNNBD.java30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/transform/resource/after-delombok/EqualsAndHashCodeWithNNBD.java b/test/transform/resource/after-delombok/EqualsAndHashCodeWithNNBD.java
new file mode 100644
index 00000000..6eaf9f36
--- /dev/null
+++ b/test/transform/resource/after-delombok/EqualsAndHashCodeWithNNBD.java
@@ -0,0 +1,30 @@
+import javax.annotation.ParametersAreNonnullByDefault;
+
+@ParametersAreNonnullByDefault
+class EqualsAndHashCodeWithNNBD {
+
+ @org.eclipse.jdt.annotation.NonNullByDefault
+ static class Inner {
+ @java.lang.Override
+ @java.lang.SuppressWarnings("all")
+ public boolean equals(final java.lang.@javax.annotation.Nullable @org.eclipse.jdt.annotation.Nullable Object o) {
+ if (o == this) return true;
+ if (!(o instanceof EqualsAndHashCodeWithNNBD.Inner)) return false;
+ final EqualsAndHashCodeWithNNBD.Inner other = (EqualsAndHashCodeWithNNBD.Inner) o;
+ if (!other.canEqual((java.lang.Object) this)) return false;
+ return true;
+ }
+
+ @java.lang.SuppressWarnings("all")
+ protected boolean canEqual(final java.lang.Object other) {
+ return other instanceof EqualsAndHashCodeWithNNBD.Inner;
+ }
+
+ @java.lang.Override
+ @java.lang.SuppressWarnings("all")
+ public int hashCode() {
+ final int result = 1;
+ return result;
+ }
+ }
+} \ No newline at end of file