aboutsummaryrefslogtreecommitdiff
path: root/test/transform/resource/before
diff options
context:
space:
mode:
Diffstat (limited to 'test/transform/resource/before')
-rw-r--r--test/transform/resource/before/ClassNamedAfterGetter.java3
-rw-r--r--test/transform/resource/before/CleanupName.java10
-rw-r--r--test/transform/resource/before/CleanupPlain.java11
-rw-r--r--test/transform/resource/before/CommentsInterspersed.java17
-rw-r--r--test/transform/resource/before/DataExtended.java5
-rw-r--r--test/transform/resource/before/DataIgnore.java4
-rw-r--r--test/transform/resource/before/DataPlain.java9
-rw-r--r--test/transform/resource/before/GetterAccessLevel.java24
-rw-r--r--test/transform/resource/before/GetterAlreadyExists.java108
-rw-r--r--test/transform/resource/before/GetterBoolean.java12
-rw-r--r--test/transform/resource/before/GetterOnClass.java37
-rw-r--r--test/transform/resource/before/GetterPlain.java5
-rw-r--r--test/transform/resource/before/GetterWithDollar.java9
-rw-r--r--test/transform/resource/before/NonNullPlain.java11
-rw-r--r--test/transform/resource/before/SetterAccessLevel.java14
-rw-r--r--test/transform/resource/before/SetterAlreadyExists.java35
-rw-r--r--test/transform/resource/before/SetterOnClass.java37
-rw-r--r--test/transform/resource/before/SetterPlain.java5
-rw-r--r--test/transform/resource/before/SetterWithDollar.java9
-rw-r--r--test/transform/resource/before/SneakyThrowsMultiple.java28
-rw-r--r--test/transform/resource/before/SneakyThrowsPlain.java10
-rw-r--r--test/transform/resource/before/SneakyThrowsSingle.java21
-rw-r--r--test/transform/resource/before/SynchronizedName.java21
-rw-r--r--test/transform/resource/before/SynchronizedPlain.java17
-rw-r--r--test/transform/resource/before/ToStringInner.java16
-rw-r--r--test/transform/resource/before/ToStringPlain.java9
26 files changed, 487 insertions, 0 deletions
diff --git a/test/transform/resource/before/ClassNamedAfterGetter.java b/test/transform/resource/before/ClassNamedAfterGetter.java
new file mode 100644
index 00000000..fe61eda1
--- /dev/null
+++ b/test/transform/resource/before/ClassNamedAfterGetter.java
@@ -0,0 +1,3 @@
+class GetFoo {
+ @lombok.Getter private int foo;
+}
diff --git a/test/transform/resource/before/CleanupName.java b/test/transform/resource/before/CleanupName.java
new file mode 100644
index 00000000..cbc5b447
--- /dev/null
+++ b/test/transform/resource/before/CleanupName.java
@@ -0,0 +1,10 @@
+class CleanupName {
+ void test() {
+ @lombok.Cleanup("toString") Object o = "Hello World!";
+ System.out.println(o);
+ }
+ void test2() {
+ @lombok.Cleanup(value="toString") Object o = "Hello World too!";
+ System.out.println(o);
+ }
+} \ No newline at end of file
diff --git a/test/transform/resource/before/CleanupPlain.java b/test/transform/resource/before/CleanupPlain.java
new file mode 100644
index 00000000..a91ac3c1
--- /dev/null
+++ b/test/transform/resource/before/CleanupPlain.java
@@ -0,0 +1,11 @@
+import lombok.Cleanup;
+import java.io.*;
+class CleanupPlain {
+ void test() throws Exception {
+ @lombok.Cleanup InputStream in = new FileInputStream("in");
+ @Cleanup OutputStream out = new FileOutputStream("out");
+ if (in.markSupported()) {
+ out.flush();
+ }
+ }
+} \ No newline at end of file
diff --git a/test/transform/resource/before/CommentsInterspersed.java b/test/transform/resource/before/CommentsInterspersed.java
new file mode 100644
index 00000000..e7898aaa
--- /dev/null
+++ b/test/transform/resource/before/CommentsInterspersed.java
@@ -0,0 +1,17 @@
+import /* cmt */ lombok./* cmt2 */Getter /* cmt3 */ ;
+
+public /*bla */ class CommentsInterspersed {
+ /** javadoc for field */
+ private int x;
+
+ private /* bla2 */ @Getter String test = "foo"; //$NON-NLS-1$
+
+ /** Javadoc on method */
+ public native void gwtTest(); /*-{
+ javascript;
+ }-*/
+} //haha!
+//hahaha!
+
+//hahahaha!
+
diff --git a/test/transform/resource/before/DataExtended.java b/test/transform/resource/before/DataExtended.java
new file mode 100644
index 00000000..a545460c
--- /dev/null
+++ b/test/transform/resource/before/DataExtended.java
@@ -0,0 +1,5 @@
+@lombok.Data
+@lombok.ToString(doNotUseGetters = true)
+class DataExtended {
+ int x;
+} \ No newline at end of file
diff --git a/test/transform/resource/before/DataIgnore.java b/test/transform/resource/before/DataIgnore.java
new file mode 100644
index 00000000..5f957bdc
--- /dev/null
+++ b/test/transform/resource/before/DataIgnore.java
@@ -0,0 +1,4 @@
+@lombok.Data class DataIgnore {
+ final int x;
+ String $name;
+}
diff --git a/test/transform/resource/before/DataPlain.java b/test/transform/resource/before/DataPlain.java
new file mode 100644
index 00000000..680ae46f
--- /dev/null
+++ b/test/transform/resource/before/DataPlain.java
@@ -0,0 +1,9 @@
+import lombok.Data;
+@lombok.Data class Data1 {
+ final int x;
+ String name;
+}
+@Data class Data2 {
+ final int x;
+ String name;
+} \ No newline at end of file
diff --git a/test/transform/resource/before/GetterAccessLevel.java b/test/transform/resource/before/GetterAccessLevel.java
new file mode 100644
index 00000000..413b888e
--- /dev/null
+++ b/test/transform/resource/before/GetterAccessLevel.java
@@ -0,0 +1,24 @@
+class GetterAccessLevel {
+ @lombok.Getter(lombok.AccessLevel.NONE)
+ boolean isNone;
+ @lombok.Getter(lombok.AccessLevel.PRIVATE)
+ boolean isPrivate;
+ @lombok.Getter(lombok.AccessLevel.PACKAGE)
+ boolean isPackage;
+ @lombok.Getter(lombok.AccessLevel.PROTECTED)
+ boolean isProtected;
+ @lombok.Getter(lombok.AccessLevel.PUBLIC)
+ boolean isPublic;
+ @lombok.Getter(lombok.AccessLevel.NONE)
+ String noneString;
+ @lombok.Getter(lombok.AccessLevel.PRIVATE)
+ String privateString;
+ @lombok.Getter(lombok.AccessLevel.PACKAGE)
+ String packageString;
+ @lombok.Getter(lombok.AccessLevel.PROTECTED)
+ String protectedString;
+ @lombok.Getter(lombok.AccessLevel.PUBLIC)
+ String publicString;
+ @lombok.Getter(value=lombok.AccessLevel.PUBLIC)
+ String value;
+}
diff --git a/test/transform/resource/before/GetterAlreadyExists.java b/test/transform/resource/before/GetterAlreadyExists.java
new file mode 100644
index 00000000..93b77dc1
--- /dev/null
+++ b/test/transform/resource/before/GetterAlreadyExists.java
@@ -0,0 +1,108 @@
+class Getter1 {
+ @lombok.Getter boolean foo;
+ boolean hasFoo() {
+ return true;
+ }
+}
+class Getter2 {
+ @lombok.Getter boolean foo;
+ boolean isFoo() {
+ return true;
+ }
+}
+class Getter3 {
+ @lombok.Getter boolean foo;
+ boolean getFoo() {
+ return true;
+ }
+}
+class Getter4 {
+ @lombok.Getter String foo;
+ String hasFoo() {
+ return null;
+ }
+}
+class Getter5 {
+ @lombok.Getter String foo;
+ String isFoo() {
+ return null;
+ }
+}
+class Getter6 {
+ @lombok.Getter String foo;
+ String getFoo() {
+ return null;
+ }
+}
+class Getter7 {
+ @lombok.Getter String foo;
+ boolean hasFoo() {
+ return false;
+ }
+}
+class Getter8 {
+ @lombok.Getter String foo;
+ boolean isFoo() {
+ return false;
+ }
+}
+class Getter9 {
+ @lombok.Getter String foo;
+ boolean getFoo() {
+ return false;
+ }
+}
+class Getter10 {
+ @lombok.Getter boolean foo;
+ static boolean hasFoo() {
+ return false;
+ }
+}
+class Getter11 {
+ @lombok.Getter boolean foo;
+ static boolean isFoo() {
+ return false;
+ }
+}
+class Getter12 {
+ @lombok.Getter boolean foo;
+ static boolean getFoo() {
+ return false;
+ }
+}
+class Getter13 {
+ @lombok.Getter String foo;
+ static boolean hasFoo() {
+ return false;
+ }
+}
+class Getter14 {
+ @lombok.Getter String foo;
+ static boolean isFoo() {
+ return false;
+ }
+}
+class Getter15 {
+ @lombok.Getter String foo;
+ static boolean getFoo() {
+ return false;
+ }
+}
+class Getter16 {
+ @lombok.Getter String foo;
+ static String hasFoo() {
+ return false;
+ }
+}
+class Getter17 {
+ @lombok.Getter String foo;
+ static String isFoo() {
+ return false;
+ }
+}
+class Getter18 {
+ @lombok.Getter String foo;
+ static String getFoo() {
+ return false;
+ }
+} \ No newline at end of file
diff --git a/test/transform/resource/before/GetterBoolean.java b/test/transform/resource/before/GetterBoolean.java
new file mode 100644
index 00000000..7d53ebbf
--- /dev/null
+++ b/test/transform/resource/before/GetterBoolean.java
@@ -0,0 +1,12 @@
+class Getter {
+ @lombok.Getter boolean foo;
+ @lombok.Getter boolean isBar;
+ @lombok.Getter boolean hasBaz;
+}
+class MoreGetter {
+ @lombok.Getter boolean foo;
+
+ boolean hasFoo() {
+ return true;
+ }
+} \ No newline at end of file
diff --git a/test/transform/resource/before/GetterOnClass.java b/test/transform/resource/before/GetterOnClass.java
new file mode 100644
index 00000000..0a38b386
--- /dev/null
+++ b/test/transform/resource/before/GetterOnClass.java
@@ -0,0 +1,37 @@
+@lombok.Getter
+class GetterOnClass1 {
+ @lombok.Getter(lombok.AccessLevel.NONE)
+ boolean isNone;
+ boolean isPublic;
+}
+@lombok.Getter(lombok.AccessLevel.PROTECTED)
+class GetterOnClass2 {
+ @lombok.Getter(lombok.AccessLevel.NONE)
+ boolean isNone;
+ boolean isProtected;
+ @lombok.Getter(lombok.AccessLevel.PACKAGE)
+ boolean isPackage;
+}
+@lombok.Getter(lombok.AccessLevel.PACKAGE)
+class GetterOnClass3 {
+ @lombok.Getter(lombok.AccessLevel.NONE)
+ boolean isNone;
+ boolean isPackage;
+}
+@lombok.Getter(lombok.AccessLevel.PRIVATE)
+class GetterOnClass4 {
+ @lombok.Getter(lombok.AccessLevel.NONE)
+ boolean isNone;
+ boolean isPrivate;
+}
+@lombok.Getter(lombok.AccessLevel.PUBLIC)
+class GetterOnClass5 {
+ @lombok.Getter(lombok.AccessLevel.NONE)
+ boolean isNone;
+ boolean isPublic;
+}
+@lombok.Getter
+class GetterOnClass6 {
+ String couldBeNull;
+ @lombok.NonNull String nonNull;
+} \ No newline at end of file
diff --git a/test/transform/resource/before/GetterPlain.java b/test/transform/resource/before/GetterPlain.java
new file mode 100644
index 00000000..d104f428
--- /dev/null
+++ b/test/transform/resource/before/GetterPlain.java
@@ -0,0 +1,5 @@
+import lombok.Getter;
+class GetterPlain {
+ @lombok.Getter int i;
+ @Getter int foo;
+} \ No newline at end of file
diff --git a/test/transform/resource/before/GetterWithDollar.java b/test/transform/resource/before/GetterWithDollar.java
new file mode 100644
index 00000000..e1ef0818
--- /dev/null
+++ b/test/transform/resource/before/GetterWithDollar.java
@@ -0,0 +1,9 @@
+//ignore
+class GetterWithDollar1 {
+ @lombok.Getter int $i;
+}
+
+class GetterWithDollar2 {
+ @lombok.Getter int $i;
+ @lombok.Getter int i;
+}
diff --git a/test/transform/resource/before/NonNullPlain.java b/test/transform/resource/before/NonNullPlain.java
new file mode 100644
index 00000000..eef64b2f
--- /dev/null
+++ b/test/transform/resource/before/NonNullPlain.java
@@ -0,0 +1,11 @@
+class NonNullPlain {
+ @lombok.Getter
+ @lombok.Setter
+ @lombok.NonNull
+ @lombok.Getter int i;
+
+ @lombok.Getter
+ @lombok.Setter
+ @lombok.NonNull
+ String s;
+} \ No newline at end of file
diff --git a/test/transform/resource/before/SetterAccessLevel.java b/test/transform/resource/before/SetterAccessLevel.java
new file mode 100644
index 00000000..8a30a7de
--- /dev/null
+++ b/test/transform/resource/before/SetterAccessLevel.java
@@ -0,0 +1,14 @@
+class SetterAccessLevel {
+ @lombok.Setter(lombok.AccessLevel.NONE)
+ boolean isNone;
+ @lombok.Setter(lombok.AccessLevel.PRIVATE)
+ boolean isPrivate;
+ @lombok.Setter(lombok.AccessLevel.PACKAGE)
+ boolean isPackage;
+ @lombok.Setter(lombok.AccessLevel.PROTECTED)
+ boolean isProtected;
+ @lombok.Setter(lombok.AccessLevel.PUBLIC)
+ boolean isPublic;
+ @lombok.Setter(value=lombok.AccessLevel.PUBLIC)
+ boolean value;
+}
diff --git a/test/transform/resource/before/SetterAlreadyExists.java b/test/transform/resource/before/SetterAlreadyExists.java
new file mode 100644
index 00000000..a7a94123
--- /dev/null
+++ b/test/transform/resource/before/SetterAlreadyExists.java
@@ -0,0 +1,35 @@
+class Setter1 {
+ @lombok.Setter boolean foo;
+ void setFoo(boolean foo) {
+ }
+}
+class Setter2 {
+ @lombok.Setter boolean foo;
+ void setFoo(String foo) {
+ }
+}
+class Setter3 {
+ @lombok.Setter String foo;
+ void setFoo(boolean foo) {
+ }
+}
+class Setter4 {
+ @lombok.Setter String foo;
+ void setFoo(String foo) {
+ }
+}
+class Setter5 {
+ @lombok.Setter String foo;
+ void setFoo() {
+ }
+}
+class Setter6 {
+ @lombok.Setter String foo;
+ void setFoo(String foo, int x) {
+ }
+}
+class Setter7 {
+ @lombok.Setter String foo;
+ static void setFoo() {
+ }
+}
diff --git a/test/transform/resource/before/SetterOnClass.java b/test/transform/resource/before/SetterOnClass.java
new file mode 100644
index 00000000..5d195ff5
--- /dev/null
+++ b/test/transform/resource/before/SetterOnClass.java
@@ -0,0 +1,37 @@
+@lombok.Setter
+class SetterOnClass1 {
+ @lombok.Setter(lombok.AccessLevel.NONE)
+ boolean isNone;
+ boolean isPublic;
+}
+@lombok.Setter(lombok.AccessLevel.PROTECTED)
+class SetterOnClass2 {
+ @lombok.Setter(lombok.AccessLevel.NONE)
+ boolean isNone;
+ boolean isProtected;
+ @lombok.Setter(lombok.AccessLevel.PACKAGE)
+ boolean isPackage;
+}
+@lombok.Setter(lombok.AccessLevel.PACKAGE)
+class SetterOnClass3 {
+ @lombok.Setter(lombok.AccessLevel.NONE)
+ boolean isNone;
+ boolean isPackage;
+}
+@lombok.Setter(lombok.AccessLevel.PRIVATE)
+class SetterOnClass4 {
+ @lombok.Setter(lombok.AccessLevel.NONE)
+ boolean isNone;
+ boolean isPrivate;
+}
+@lombok.Setter(lombok.AccessLevel.PUBLIC)
+class SetterOnClass5 {
+ @lombok.Setter(lombok.AccessLevel.NONE)
+ boolean isNone;
+ boolean isPublic;
+}
+@lombok.Setter
+class SetterOnClass6 {
+ String couldBeNull;
+ @lombok.NonNull String nonNull;
+} \ No newline at end of file
diff --git a/test/transform/resource/before/SetterPlain.java b/test/transform/resource/before/SetterPlain.java
new file mode 100644
index 00000000..e1ac99f8
--- /dev/null
+++ b/test/transform/resource/before/SetterPlain.java
@@ -0,0 +1,5 @@
+import lombok.Setter;
+class SetterPlain {
+ @lombok.Setter int i;
+ @Setter int foo;
+} \ No newline at end of file
diff --git a/test/transform/resource/before/SetterWithDollar.java b/test/transform/resource/before/SetterWithDollar.java
new file mode 100644
index 00000000..c09173b0
--- /dev/null
+++ b/test/transform/resource/before/SetterWithDollar.java
@@ -0,0 +1,9 @@
+//ignore
+class SetterWithDollar1 {
+ @lombok.Setter int $i;
+}
+
+class SetterWithDollar2 {
+ @lombok.Setter int $i;
+ @lombok.Setter int i;
+}
diff --git a/test/transform/resource/before/SneakyThrowsMultiple.java b/test/transform/resource/before/SneakyThrowsMultiple.java
new file mode 100644
index 00000000..7e644f3d
--- /dev/null
+++ b/test/transform/resource/before/SneakyThrowsMultiple.java
@@ -0,0 +1,28 @@
+import java.awt.AWTException;
+import java.io.IOException;
+import java.util.Random;
+
+class SneakyThrowsMultiple {
+ @lombok.SneakyThrows(IOException.class,Throwable.class)
+ public void test() {
+ System.out.println("test1");
+ throw new IOException();
+ }
+
+ @lombok.SneakyThrows(AWTException.class,IOException.class)
+ public void test2() {
+ System.out.println("test2");
+ if (new Random().nextBoolean()) {
+ throw new IOException();
+ }
+ else {
+ throw new AWTException("WHAT");
+ }
+ }
+
+ @lombok.SneakyThrows(value={IOException.class,Throwable.class})
+ public void test3() {
+ System.out.println("test3");
+ throw new IOException();
+ }
+} \ No newline at end of file
diff --git a/test/transform/resource/before/SneakyThrowsPlain.java b/test/transform/resource/before/SneakyThrowsPlain.java
new file mode 100644
index 00000000..97fecf8f
--- /dev/null
+++ b/test/transform/resource/before/SneakyThrowsPlain.java
@@ -0,0 +1,10 @@
+import lombok.SneakyThrows;
+class SneakyThrowsPlain {
+ @lombok.SneakyThrows public void test() {
+ System.out.println("test1");
+ }
+
+ @SneakyThrows public void test2() {
+ System.out.println("test2");
+ }
+} \ No newline at end of file
diff --git a/test/transform/resource/before/SneakyThrowsSingle.java b/test/transform/resource/before/SneakyThrowsSingle.java
new file mode 100644
index 00000000..e7b78ec7
--- /dev/null
+++ b/test/transform/resource/before/SneakyThrowsSingle.java
@@ -0,0 +1,21 @@
+import java.io.IOException;
+
+class SneakyThrowsSingle {
+ @lombok.SneakyThrows(Throwable.class)
+ public void test() {
+ System.out.println("test1");
+ }
+
+ @lombok.SneakyThrows(IOException.class)
+ public void test2() {
+ System.out.println("test2");
+ throw new IOException();
+ }
+
+ @lombok.SneakyThrows(value=IOException.class)
+ public void test3() {
+ System.out.println("test3");
+ throw new IOException();
+ }
+
+} \ No newline at end of file
diff --git a/test/transform/resource/before/SynchronizedName.java b/test/transform/resource/before/SynchronizedName.java
new file mode 100644
index 00000000..6d9ca5e9
--- /dev/null
+++ b/test/transform/resource/before/SynchronizedName.java
@@ -0,0 +1,21 @@
+//ignore
+class SynchronizedName {
+ private Object read = new Object();
+ private static Object READ = new Object();
+
+ @lombok.Synchronized("read") void test1() {
+ System.out.println("one");
+ }
+ @lombok.Synchronized("write") void test2() {
+ System.out.println("two");
+ }
+ @lombok.Synchronized("read") static void test3() {
+ System.out.println("three");
+ }
+ @lombok.Synchronized("READ") void test4() {
+ System.out.println("four");
+ }
+ @lombok.Synchronized(value="read") void test5() {
+ System.out.println("five");
+ }
+}
diff --git a/test/transform/resource/before/SynchronizedPlain.java b/test/transform/resource/before/SynchronizedPlain.java
new file mode 100644
index 00000000..6f5f3b64
--- /dev/null
+++ b/test/transform/resource/before/SynchronizedPlain.java
@@ -0,0 +1,17 @@
+import lombok.Synchronized;
+class SynchronizedPlain1 {
+ @lombok.Synchronized void test() {
+ System.out.println("one");
+ }
+ @Synchronized void test2() {
+ System.out.println("two");
+ }
+}
+class SynchronizedPlain2 {
+ @lombok.Synchronized static void test() {
+ System.out.println("three");
+ }
+ @Synchronized static void test2() {
+ System.out.println("four");
+ }
+} \ No newline at end of file
diff --git a/test/transform/resource/before/ToStringInner.java b/test/transform/resource/before/ToStringInner.java
new file mode 100644
index 00000000..f56865e0
--- /dev/null
+++ b/test/transform/resource/before/ToStringInner.java
@@ -0,0 +1,16 @@
+import lombok.ToString;
+@ToString class ToStringOuter {
+ final int x;
+ String name;
+ @ToString class ToStringInner {
+ final int y;
+ }
+ @ToString static class ToStringStaticInner {
+ final int y;
+ }
+ class ToStringMiddle {
+ @ToString class ToStringMoreInner {
+ final String name;
+ }
+ }
+} \ No newline at end of file
diff --git a/test/transform/resource/before/ToStringPlain.java b/test/transform/resource/before/ToStringPlain.java
new file mode 100644
index 00000000..5b9db1c7
--- /dev/null
+++ b/test/transform/resource/before/ToStringPlain.java
@@ -0,0 +1,9 @@
+import lombok.ToString;
+@lombok.ToString class ToString1 {
+ final int x;
+ String name;
+}
+@ToString class ToString2 {
+ final int x;
+ String name;
+} \ No newline at end of file