diff options
Diffstat (limited to 'test/transform')
70 files changed, 2263 insertions, 0 deletions
diff --git a/test/transform/resource/after-eclipse/ClassNamedAfterGetter.java b/test/transform/resource/after-eclipse/ClassNamedAfterGetter.java new file mode 100644 index 00000000..fb9df0ea --- /dev/null +++ b/test/transform/resource/after-eclipse/ClassNamedAfterGetter.java @@ -0,0 +1,9 @@ +class GetFoo { + private @lombok.Getter int foo; + public @java.lang.SuppressWarnings("all") int getFoo() { + return this.foo; + } + GetFoo() { + super(); + } +} diff --git a/test/transform/resource/after-eclipse/CleanupName.java b/test/transform/resource/after-eclipse/CleanupName.java new file mode 100644 index 00000000..f3f725f2 --- /dev/null +++ b/test/transform/resource/after-eclipse/CleanupName.java @@ -0,0 +1,33 @@ +class CleanupName { + CleanupName() { + super(); + } + void test() { + @lombok.Cleanup("toString") Object o = "Hello World!"; + try + { + System.out.println(o); + } + finally + { + if ((java.util.Collections.singletonList(o).get(0) != null)) + { + o.toString(); + } + } + } + void test2() { + @lombok.Cleanup(value = "toString") Object o = "Hello World too!"; + try + { + System.out.println(o); + } + finally + { + if ((java.util.Collections.singletonList(o).get(0) != null)) + { + o.toString(); + } + } + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-eclipse/CleanupPlain.java b/test/transform/resource/after-eclipse/CleanupPlain.java new file mode 100644 index 00000000..a9b9eceb --- /dev/null +++ b/test/transform/resource/after-eclipse/CleanupPlain.java @@ -0,0 +1,35 @@ +import lombok.Cleanup; +import java.io.*; +class CleanupPlain { + CleanupPlain() { + super(); + } + void test() throws Exception { + @lombok.Cleanup InputStream in = new FileInputStream("in"); + try + { + @Cleanup OutputStream out = new FileOutputStream("out"); + try + { + if (in.markSupported()) + { + out.flush(); + } + } + finally + { + if ((java.util.Collections.singletonList(out).get(0) != null)) + { + out.close(); + } + } + } + finally + { + if ((java.util.Collections.singletonList(in).get(0) != null)) + { + in.close(); + } + } + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-eclipse/CommentsInterspersed.java b/test/transform/resource/after-eclipse/CommentsInterspersed.java new file mode 100644 index 00000000..60c69aed --- /dev/null +++ b/test/transform/resource/after-eclipse/CommentsInterspersed.java @@ -0,0 +1,12 @@ +import lombok.Getter; +public class CommentsInterspersed { + private int x; + private @Getter String test = "foo"; + public @java.lang.SuppressWarnings("all") String getTest() { + return this.test; + } + public CommentsInterspersed() { + super(); + } + public native void gwtTest(); +} diff --git a/test/transform/resource/after-eclipse/Constructors.java b/test/transform/resource/after-eclipse/Constructors.java new file mode 100644 index 00000000..e4fba7ff --- /dev/null +++ b/test/transform/resource/after-eclipse/Constructors.java @@ -0,0 +1,56 @@ +@lombok.RequiredArgsConstructor class RequiredArgsConstructor1 { + final int x; + String name; + public @java.beans.ConstructorProperties({"x"}) @java.lang.SuppressWarnings("all") RequiredArgsConstructor1(final int x) { + super(); + this.x = x; + } +} + +@lombok.RequiredArgsConstructor(access = lombok.AccessLevel.PROTECTED) class RequiredArgsConstructorAccess { + final int x; + String name; + protected @java.beans.ConstructorProperties({"x"}) @java.lang.SuppressWarnings("all") RequiredArgsConstructorAccess(final int x) { + super(); + this.x = x; + } +} + +@lombok.RequiredArgsConstructor(staticName = "staticname") class RequiredArgsConstructorStaticName { + final int x; + String name; + private @java.lang.SuppressWarnings("all") RequiredArgsConstructorStaticName(final int x) { + super(); + this.x = x; + } + public static @java.lang.SuppressWarnings("all") RequiredArgsConstructorStaticName staticname(final int x) { + return new RequiredArgsConstructorStaticName(x); + } +} + +@lombok.RequiredArgsConstructor() class RequiredArgsConstructorWithAnnotations { + final int x; + String name; + public @Deprecated @java.beans.ConstructorProperties({"x"}) @java.lang.SuppressWarnings("all") RequiredArgsConstructorWithAnnotations(final int x) { + super(); + this.x = x; + } +} + +@lombok.AllArgsConstructor class AllArgsConstructor1 { + final int x; + String name; + public @java.beans.ConstructorProperties({"x", "name"}) @java.lang.SuppressWarnings("all") AllArgsConstructor1(final int x, final String name) { + super(); + this.x = x; + this.name = name; + } +} + +@lombok.NoArgsConstructor class NoArgsConstructor1 { + final int x; + String name; + public @java.lang.SuppressWarnings("all") NoArgsConstructor1() { + super(); + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-eclipse/DataExtended.java b/test/transform/resource/after-eclipse/DataExtended.java new file mode 100644 index 00000000..924fe8da --- /dev/null +++ b/test/transform/resource/after-eclipse/DataExtended.java @@ -0,0 +1,36 @@ +@lombok.Data @lombok.ToString(doNotUseGetters = true) class DataExtended { + int x; + public @java.lang.SuppressWarnings("all") DataExtended() { + super(); + } + public @java.lang.SuppressWarnings("all") int getX() { + return this.x; + } + public @java.lang.SuppressWarnings("all") void setX(final int x) { + this.x = x; + } + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { + if ((o == this)) + return true; + if ((! (o instanceof DataExtended))) + return false; + final DataExtended other = (DataExtended) o; + if ((! other.canEqual((java.lang.Object) this))) + return false; + if ((this.getX() != other.getX())) + return false; + return true; + } + public @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { + return (other instanceof DataExtended); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { + final int PRIME = 31; + int result = 1; + result = ((result * PRIME) + this.getX()); + return result; + } + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { + return (("DataExtended(x=" + this.x) + ")"); + } +} diff --git a/test/transform/resource/after-eclipse/DataIgnore.java b/test/transform/resource/after-eclipse/DataIgnore.java new file mode 100644 index 00000000..fb700ee2 --- /dev/null +++ b/test/transform/resource/after-eclipse/DataIgnore.java @@ -0,0 +1,35 @@ +@lombok.Data class DataIgnore { + final int x; + String $name; + public @java.beans.ConstructorProperties({"x"}) @java.lang.SuppressWarnings("all") DataIgnore(final int x) { + super(); + this.x = x; + } + public @java.lang.SuppressWarnings("all") int getX() { + return this.x; + } + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { + if ((o == this)) + return true; + if ((! (o instanceof DataIgnore))) + return false; + final DataIgnore other = (DataIgnore) o; + if ((! other.canEqual((java.lang.Object) this))) + return false; + if ((this.getX() != other.getX())) + return false; + return true; + } + public @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { + return (other instanceof DataIgnore); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { + final int PRIME = 31; + int result = 1; + result = ((result * PRIME) + this.getX()); + return result; + } + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { + return (("DataIgnore(x=" + this.getX()) + ")"); + } +} diff --git a/test/transform/resource/after-eclipse/DataOnEnum.java b/test/transform/resource/after-eclipse/DataOnEnum.java new file mode 100644 index 00000000..8bab5925 --- /dev/null +++ b/test/transform/resource/after-eclipse/DataOnEnum.java @@ -0,0 +1,16 @@ +public @lombok.Getter @lombok.ToString @lombok.RequiredArgsConstructor enum DataOnEnum { + A("hello"), + private final String someField; + <clinit>() { + } + private @java.lang.SuppressWarnings("all") DataOnEnum(final String someField) { + super(); + this.someField = someField; + } + public @java.lang.SuppressWarnings("all") String getSomeField() { + return this.someField; + } + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { + return (("DataOnEnum(someField=" + this.getSomeField()) + ")"); + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-eclipse/DataOnLocalClass.java b/test/transform/resource/after-eclipse/DataOnLocalClass.java new file mode 100644 index 00000000..6c85fae7 --- /dev/null +++ b/test/transform/resource/after-eclipse/DataOnLocalClass.java @@ -0,0 +1,134 @@ +import lombok.Data; +class DataOnLocalClass1 { + DataOnLocalClass1() { + super(); + } + public static void main(String[] args) { + @Data class Local { + final int x; + String name; + public @java.lang.SuppressWarnings("all") Local(final int x) { + super(); + this.x = x; + } + public @java.lang.SuppressWarnings("all") int getX() { + return this.x; + } + public @java.lang.SuppressWarnings("all") String getName() { + return this.name; + } + public @java.lang.SuppressWarnings("all") void setName(final String name) { + this.name = name; + } + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { + if ((o == this)) + return true; + if ((! (o instanceof Local))) + return false; + final Local other = (Local) o; + if ((! other.canEqual((java.lang.Object) this))) + return false; + if ((this.getX() != other.getX())) + return false; + if (((this.getName() == null) ? (other.getName() != null) : (! this.getName().equals((java.lang.Object) other.getName())))) + return false; + return true; + } + public @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { + return (other instanceof Local); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { + final int PRIME = 31; + int result = 1; + result = ((result * PRIME) + this.getX()); + result = ((result * PRIME) + ((this.getName() == null) ? 0 : this.getName().hashCode())); + return result; + } + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { + return (((("Local(x=" + this.getX()) + ", name=") + this.getName()) + ")"); + } + } + } +} +class DataOnLocalClass2 { + { + @Data class Local { + @Data class InnerLocal { + @lombok.NonNull String name; + public @java.lang.SuppressWarnings("all") InnerLocal(final @lombok.NonNull String name) { + super(); + if ((name == null)) + throw new java.lang.NullPointerException("name"); + this.name = name; + } + public @lombok.NonNull @java.lang.SuppressWarnings("all") String getName() { + return this.name; + } + public @java.lang.SuppressWarnings("all") void setName(final @lombok.NonNull String name) { + if ((name == null)) + throw new java.lang.NullPointerException("name"); + this.name = name; + } + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { + if ((o == this)) + return true; + if ((! (o instanceof InnerLocal))) + return false; + final InnerLocal other = (InnerLocal) o; + if ((! other.canEqual((java.lang.Object) this))) + return false; + if (((this.getName() == null) ? (other.getName() != null) : (! this.getName().equals((java.lang.Object) other.getName())))) + return false; + return true; + } + public @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { + return (other instanceof InnerLocal); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { + final int PRIME = 31; + int result = 1; + result = ((result * PRIME) + ((this.getName() == null) ? 0 : this.getName().hashCode())); + return result; + } + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { + return (("Local.InnerLocal(name=" + this.getName()) + ")"); + } + } + final int x; + public @java.lang.SuppressWarnings("all") Local(final int x) { + super(); + this.x = x; + } + public @java.lang.SuppressWarnings("all") int getX() { + return this.x; + } + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { + if ((o == this)) + return true; + if ((! (o instanceof Local))) + return false; + final Local other = (Local) o; + if ((! other.canEqual((java.lang.Object) this))) + return false; + if ((this.getX() != other.getX())) + return false; + return true; + } + public @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { + return (other instanceof Local); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { + final int PRIME = 31; + int result = 1; + result = ((result * PRIME) + this.getX()); + return result; + } + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { + return (("Local(x=" + this.getX()) + ")"); + } + } + } + DataOnLocalClass2() { + super(); + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-eclipse/DataPlain.java b/test/transform/resource/after-eclipse/DataPlain.java new file mode 100644 index 00000000..0edf164b --- /dev/null +++ b/test/transform/resource/after-eclipse/DataPlain.java @@ -0,0 +1,208 @@ +import lombok.Data; +@lombok.Data class Data1 { + final int x; + String name; + public @java.beans.ConstructorProperties({"x"}) @java.lang.SuppressWarnings("all") Data1(final int x) { + super(); + this.x = x; + } + public @java.lang.SuppressWarnings("all") int getX() { + return this.x; + } + public @java.lang.SuppressWarnings("all") String getName() { + return this.name; + } + public @java.lang.SuppressWarnings("all") void setName(final String name) { + this.name = name; + } + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { + if ((o == this)) + return true; + if ((! (o instanceof Data1))) + return false; + final Data1 other = (Data1) o; + if ((! other.canEqual((java.lang.Object) this))) + return false; + if ((this.getX() != other.getX())) + return false; + if (((this.getName() == null) ? (other.getName() != null) : (! this.getName().equals((java.lang.Object) ot |
