From 7993aa20cd20cdc030f90ee9f33c1b74c023d7ca Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Sat, 15 Feb 2020 07:14:03 +0100 Subject: [issue #2368] [withBy] support for ecj --- .../resource/after-ecj/WithByNullAnnos.java | 11 +++++ test/transform/resource/after-ecj/WithByTypes.java | 53 ++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 test/transform/resource/after-ecj/WithByNullAnnos.java create mode 100644 test/transform/resource/after-ecj/WithByTypes.java (limited to 'test') diff --git a/test/transform/resource/after-ecj/WithByNullAnnos.java b/test/transform/resource/after-ecj/WithByNullAnnos.java new file mode 100644 index 00000000..ff140192 --- /dev/null +++ b/test/transform/resource/after-ecj/WithByNullAnnos.java @@ -0,0 +1,11 @@ +import java.util.List; +public @lombok.RequiredArgsConstructor class WithByNullAnnos { + final @lombok.experimental.WithBy List test; + public @org.checkerframework.checker.nullness.qual.NonNull @java.lang.SuppressWarnings("all") WithByNullAnnos withTestBy(final java.util.function. @org.checkerframework.checker.nullness.qual.NonNull Function, ? extends List> transformer) { + return new WithByNullAnnos(transformer.apply(this.test)); + } + public @java.lang.SuppressWarnings("all") WithByNullAnnos(final List test) { + super(); + this.test = test; + } +} \ No newline at end of file diff --git a/test/transform/resource/after-ecj/WithByTypes.java b/test/transform/resource/after-ecj/WithByTypes.java new file mode 100644 index 00000000..b997ffba --- /dev/null +++ b/test/transform/resource/after-ecj/WithByTypes.java @@ -0,0 +1,53 @@ +public @lombok.RequiredArgsConstructor @lombok.experimental.FieldDefaults(level = lombok.AccessLevel.PRIVATE,makeFinal = true) @lombok.experimental.WithBy class WithByTypes { + private final int a; + private final long b; + private final short c; + private final char d; + private final byte e; + private final double f; + private final float g; + private final boolean h; + private final T i; + public static void example() { + new WithByTypes(0, 0, (short) 0, ' ', (byte) 0, 0.0, 0.0F, true, "").withHBy(( x) -> (! x)).withFBy(( x) -> (x + 0.5)); + } + public @java.lang.SuppressWarnings("all") WithByTypes(final int a, final long b, final short c, final char d, final byte e, final double f, final float g, final boolean h, final T i) { + super(); + this.a = a; + this.b = b; + this.c = c; + this.d = d; + this.e = e; + this.f = f; + this.g = g; + this.h = h; + this.i = i; + } + public @java.lang.SuppressWarnings("all") WithByTypes withABy(final java.util.function.IntUnaryOperator transformer) { + return new WithByTypes(transformer.applyAsInt(this.a), this.b, this.c, this.d, this.e, this.f, this.g, this.h, this.i); + } + public @java.lang.SuppressWarnings("all") WithByTypes withBBy(final java.util.function.LongUnaryOperator transformer) { + return new WithByTypes(this.a, transformer.applyAsLong(this.b), this.c, this.d, this.e, this.f, this.g, this.h, this.i); + } + public @java.lang.SuppressWarnings("all") WithByTypes withCBy(final java.util.function.IntUnaryOperator transformer) { + return new WithByTypes(this.a, this.b, (short) transformer.applyAsInt(this.c), this.d, this.e, this.f, this.g, this.h, this.i); + } + public @java.lang.SuppressWarnings("all") WithByTypes withDBy(final java.util.function.IntUnaryOperator transformer) { + return new WithByTypes(this.a, this.b, this.c, (char) transformer.applyAsInt(this.d), this.e, this.f, this.g, this.h, this.i); + } + public @java.lang.SuppressWarnings("all") WithByTypes withEBy(final java.util.function.IntUnaryOperator transformer) { + return new WithByTypes(this.a, this.b, this.c, this.d, (byte) transformer.applyAsInt(this.e), this.f, this.g, this.h, this.i); + } + public @java.lang.SuppressWarnings("all") WithByTypes withFBy(final java.util.function.DoubleUnaryOperator transformer) { + return new WithByTypes(this.a, this.b, this.c, this.d, this.e, transformer.applyAsDouble(this.f), this.g, this.h, this.i); + } + public @java.lang.SuppressWarnings("all") WithByTypes withGBy(final java.util.function.DoubleUnaryOperator transformer) { + return new WithByTypes(this.a, this.b, this.c, this.d, this.e, this.f, (float) transformer.applyAsDouble(this.g), this.h, this.i); + } + public @java.lang.SuppressWarnings("all") WithByTypes withHBy(final java.util.function.UnaryOperator transformer) { + return new WithByTypes(this.a, this.b, this.c, this.d, this.e, this.f, this.g, transformer.apply(this.h), this.i); + } + public @java.lang.SuppressWarnings("all") WithByTypes withIBy(final java.util.function.Function transformer) { + return new WithByTypes(this.a, this.b, this.c, this.d, this.e, this.f, this.g, this.h, transformer.apply(this.i)); + } +} \ No newline at end of file -- cgit