diff options
Diffstat (limited to 'test/transform/resource/after-delombok')
7 files changed, 156 insertions, 15 deletions
diff --git a/test/transform/resource/after-delombok/BuilderWithAccessors.java b/test/transform/resource/after-delombok/BuilderWithAccessors.java new file mode 100644 index 00000000..503c33be --- /dev/null +++ b/test/transform/resource/after-delombok/BuilderWithAccessors.java @@ -0,0 +1,65 @@ +class BuilderWithAccessors { + private final int plower; + private final int pUpper; + private int _foo; + private int __bar; + @java.lang.SuppressWarnings("all") + BuilderWithAccessors(final int plower, final int upper, final int foo, final int _bar) { + this.plower = plower; + this.pUpper = upper; + this._foo = foo; + this.__bar = _bar; + } + @java.lang.SuppressWarnings("all") + public static class BuilderWithAccessorsBuilder { + private int plower; + private int upper; + private int foo; + private int _bar; + + @java.lang.SuppressWarnings("all") + BuilderWithAccessorsBuilder() { + + } + + @java.lang.SuppressWarnings("all") + public BuilderWithAccessorsBuilder plower(final int plower) { + this.plower = plower; + return this; + } + + @java.lang.SuppressWarnings("all") + public BuilderWithAccessorsBuilder upper(final int upper) { + this.upper = upper; + return this; + } + + @java.lang.SuppressWarnings("all") + public BuilderWithAccessorsBuilder foo(final int foo) { + this.foo = foo; + return this; + } + + @java.lang.SuppressWarnings("all") + public BuilderWithAccessorsBuilder _bar(final int _bar) { + this._bar = _bar; + return this; + } + + @java.lang.SuppressWarnings("all") + public BuilderWithAccessors build() { + return new BuilderWithAccessors(plower, upper, foo, _bar); + } + + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.String toString() { + return "BuilderWithAccessors.BuilderWithAccessorsBuilder(plower=" + this.plower + ", upper=" + this.upper + ", foo=" + this.foo + ", _bar=" + this._bar + ")"; + } + } + + @java.lang.SuppressWarnings("all") + public static BuilderWithAccessorsBuilder builder() { + return new BuilderWithAccessorsBuilder(); + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-delombok/ConstructorsWithAccessors.java b/test/transform/resource/after-delombok/ConstructorsWithAccessors.java new file mode 100644 index 00000000..9937c7ee --- /dev/null +++ b/test/transform/resource/after-delombok/ConstructorsWithAccessors.java @@ -0,0 +1,15 @@ +class ConstructorsWithAccessors { + int plower; + int pUpper; + int _huh; + int __huh2; + + @java.beans.ConstructorProperties({"plower", "upper", "huh", "_huh2"}) + @java.lang.SuppressWarnings("all") + public ConstructorsWithAccessors(final int plower, final int upper, final int huh, final int _huh2) { + this.plower = plower; + this.pUpper = upper; + this._huh = huh; + this.__huh2 = _huh2; + } +} diff --git a/test/transform/resource/after-delombok/GetterSetterJavadoc.java b/test/transform/resource/after-delombok/GetterSetterJavadoc.java index 7bf92d1f..af9cbb5e 100644 --- a/test/transform/resource/after-delombok/GetterSetterJavadoc.java +++ b/test/transform/resource/after-delombok/GetterSetterJavadoc.java @@ -9,7 +9,7 @@ class GetterSetterJavadoc1 { /** * Getter section * - * @return Sky is blue + * @return Sky is blue1 */ @java.lang.SuppressWarnings("all") public int getFieldName() { @@ -18,7 +18,7 @@ class GetterSetterJavadoc1 { /** * Some text * - * @param fieldName Hello, World + * @param fieldName Hello, World1 */ @java.lang.SuppressWarnings("all") public void setFieldName(final int fieldName) { @@ -60,7 +60,7 @@ class GetterSetterJavadoc2 { /** * Some text * - * @return Sky is blue + * @return Sky is blue2 */ @java.lang.SuppressWarnings("all") public int getFieldName() { @@ -69,7 +69,7 @@ class GetterSetterJavadoc2 { /** * Some text * - * @param fieldName Hello, World + * @param fieldName Hello, World2 */ @java.lang.SuppressWarnings("all") public void setFieldName(final int fieldName) { @@ -83,7 +83,7 @@ class GetterSetterJavadoc3 { private int fieldName; /** * Getter section - * @return Sky is blue + * @return Sky is blue3 */ @java.lang.SuppressWarnings("all") public int getFieldName() { @@ -91,7 +91,7 @@ class GetterSetterJavadoc3 { } /** * Setter section - * @param fieldName Hello, World + * @param fieldName Hello, World3 */ @java.lang.SuppressWarnings("all") public void setFieldName(final int fieldName) { diff --git a/test/transform/resource/after-delombok/NonNullOnParameterAbstract.java b/test/transform/resource/after-delombok/NonNullOnParameterAbstract.java new file mode 100644 index 00000000..e0330bd6 --- /dev/null +++ b/test/transform/resource/after-delombok/NonNullOnParameterAbstract.java @@ -0,0 +1,10 @@ +abstract class NonNullOnParameterAbstract { + public void test(@lombok.NonNull String arg) { + if (arg == null) { + throw new java.lang.NullPointerException("arg"); + } + System.out.println("Hey"); + } + + public abstract void test2(@lombok.NonNull String arg); +}
\ No newline at end of file diff --git a/test/transform/resource/after-delombok/NonNullPlain.java b/test/transform/resource/after-delombok/NonNullPlain.java index 6b85cbf7..b7d27ef3 100644 --- a/test/transform/resource/after-delombok/NonNullPlain.java +++ b/test/transform/resource/after-delombok/NonNullPlain.java @@ -1,5 +1,4 @@ import java.lang.annotation.*; - class NonNullPlain { @lombok.NonNull int i; @@ -7,12 +6,10 @@ class NonNullPlain { String s; @NotNull Object o; - @Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE}) @Retention(RetentionPolicy.CLASS) public @interface NotNull { } - @java.beans.ConstructorProperties({"i", "s"}) @java.lang.SuppressWarnings("all") public NonNullPlain(@lombok.NonNull final int i, @lombok.NonNull final String s) { @@ -22,29 +19,24 @@ class NonNullPlain { this.i = i; this.s = s; } - @lombok.NonNull @java.lang.SuppressWarnings("all") public int getI() { return this.i; } - @lombok.NonNull @java.lang.SuppressWarnings("all") public String getS() { return this.s; } - @java.lang.SuppressWarnings("all") public Object getO() { return this.o; } - @java.lang.SuppressWarnings("all") public void setI(@lombok.NonNull final int i) { this.i = i; } - @java.lang.SuppressWarnings("all") public void setS(@lombok.NonNull final String s) { if (s == null) { @@ -52,7 +44,6 @@ class NonNullPlain { } this.s = s; } - @java.lang.SuppressWarnings("all") public void setO(final Object o) { this.o = o; diff --git a/test/transform/resource/after-delombok/NonNullWithSneakyThrows.java b/test/transform/resource/after-delombok/NonNullWithSneakyThrows.java new file mode 100644 index 00000000..91646468 --- /dev/null +++ b/test/transform/resource/after-delombok/NonNullWithSneakyThrows.java @@ -0,0 +1,12 @@ +class NonNullWithSneakyThrows { + void test(@lombok.NonNull String in) { + try { + if (in == null) { + throw new java.lang.NullPointerException("in"); + } + System.out.println(in); + } catch (final java.lang.Throwable $ex) { + throw lombok.Lombok.sneakyThrow($ex); + } + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-delombok/TestOperators.java b/test/transform/resource/after-delombok/TestOperators.java new file mode 100644 index 00000000..566bedfc --- /dev/null +++ b/test/transform/resource/after-delombok/TestOperators.java @@ -0,0 +1,48 @@ +class TestOperators { + int x = 10; + public void test() { + x = 12; + int a = +x; + boolean d = true; + boolean e = false; + boolean b; + a = -x; + b = !d; + a = ~x; + a = ++x; + a = --x; + a = x++; + a = x--; + b = d || e; + b = d && e; + a = x | a; + a = x ^ a; + a = x & a; + b = a == x; + b = a != x; + b = a < x; + b = a > x; + b = a <= x; + b = a >= x; + a = a << x; + a = a >> x; + a = a >>> x; + a = a + x; + a = a - x; + a = a * x; + a = a / x; + a = a % x; + a |= x; + a ^= x; + a &= x; + a <<= x; + a >>= x; + a >>>= x; + a += x; + a -= x; + a *= x; + a /= x; + a %= x; + a = a > x ? 1 : 0; + } +} |