aboutsummaryrefslogtreecommitdiff
path: root/test/transform/resource/after-delombok
diff options
context:
space:
mode:
Diffstat (limited to 'test/transform/resource/after-delombok')
-rw-r--r--test/transform/resource/after-delombok/NonNullOnRecordExistingConstructor.java (renamed from test/transform/resource/after-delombok/NonNullOnRecord2.java)4
-rw-r--r--test/transform/resource/after-delombok/NonNullOnRecordExistingSetter.java (renamed from test/transform/resource/after-delombok/NonNullOnRecord3.java)4
-rw-r--r--test/transform/resource/after-delombok/NonNullOnRecordSimple.java (renamed from test/transform/resource/after-delombok/NonNullOnRecord.java)4
-rw-r--r--test/transform/resource/after-delombok/NonNullOnRecordTypeUse.java13
-rw-r--r--test/transform/resource/after-delombok/NullLibrary3.java59
5 files changed, 78 insertions, 6 deletions
diff --git a/test/transform/resource/after-delombok/NonNullOnRecord2.java b/test/transform/resource/after-delombok/NonNullOnRecordExistingConstructor.java
index d3021350..e3fdc2fc 100644
--- a/test/transform/resource/after-delombok/NonNullOnRecord2.java
+++ b/test/transform/resource/after-delombok/NonNullOnRecordExistingConstructor.java
@@ -1,7 +1,7 @@
// version 16:
import lombok.NonNull;
-record NonNullOnRecord2(@NonNull String a) {
- public NonNullOnRecord2 {
+public record NonNullOnRecordExistingConstructor(@NonNull String a) {
+ public NonNullOnRecordExistingConstructor {
if (a == null) {
throw new java.lang.NullPointerException("a is marked non-null but is null");
}
diff --git a/test/transform/resource/after-delombok/NonNullOnRecord3.java b/test/transform/resource/after-delombok/NonNullOnRecordExistingSetter.java
index 62b385bc..11aaca49 100644
--- a/test/transform/resource/after-delombok/NonNullOnRecord3.java
+++ b/test/transform/resource/after-delombok/NonNullOnRecordExistingSetter.java
@@ -1,7 +1,7 @@
// version 14:
import lombok.NonNull;
-public record NonNullOnRecord3(@NonNull String a) {
- public NonNullOnRecord3(String a) {
+public record NonNullOnRecordExistingSetter(@NonNull String a) {
+ public NonNullOnRecordExistingSetter(String a) {
this.a = a;
}
public void method(@NonNull String param) {
diff --git a/test/transform/resource/after-delombok/NonNullOnRecord.java b/test/transform/resource/after-delombok/NonNullOnRecordSimple.java
index 465c30db..2a772c93 100644
--- a/test/transform/resource/after-delombok/NonNullOnRecord.java
+++ b/test/transform/resource/after-delombok/NonNullOnRecordSimple.java
@@ -1,8 +1,8 @@
// version 16:
import lombok.NonNull;
-public record NonNullOnRecord(@NonNull String a, @NonNull String b) {
+public record NonNullOnRecordSimple(@NonNull String a, @NonNull String b) {
@java.lang.SuppressWarnings("all")
- public NonNullOnRecord {
+ public NonNullOnRecordSimple {
if (a == null) {
throw new java.lang.NullPointerException("a is marked non-null but is null");
}
diff --git a/test/transform/resource/after-delombok/NonNullOnRecordTypeUse.java b/test/transform/resource/after-delombok/NonNullOnRecordTypeUse.java
new file mode 100644
index 00000000..e5b78f1c
--- /dev/null
+++ b/test/transform/resource/after-delombok/NonNullOnRecordTypeUse.java
@@ -0,0 +1,13 @@
+// version 16:
+import lombok.NonNull;
+public record NonNullOnRecordTypeUse(@NonNull int[] a, int @NonNull [] b, int[] @NonNull [] c) {
+ @java.lang.SuppressWarnings("all")
+ public NonNullOnRecordTypeUse {
+ if (a == null) {
+ throw new java.lang.NullPointerException("a is marked non-null but is null");
+ }
+ if (b == null) {
+ throw new java.lang.NullPointerException("b is marked non-null but is null");
+ }
+ }
+}
diff --git a/test/transform/resource/after-delombok/NullLibrary3.java b/test/transform/resource/after-delombok/NullLibrary3.java
new file mode 100644
index 00000000..ee7c5296
--- /dev/null
+++ b/test/transform/resource/after-delombok/NullLibrary3.java
@@ -0,0 +1,59 @@
+public class NullLibrary3 {
+ @jakarta.annotation.Nonnull
+ String foo;
+
+ @java.lang.Override
+ @java.lang.SuppressWarnings("all")
+ public boolean equals(@jakarta.annotation.Nullable final java.lang.Object o) {
+ if (o == this) return true;
+ if (!(o instanceof NullLibrary3)) return false;
+ final NullLibrary3 other = (NullLibrary3) o;
+ if (!other.canEqual((java.lang.Object) this)) return false;
+ final java.lang.Object this$foo = this.foo;
+ final java.lang.Object other$foo = other.foo;
+ if (this$foo == null ? other$foo != null : !this$foo.equals(other$foo)) return false;
+ return true;
+ }
+
+ @java.lang.SuppressWarnings("all")
+ protected boolean canEqual(@jakarta.annotation.Nullable final java.lang.Object other) {
+ return other instanceof NullLibrary3;
+ }
+
+ @java.lang.Override
+ @java.lang.SuppressWarnings("all")
+ public int hashCode() {
+ final int PRIME = 59;
+ int result = 1;
+ final java.lang.Object $foo = this.foo;
+ result = result * PRIME + ($foo == null ? 43 : $foo.hashCode());
+ return result;
+ }
+
+ @jakarta.annotation.Nonnull
+ @java.lang.Override
+ @java.lang.SuppressWarnings("all")
+ public java.lang.String toString() {
+ return "NullLibrary3(foo=" + this.foo + ")";
+ }
+
+ @java.lang.SuppressWarnings("all")
+ public NullLibrary3(@jakarta.annotation.Nonnull final String foo) {
+ if (foo == null) {
+ throw new java.lang.NullPointerException("foo is marked non-null but is null");
+ }
+ this.foo = foo;
+ }
+
+ /**
+ * @return a clone of this object, except with this updated property (returns {@code this} if an identical value is passed).
+ */
+ @jakarta.annotation.Nonnull
+ @java.lang.SuppressWarnings("all")
+ public NullLibrary3 withFoo(@jakarta.annotation.Nonnull final String foo) {
+ if (foo == null) {
+ throw new java.lang.NullPointerException("foo is marked non-null but is null");
+ }
+ return this.foo == foo ? this : new NullLibrary3(foo);
+ }
+} \ No newline at end of file