[fixes #788] lombok generated equals method plus a non-null-by-default annotation no longer clash.

This commit is contained in:
Reinier Zwitserloot committed 2020-01-08 01:06:35 +01:00
1 parent 0b0656ae3c
commit 9ad2bd563b
13 files changed
+160 -6

No files matched your search

@@ -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;
}
}
}
@@ -0,0 +1,28 @@
import javax.annotation.ParametersAreNonnullByDefault;
@ParametersAreNonnullByDefault class EqualsAndHashCodeWithNNBD {
static @lombok.EqualsAndHashCode @org.eclipse.jdt.annotation.NonNullByDefault class Inner {
Inner() {
super();
}
public @java.lang.Override @java.lang.SuppressWarnings("all") 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;
}
protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) {
return (other instanceof EqualsAndHashCodeWithNNBD.Inner);
}
public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() {
final int result = 1;
return result;
}
}
EqualsAndHashCodeWithNNBD() {
super();
}
}
@@ -0,0 +1,8 @@
// version 8:
import javax.annotation.ParametersAreNonnullByDefault;
@ParametersAreNonnullByDefault
class EqualsAndHashCodeWithNNBD {
@lombok.EqualsAndHashCode @org.eclipse.jdt.annotation.NonNullByDefault
static class Inner {
}
}
@@ -0,0 +1 @@
5 package org.eclipse.jdt.annotation does not exist
@@ -0,0 +1 @@
2 The import javax.annotation.ParametersAreNonnullByDefault cannot be resolved
@@ -0,0 +1,3 @@
6 package org.eclipse.jdt.annotation does not exist
10 package org.eclipse.jdt.annotation does not exist
10 annotation @javax.annotation.Nullable not applicable in this type context