From 3400f66fa70da6664e91d98cc63d8ea959979606 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Mon, 22 Mar 2021 11:38:56 +0100 Subject: [deps] pushing ASM to 9.1, and ASM opcode compat levels to ASM9, as we need the support for records --- .../resource/after-delombok/BuilderSimpleOnRecord.java | 14 +++++++------- .../resource/after-delombok/BuilderSingularOnRecord.java | 15 +-------------- .../resource/after-delombok/ConstructorsOnRecord.java | 1 + test/transform/resource/after-delombok/DataOnRecord.java | 1 + .../after-delombok/EqualsAndHashCodeOnRecord.java | 1 + .../resource/after-delombok/FieldDefaultsOnRecord.java | 1 + .../after-delombok/FieldNameConstantsOnRecord.java | 2 +- .../transform/resource/after-delombok/GetterOnRecord.java | 1 + .../resource/after-delombok/LoggerConfigOnRecord.java | 1 + .../after-delombok/LoggerSlf4jNonStaticOnRecord.java | 1 + .../resource/after-delombok/LoggerSlf4jOnRecord.java | 2 ++ .../NonNullExistingConstructorOnRecord.java | 3 +-- .../resource/after-delombok/NonNullOnRecord.java | 3 +-- .../transform/resource/after-delombok/SetterOnRecord.java | 1 + .../resource/after-delombok/ToStringOnRecord.java | 1 + .../resource/after-delombok/UtilityClassOnRecord.java | 1 + test/transform/resource/after-delombok/ValueOnRecord.java | 1 + .../transform/resource/after-delombok/WithByOnRecord.java | 2 +- .../resource/after-delombok/WithByOnRecordComponent.java | 1 + test/transform/resource/after-delombok/WithOnRecord.java | 8 +++++++- .../resource/after-delombok/WithOnRecordComponent.java | 4 ++++ 21 files changed, 37 insertions(+), 28 deletions(-) (limited to 'test/transform/resource/after-delombok') diff --git a/test/transform/resource/after-delombok/BuilderSimpleOnRecord.java b/test/transform/resource/after-delombok/BuilderSimpleOnRecord.java index 03aca3aa..aa35cf23 100644 --- a/test/transform/resource/after-delombok/BuilderSimpleOnRecord.java +++ b/test/transform/resource/after-delombok/BuilderSimpleOnRecord.java @@ -1,5 +1,5 @@ +// version 14: import java.util.List; - record BuilderSimpleOnRecord(List l, String a) { @java.lang.SuppressWarnings("all") protected static class BuilderSimpleOnRecordBuilder { @@ -7,35 +7,35 @@ record BuilderSimpleOnRecord(List l, String a) { private List l; @java.lang.SuppressWarnings("all") private String a; - @java.lang.SuppressWarnings("all") BuilderSimpleOnRecordBuilder() { } - + /** + * @return {@code this}. + */ @java.lang.SuppressWarnings("all") public BuilderSimpleOnRecord.BuilderSimpleOnRecordBuilder l(final List l) { this.l = l; return this; } - + /** + * @return {@code this}. + */ @java.lang.SuppressWarnings("all") public BuilderSimpleOnRecord.BuilderSimpleOnRecordBuilder a(final String a) { this.a = a; return this; } - @java.lang.SuppressWarnings("all") public BuilderSimpleOnRecord build() { return new BuilderSimpleOnRecord(this.l, this.a); } - @java.lang.Override @java.lang.SuppressWarnings("all") public java.lang.String toString() { return "BuilderSimpleOnRecord.BuilderSimpleOnRecordBuilder(l=" + this.l + ", a=" + this.a + ")"; } } - @java.lang.SuppressWarnings("all") protected static BuilderSimpleOnRecord.BuilderSimpleOnRecordBuilder builder() { return new BuilderSimpleOnRecord.BuilderSimpleOnRecordBuilder(); diff --git a/test/transform/resource/after-delombok/BuilderSingularOnRecord.java b/test/transform/resource/after-delombok/BuilderSingularOnRecord.java index 32b37865..41a976cd 100644 --- a/test/transform/resource/after-delombok/BuilderSingularOnRecord.java +++ b/test/transform/resource/after-delombok/BuilderSingularOnRecord.java @@ -1,6 +1,6 @@ +// version 14: import java.util.Collection; import java.util.List; - record BuilderSingularOnRecord(List children, Collection scarves, @SuppressWarnings("all") List rawList) { @java.lang.SuppressWarnings("all") public static class BuilderSingularOnRecordBuilder { @@ -10,18 +10,15 @@ record BuilderSingularOnRecord(List children, Collection private java.util.ArrayList scarves; @java.lang.SuppressWarnings("all") private java.util.ArrayList rawList; - @java.lang.SuppressWarnings("all") BuilderSingularOnRecordBuilder() { } - @java.lang.SuppressWarnings("all") public BuilderSingularOnRecord.BuilderSingularOnRecordBuilder child(final T child) { if (this.children == null) this.children = new java.util.ArrayList(); this.children.add(child); return this; } - @java.lang.SuppressWarnings("all") public BuilderSingularOnRecord.BuilderSingularOnRecordBuilder children(final java.util.Collection children) { if (children == null) { @@ -31,20 +28,17 @@ record BuilderSingularOnRecord(List children, Collection this.children.addAll(children); return this; } - @java.lang.SuppressWarnings("all") public BuilderSingularOnRecord.BuilderSingularOnRecordBuilder clearChildren() { if (this.children != null) this.children.clear(); return this; } - @java.lang.SuppressWarnings("all") public BuilderSingularOnRecord.BuilderSingularOnRecordBuilder scarf(final Number scarf) { if (this.scarves == null) this.scarves = new java.util.ArrayList(); this.scarves.add(scarf); return this; } - @java.lang.SuppressWarnings("all") public BuilderSingularOnRecord.BuilderSingularOnRecordBuilder scarves(final java.util.Collection scarves) { if (scarves == null) { @@ -54,20 +48,17 @@ record BuilderSingularOnRecord(List children, Collection this.scarves.addAll(scarves); return this; } - @java.lang.SuppressWarnings("all") public BuilderSingularOnRecord.BuilderSingularOnRecordBuilder clearScarves() { if (this.scarves != null) this.scarves.clear(); return this; } - @java.lang.SuppressWarnings("all") public BuilderSingularOnRecord.BuilderSingularOnRecordBuilder rawList(final java.lang.Object rawList) { if (this.rawList == null) this.rawList = new java.util.ArrayList(); this.rawList.add(rawList); return this; } - @java.lang.SuppressWarnings("all") public BuilderSingularOnRecord.BuilderSingularOnRecordBuilder rawList(final java.util.Collection rawList) { if (rawList == null) { @@ -77,13 +68,11 @@ record BuilderSingularOnRecord(List children, Collection this.rawList.addAll(rawList); return this; } - @java.lang.SuppressWarnings("all") public BuilderSingularOnRecord.BuilderSingularOnRecordBuilder clearRawList() { if (this.rawList != null) this.rawList.clear(); return this; } - @java.lang.SuppressWarnings("all") public BuilderSingularOnRecord build() { java.util.List children; @@ -121,14 +110,12 @@ record BuilderSingularOnRecord(List children, Collection } return new BuilderSingularOnRecord(children, scarves, rawList); } - @java.lang.Override @java.lang.SuppressWarnings("all") public java.lang.String toString() { return "BuilderSingularOnRecord.BuilderSingularOnRecordBuilder(children=" + this.children + ", scarves=" + this.scarves + ", rawList=" + this.rawList + ")"; } } - @java.lang.SuppressWarnings("all") public static BuilderSingularOnRecord.BuilderSingularOnRecordBuilder builder() { return new BuilderSingularOnRecord.BuilderSingularOnRecordBuilder(); diff --git a/test/transform/resource/after-delombok/ConstructorsOnRecord.java b/test/transform/resource/after-delombok/ConstructorsOnRecord.java index 8cef8809..3d091bd5 100644 --- a/test/transform/resource/after-delombok/ConstructorsOnRecord.java +++ b/test/transform/resource/after-delombok/ConstructorsOnRecord.java @@ -1,2 +1,3 @@ +// version 14: record ConstructorsOnRecord(String a, String b) { } diff --git a/test/transform/resource/after-delombok/DataOnRecord.java b/test/transform/resource/after-delombok/DataOnRecord.java index b4384dce..7fde94f9 100644 --- a/test/transform/resource/after-delombok/DataOnRecord.java +++ b/test/transform/resource/after-delombok/DataOnRecord.java @@ -1,2 +1,3 @@ +// version 14: record DataOnRecord(String a, String b) { } diff --git a/test/transform/resource/after-delombok/EqualsAndHashCodeOnRecord.java b/test/transform/resource/after-delombok/EqualsAndHashCodeOnRecord.java index 949cdec6..93213d80 100644 --- a/test/transform/resource/after-delombok/EqualsAndHashCodeOnRecord.java +++ b/test/transform/resource/after-delombok/EqualsAndHashCodeOnRecord.java @@ -1,2 +1,3 @@ +// version 14: record EqualsAndHashCodeOnRecord(String a, String b) { } diff --git a/test/transform/resource/after-delombok/FieldDefaultsOnRecord.java b/test/transform/resource/after-delombok/FieldDefaultsOnRecord.java index 1287dcb0..a7b37d9f 100644 --- a/test/transform/resource/after-delombok/FieldDefaultsOnRecord.java +++ b/test/transform/resource/after-delombok/FieldDefaultsOnRecord.java @@ -1,2 +1,3 @@ +// version 14: record FieldDefaultsOnRecord(String a, String b) { } diff --git a/test/transform/resource/after-delombok/FieldNameConstantsOnRecord.java b/test/transform/resource/after-delombok/FieldNameConstantsOnRecord.java index 2e3339fa..8f29cc96 100644 --- a/test/transform/resource/after-delombok/FieldNameConstantsOnRecord.java +++ b/test/transform/resource/after-delombok/FieldNameConstantsOnRecord.java @@ -1,6 +1,6 @@ +// version 14: record FieldNameConstantsOnRecord(String iAmADvdPlayer, int $skipMe, int andMe, String butPrintMePlease) { static double skipMeToo; - @java.lang.SuppressWarnings("all") static final class Fields { public static final java.lang.String iAmADvdPlayer = "iAmADvdPlayer"; diff --git a/test/transform/resource/after-delombok/GetterOnRecord.java b/test/transform/resource/after-delombok/GetterOnRecord.java index 5090e92d..5b7c5058 100644 --- a/test/transform/resource/after-delombok/GetterOnRecord.java +++ b/test/transform/resource/after-delombok/GetterOnRecord.java @@ -1,2 +1,3 @@ +// version 14: record GetterOnRecord(String a, String b) { } diff --git a/test/transform/resource/after-delombok/LoggerConfigOnRecord.java b/test/transform/resource/after-delombok/LoggerConfigOnRecord.java index 5b43f24e..2ef0bffd 100644 --- a/test/transform/resource/after-delombok/LoggerConfigOnRecord.java +++ b/test/transform/resource/after-delombok/LoggerConfigOnRecord.java @@ -1,2 +1,3 @@ +// version 14: record LoggerConfigOnRecord(String a, String b) { } diff --git a/test/transform/resource/after-delombok/LoggerSlf4jNonStaticOnRecord.java b/test/transform/resource/after-delombok/LoggerSlf4jNonStaticOnRecord.java index e59ed6d3..801c9990 100644 --- a/test/transform/resource/after-delombok/LoggerSlf4jNonStaticOnRecord.java +++ b/test/transform/resource/after-delombok/LoggerSlf4jNonStaticOnRecord.java @@ -1,3 +1,4 @@ +// version 14: record LoggerSlf4jOnRecord(String a, String b) { private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(LoggerSlf4jOnRecord.class); } diff --git a/test/transform/resource/after-delombok/LoggerSlf4jOnRecord.java b/test/transform/resource/after-delombok/LoggerSlf4jOnRecord.java index e59ed6d3..caa2ce2c 100644 --- a/test/transform/resource/after-delombok/LoggerSlf4jOnRecord.java +++ b/test/transform/resource/after-delombok/LoggerSlf4jOnRecord.java @@ -1,3 +1,5 @@ +// version 16: the SuppressWarnings is not emitted in java14/15 to work around a javac bug. record LoggerSlf4jOnRecord(String a, String b) { + @java.lang.SuppressWarnings("all") private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(LoggerSlf4jOnRecord.class); } diff --git a/test/transform/resource/after-delombok/NonNullExistingConstructorOnRecord.java b/test/transform/resource/after-delombok/NonNullExistingConstructorOnRecord.java index de2757ee..02b66dd1 100644 --- a/test/transform/resource/after-delombok/NonNullExistingConstructorOnRecord.java +++ b/test/transform/resource/after-delombok/NonNullExistingConstructorOnRecord.java @@ -1,5 +1,5 @@ +// version 14: import lombok.NonNull; - record NonNullOnRecord(@NonNull String a, @NonNull String b) { public NonNullOnRecord(@NonNull String b) { this("default", b); @@ -7,7 +7,6 @@ record NonNullOnRecord(@NonNull String a, @NonNull String b) { throw new java.lang.NullPointerException("b is marked non-null but is null"); } } - @java.lang.SuppressWarnings("all") public NonNullOnRecord(@NonNull final String a, @NonNull final String b) { if (a == null) { diff --git a/test/transform/resource/after-delombok/NonNullOnRecord.java b/test/transform/resource/after-delombok/NonNullOnRecord.java index 7147f49c..2ff4a8f7 100644 --- a/test/transform/resource/after-delombok/NonNullOnRecord.java +++ b/test/transform/resource/after-delombok/NonNullOnRecord.java @@ -1,5 +1,5 @@ +// version 14: import lombok.NonNull; - record NonNullOnRecord(@NonNull String a, @NonNull String b) { public void method(@NonNull String param) { if (param == null) { @@ -7,7 +7,6 @@ record NonNullOnRecord(@NonNull String a, @NonNull String b) { } String asd = "a"; } - @java.lang.SuppressWarnings("all") public NonNullOnRecord(@NonNull final String a, @NonNull final String b) { if (a == null) { diff --git a/test/transform/resource/after-delombok/SetterOnRecord.java b/test/transform/resource/after-delombok/SetterOnRecord.java index 39a911ca..31665588 100644 --- a/test/transform/resource/after-delombok/SetterOnRecord.java +++ b/test/transform/resource/after-delombok/SetterOnRecord.java @@ -1,2 +1,3 @@ +// version 14: record SetterOnRecord(String a, String b) { } diff --git a/test/transform/resource/after-delombok/ToStringOnRecord.java b/test/transform/resource/after-delombok/ToStringOnRecord.java index 84db33be..f18508d7 100644 --- a/test/transform/resource/after-delombok/ToStringOnRecord.java +++ b/test/transform/resource/after-delombok/ToStringOnRecord.java @@ -1,2 +1,3 @@ +// version 14: record ToStringOnRecord(String a, String b) { } diff --git a/test/transform/resource/after-delombok/UtilityClassOnRecord.java b/test/transform/resource/after-delombok/UtilityClassOnRecord.java index fbe27370..c6ee509a 100644 --- a/test/transform/resource/after-delombok/UtilityClassOnRecord.java +++ b/test/transform/resource/after-delombok/UtilityClassOnRecord.java @@ -1,2 +1,3 @@ +// version 14: record UtilityClassOnRecord(String a, String b) { } diff --git a/test/transform/resource/after-delombok/ValueOnRecord.java b/test/transform/resource/after-delombok/ValueOnRecord.java index d3d0e6db..4f845c20 100644 --- a/test/transform/resource/after-delombok/ValueOnRecord.java +++ b/test/transform/resource/after-delombok/ValueOnRecord.java @@ -1,2 +1,3 @@ +// version 14: record ValueOnRecord(String a, String b) { } diff --git a/test/transform/resource/after-delombok/WithByOnRecord.java b/test/transform/resource/after-delombok/WithByOnRecord.java index d6a24a9a..6df5c9c4 100644 --- a/test/transform/resource/after-delombok/WithByOnRecord.java +++ b/test/transform/resource/after-delombok/WithByOnRecord.java @@ -1,9 +1,9 @@ +// version 14: record WithByOnRecord(String a, String b) { @java.lang.SuppressWarnings("all") public WithByOnRecord withABy(final java.util.function.Function transformer) { return new WithByOnRecord(transformer.apply(this.a), this.b); } - @java.lang.SuppressWarnings("all") public WithByOnRecord withBBy(final java.util.function.Function transformer) { return new WithByOnRecord(this.a, transformer.apply(this.b)); diff --git a/test/transform/resource/after-delombok/WithByOnRecordComponent.java b/test/transform/resource/after-delombok/WithByOnRecordComponent.java index 5af50625..91dd7b38 100644 --- a/test/transform/resource/after-delombok/WithByOnRecordComponent.java +++ b/test/transform/resource/after-delombok/WithByOnRecordComponent.java @@ -1,3 +1,4 @@ +// version 14: record WithByOnRecordComponent(String a, String b) { @java.lang.SuppressWarnings("all") public WithByOnRecordComponent withABy(final java.util.function.Function transformer) { diff --git a/test/transform/resource/after-delombok/WithOnRecord.java b/test/transform/resource/after-delombok/WithOnRecord.java index bfb123bc..e981cc20 100644 --- a/test/transform/resource/after-delombok/WithOnRecord.java +++ b/test/transform/resource/after-delombok/WithOnRecord.java @@ -1,9 +1,15 @@ +// version 14: record WithOnRecord(String a, String b) { + /** + * @return a clone of this object, except with this updated property (returns {@code this} if an identical value is passed). + */ @java.lang.SuppressWarnings("all") public WithOnRecord withA(final String a) { return this.a == a ? this : new WithOnRecord(a, this.b); } - + /** + * @return a clone of this object, except with this updated property (returns {@code this} if an identical value is passed). + */ @java.lang.SuppressWarnings("all") public WithOnRecord withB(final String b) { return this.b == b ? this : new WithOnRecord(this.a, b); diff --git a/test/transform/resource/after-delombok/WithOnRecordComponent.java b/test/transform/resource/after-delombok/WithOnRecordComponent.java index a5f4ec36..5bc72f34 100644 --- a/test/transform/resource/after-delombok/WithOnRecordComponent.java +++ b/test/transform/resource/after-delombok/WithOnRecordComponent.java @@ -1,4 +1,8 @@ +// version 14: record WithOnRecordComponent(String a, String b) { + /** + * @return a clone of this object, except with this updated property (returns {@code this} if an identical value is passed). + */ @java.lang.SuppressWarnings("all") public WithOnRecordComponent withA(final String a) { return this.a == a ? this : new WithOnRecordComponent(a, this.b); -- cgit