diff options
Diffstat (limited to 'test/transform')
7 files changed, 47 insertions, 15 deletions
diff --git a/test/transform/resource/after-delombok/NonNullExistingConstructorOnRecord.java b/test/transform/resource/after-delombok/NonNullExistingConstructorOnRecord.java index 02b66dd1..15e0aa66 100644 --- a/test/transform/resource/after-delombok/NonNullExistingConstructorOnRecord.java +++ b/test/transform/resource/after-delombok/NonNullExistingConstructorOnRecord.java @@ -8,14 +8,12 @@ record NonNullOnRecord(@NonNull String a, @NonNull String b) { } } @java.lang.SuppressWarnings("all") - public NonNullOnRecord(@NonNull final String a, @NonNull final String b) { + public NonNullOnRecord { 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"); } - this.a = a; - this.b = b; } } diff --git a/test/transform/resource/after-delombok/NonNullOnRecord.java b/test/transform/resource/after-delombok/NonNullOnRecord.java index 2ff4a8f7..7acfab36 100644 --- a/test/transform/resource/after-delombok/NonNullOnRecord.java +++ b/test/transform/resource/after-delombok/NonNullOnRecord.java @@ -1,21 +1,13 @@ // version 14: import lombok.NonNull; record NonNullOnRecord(@NonNull String a, @NonNull String b) { - public void method(@NonNull String param) { - if (param == null) { - throw new java.lang.NullPointerException("param is marked non-null but is null"); - } - String asd = "a"; - } @java.lang.SuppressWarnings("all") - public NonNullOnRecord(@NonNull final String a, @NonNull final String b) { + public NonNullOnRecord { 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"); } - this.a = a; - this.b = b; } } diff --git a/test/transform/resource/after-delombok/NonNullOnRecord2.java b/test/transform/resource/after-delombok/NonNullOnRecord2.java new file mode 100644 index 00000000..a166190c --- /dev/null +++ b/test/transform/resource/after-delombok/NonNullOnRecord2.java @@ -0,0 +1,10 @@ +// version 14: +import lombok.NonNull; +record NonNullOnRecord2(@NonNull String a) { + public NonNullOnRecord2 { + if (a == null) { + throw new java.lang.NullPointerException("a is marked non-null but is null"); + } + System.out.println("Hello"); + } +} diff --git a/test/transform/resource/after-delombok/NonNullOnRecord3.java b/test/transform/resource/after-delombok/NonNullOnRecord3.java new file mode 100644 index 00000000..b1ecf6c0 --- /dev/null +++ b/test/transform/resource/after-delombok/NonNullOnRecord3.java @@ -0,0 +1,13 @@ +// version 14: +import lombok.NonNull; +record NonNullOnRecord3(@NonNull String a) { + public NonNullOnRecord3(String a) { + this.a = a; + } + public void method(@NonNull String param) { + if (param == null) { + throw new java.lang.NullPointerException("param is marked non-null but is null"); + } + String asd = "a"; + } +} diff --git a/test/transform/resource/before/NonNullOnRecord.java b/test/transform/resource/before/NonNullOnRecord.java index 223f8cbb..56a96433 100644 --- a/test/transform/resource/before/NonNullOnRecord.java +++ b/test/transform/resource/before/NonNullOnRecord.java @@ -3,7 +3,4 @@ import lombok.NonNull; record NonNullOnRecord(@NonNull String a, @NonNull String b) { - public void method(@NonNull String param) { - String asd = "a"; - } }
\ No newline at end of file diff --git a/test/transform/resource/before/NonNullOnRecord2.java b/test/transform/resource/before/NonNullOnRecord2.java new file mode 100644 index 00000000..3a4eacd4 --- /dev/null +++ b/test/transform/resource/before/NonNullOnRecord2.java @@ -0,0 +1,9 @@ +// version 14: + +import lombok.NonNull; + +record NonNullOnRecord2(@NonNull String a) { + public NonNullOnRecord2 { + System.out.println("Hello"); + } +}
\ No newline at end of file diff --git a/test/transform/resource/before/NonNullOnRecord3.java b/test/transform/resource/before/NonNullOnRecord3.java new file mode 100644 index 00000000..88870192 --- /dev/null +++ b/test/transform/resource/before/NonNullOnRecord3.java @@ -0,0 +1,13 @@ +// version 14: + +import lombok.NonNull; + +record NonNullOnRecord3(@NonNull String a) { + public NonNullOnRecord3(String a) { + this.a = a; + } + + public void method(@NonNull String param) { + String asd = "a"; + } +}
\ No newline at end of file |