From cc98adac012d0d18c70628eb5e6f1646ce574e8a Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Tue, 23 Mar 2021 05:08:19 +0100 Subject: [records] [javac] Putting `@NonNull` on a 'field' of a record now affects the compact constructors, generating one if need be. --- test/transform/resource/before/NonNullOnRecord.java | 3 --- test/transform/resource/before/NonNullOnRecord2.java | 9 +++++++++ test/transform/resource/before/NonNullOnRecord3.java | 13 +++++++++++++ 3 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 test/transform/resource/before/NonNullOnRecord2.java create mode 100644 test/transform/resource/before/NonNullOnRecord3.java (limited to 'test/transform/resource/before') 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 -- cgit