aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/bytecode/resource/Foo.java3
-rw-r--r--test/bytecode/src/lombok/bytecode/TestClassFileMetaData.java1
-rw-r--r--test/transform/resource/after-delombok/DelegateOnGetter.java35
-rw-r--r--test/transform/resource/after-delombok/DelegateOnGetterNone.java15
-rw-r--r--test/transform/resource/after-delombok/DelegateOnMethods.java12
-rw-r--r--test/transform/resource/after-delombok/GetterNone.java8
-rw-r--r--test/transform/resource/after-ecj/DelegateOnGetter.java1
-rw-r--r--test/transform/resource/after-ecj/DelegateOnGetterNone.java1
-rw-r--r--test/transform/resource/after-ecj/DelegateOnMethods.java1
-rw-r--r--test/transform/resource/after-ecj/GetterNone.java12
-rw-r--r--test/transform/resource/after-eclipse/DelegateOnGetter.java40
-rw-r--r--test/transform/resource/after-eclipse/DelegateOnGetterNone.java19
-rw-r--r--test/transform/resource/after-eclipse/DelegateOnMethods.java13
-rw-r--r--test/transform/resource/after-eclipse/GetterNone.java12
-rw-r--r--test/transform/resource/before/DelegateOnGetter.java18
-rw-r--r--test/transform/resource/before/DelegateOnGetterNone.java14
-rw-r--r--test/transform/resource/before/DelegateOnMethods.java11
-rw-r--r--test/transform/resource/before/GetterNone.java8
18 files changed, 223 insertions, 1 deletions
diff --git a/test/bytecode/resource/Foo.java b/test/bytecode/resource/Foo.java
index 2726026c..a7bb26af 100644
--- a/test/bytecode/resource/Foo.java
+++ b/test/bytecode/resource/Foo.java
@@ -1,6 +1,7 @@
public class Foo implements java.util.RandomAccess {
private static final long LONG = 123L;
- private static final String ONE = "Eén";
+ private static final long LONG_OVERFLOW = 0x1FFFFFFFFL;
+ private static final String ONE = "E\u00e9n";
private static final int INT = 123;
private static final double DOUBLE = 1.23;
private static final double DOUBLE_NAN = Double.NaN;
diff --git a/test/bytecode/src/lombok/bytecode/TestClassFileMetaData.java b/test/bytecode/src/lombok/bytecode/TestClassFileMetaData.java
index aaf7d2e9..2b506c1b 100644
--- a/test/bytecode/src/lombok/bytecode/TestClassFileMetaData.java
+++ b/test/bytecode/src/lombok/bytecode/TestClassFileMetaData.java
@@ -169,6 +169,7 @@ public class TestClassFileMetaData {
@Test
public void testContainsLong() {
assertTrue(foo.containsLong(123));
+ assertTrue(foo.containsLong(0x1FFFFFFFFL));
assertFalse(foo.containsLong(1));
assertFalse(buux.containsLong(1));
diff --git a/test/transform/resource/after-delombok/DelegateOnGetter.java b/test/transform/resource/after-delombok/DelegateOnGetter.java
new file mode 100644
index 00000000..ee34018a
--- /dev/null
+++ b/test/transform/resource/after-delombok/DelegateOnGetter.java
@@ -0,0 +1,35 @@
+class DelegateOnGetter {
+ private final java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<Bar>> bar = new java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<Bar>>();
+ private interface Bar {
+ void setList(java.util.ArrayList<java.lang.String> list);
+ int getInt();
+ }
+ @java.lang.SuppressWarnings("all")
+ public Bar getBar() {
+ java.util.concurrent.atomic.AtomicReference<Bar> value = this.bar.get();
+ if (value == null) {
+ synchronized (this.bar) {
+ value = this.bar.get();
+ if (value == null) {
+ value = new java.util.concurrent.atomic.AtomicReference<Bar>(new Bar(){
+ public void setList(java.util.ArrayList<String> list) {
+ }
+ public int getInt() {
+ return 42;
+ }
+ });
+ this.bar.set(value);
+ }
+ }
+ }
+ return value.get();
+ }
+ @java.lang.SuppressWarnings("all")
+ public void setList(final java.util.ArrayList<java.lang.String> list) {
+ this.getBar().setList(list);
+ }
+ @java.lang.SuppressWarnings("all")
+ public int getInt() {
+ return this.getBar().getInt();
+ }
+} \ No newline at end of file
diff --git a/test/transform/resource/after-delombok/DelegateOnGetterNone.java b/test/transform/resource/after-delombok/DelegateOnGetterNone.java
new file mode 100644
index 00000000..b3258f25
--- /dev/null
+++ b/test/transform/resource/after-delombok/DelegateOnGetterNone.java
@@ -0,0 +1,15 @@
+class DelegateOnGetterNone {
+ private final Bar bar;
+ private interface Bar {
+ void setList(java.util.ArrayList<java.lang.String> list);
+ int getInt();
+ }
+ @java.lang.SuppressWarnings("all")
+ public void setList(final java.util.ArrayList<java.lang.String> list) {
+ this.bar.setList(list);
+ }
+ @java.lang.SuppressWarnings("all")
+ public int getInt() {
+ return this.bar.getInt();
+ }
+} \ No newline at end of file
diff --git a/test/transform/resource/after-delombok/DelegateOnMethods.java b/test/transform/resource/after-delombok/DelegateOnMethods.java
new file mode 100644
index 00000000..b900f140
--- /dev/null
+++ b/test/transform/resource/after-delombok/DelegateOnMethods.java
@@ -0,0 +1,12 @@
+abstract class DelegateOnMethods {
+ public abstract Bar getBar();
+
+ public static interface Bar {
+ void bar(java.util.ArrayList<java.lang.String> list);
+ }
+
+ @java.lang.SuppressWarnings("all")
+ public void bar(final java.util.ArrayList<java.lang.String> list) {
+ this.getBar().bar(list);
+ }
+} \ No newline at end of file
diff --git a/test/transform/resource/after-delombok/GetterNone.java b/test/transform/resource/after-delombok/GetterNone.java
new file mode 100644
index 00000000..11b4fd09
--- /dev/null
+++ b/test/transform/resource/after-delombok/GetterNone.java
@@ -0,0 +1,8 @@
+class GetterNone {
+ int i;
+ int foo;
+ @java.lang.SuppressWarnings("all")
+ public int getI() {
+ return this.i;
+ }
+} \ No newline at end of file
diff --git a/test/transform/resource/after-ecj/DelegateOnGetter.java b/test/transform/resource/after-ecj/DelegateOnGetter.java
new file mode 100644
index 00000000..cb06d3c1
--- /dev/null
+++ b/test/transform/resource/after-ecj/DelegateOnGetter.java
@@ -0,0 +1 @@
+//ignore \ No newline at end of file
diff --git a/test/transform/resource/after-ecj/DelegateOnGetterNone.java b/test/transform/resource/after-ecj/DelegateOnGetterNone.java
new file mode 100644
index 00000000..cb06d3c1
--- /dev/null
+++ b/test/transform/resource/after-ecj/DelegateOnGetterNone.java
@@ -0,0 +1 @@
+//ignore \ No newline at end of file
diff --git a/test/transform/resource/after-ecj/DelegateOnMethods.java b/test/transform/resource/after-ecj/DelegateOnMethods.java
new file mode 100644
index 00000000..cb06d3c1
--- /dev/null
+++ b/test/transform/resource/after-ecj/DelegateOnMethods.java
@@ -0,0 +1 @@
+//ignore \ No newline at end of file
diff --git a/test/transform/resource/after-ecj/GetterNone.java b/test/transform/resource/after-ecj/GetterNone.java
new file mode 100644
index 00000000..2ab252ea
--- /dev/null
+++ b/test/transform/resource/after-ecj/GetterNone.java
@@ -0,0 +1,12 @@
+import lombok.AccessLevel;
+import lombok.Getter;
+@Getter class GetterNone {
+ int i;
+ @Getter(AccessLevel.NONE) int foo;
+ public @java.lang.SuppressWarnings("all") int getI() {
+ return this.i;
+ }
+ GetterNone() {
+ super();
+ }
+} \ No newline at end of file
diff --git a/test/transform/resource/after-eclipse/DelegateOnGetter.java b/test/transform/resource/after-eclipse/DelegateOnGetter.java
new file mode 100644
index 00000000..7d5907e0
--- /dev/null
+++ b/test/transform/resource/after-eclipse/DelegateOnGetter.java
@@ -0,0 +1,40 @@
+import lombok.Delegate;
+import lombok.Getter;
+class DelegateOnGetter {
+ private interface Bar {
+ void setList(java.util.ArrayList<java.lang.String> list);
+ int getInt();
+ }
+ private final @Delegate @Getter(lazy = true) java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<Bar>> bar = new java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<Bar>>();
+ public @Delegate @java.lang.SuppressWarnings("all") Bar getBar() {
+ java.util.concurrent.atomic.AtomicReference<Bar> value = this.bar.get();
+ if ((value == null))
+ {
+ synchronized (this.bar)
+ {
+ value = this.bar.get();
+ if ((value == null))
+ {
+ value = new java.util.concurrent.atomic.AtomicReference<Bar>(new Bar() {
+ public void setList(java.util.ArrayList<String> list) {
+ }
+ public int getInt() {
+ return 42;
+ }
+});
+ this.bar.set(value);
+ }
+ }
+ }
+ return value.get();
+ }
+ public @java.lang.SuppressWarnings("all") int getInt() {
+ return this.getBar().getInt();
+ }
+ public @java.lang.SuppressWarnings("all") void setList(final java.util.ArrayList<java.lang.String> list) {
+ this.getBar().setList(list);
+ }
+ DelegateOnGetter() {
+ super();
+ }
+} \ No newline at end of file
diff --git a/test/transform/resource/after-eclipse/DelegateOnGetterNone.java b/test/transform/resource/after-eclipse/DelegateOnGetterNone.java
new file mode 100644
index 00000000..195797a8
--- /dev/null
+++ b/test/transform/resource/after-eclipse/DelegateOnGetterNone.java
@@ -0,0 +1,19 @@
+import lombok.AccessLevel;
+import lombok.Delegate;
+import lombok.Getter;
+@Getter class DelegateOnGetterNone {
+ private interface Bar {
+ void setList(java.util.ArrayList<java.lang.String> list);
+ int getInt();
+ }
+ private final @Delegate @Getter(AccessLevel.NONE) Bar bar;
+ public @java.lang.SuppressWarnings("all") int getInt() {
+ return this.bar.getInt();
+ }
+ public @java.lang.SuppressWarnings("all") void setList(final java.util.ArrayList<java.lang.String> list) {
+ this.bar.setList(list);
+ }
+ DelegateOnGetterNone() {
+ super();
+ }
+} \ No newline at end of file
diff --git a/test/transform/resource/after-eclipse/DelegateOnMethods.java b/test/transform/resource/after-eclipse/DelegateOnMethods.java
new file mode 100644
index 00000000..37922e2a
--- /dev/null
+++ b/test/transform/resource/after-eclipse/DelegateOnMethods.java
@@ -0,0 +1,13 @@
+import lombok.Delegate;
+abstract class DelegateOnMethods {
+ public static interface Bar {
+ void bar(java.util.ArrayList<java.lang.String> list);
+ }
+ public @java.lang.SuppressWarnings("all") void bar(final java.util.ArrayList<java.lang.String> list) {
+ this.getBar().bar(list);
+ }
+ DelegateOnMethods() {
+ super();
+ }
+ public abstract @Delegate Bar getBar();
+} \ No newline at end of file
diff --git a/test/transform/resource/after-eclipse/GetterNone.java b/test/transform/resource/after-eclipse/GetterNone.java
new file mode 100644
index 00000000..2ab252ea
--- /dev/null
+++ b/test/transform/resource/after-eclipse/GetterNone.java
@@ -0,0 +1,12 @@
+import lombok.AccessLevel;
+import lombok.Getter;
+@Getter class GetterNone {
+ int i;
+ @Getter(AccessLevel.NONE) int foo;
+ public @java.lang.SuppressWarnings("all") int getI() {
+ return this.i;
+ }
+ GetterNone() {
+ super();
+ }
+} \ No newline at end of file
diff --git a/test/transform/resource/before/DelegateOnGetter.java b/test/transform/resource/before/DelegateOnGetter.java
new file mode 100644
index 00000000..afe09ff4
--- /dev/null
+++ b/test/transform/resource/before/DelegateOnGetter.java
@@ -0,0 +1,18 @@
+import lombok.Delegate;
+import lombok.Getter;
+
+class DelegateOnGetter {
+
+ @Delegate @Getter(lazy=true) private final Bar bar = new Bar() {
+ public void setList(java.util.ArrayList<String> list) {
+ }
+ public int getInt() {
+ return 42;
+ }
+ };
+
+ private interface Bar {
+ void setList(java.util.ArrayList<java.lang.String> list);
+ int getInt();
+ }
+} \ No newline at end of file
diff --git a/test/transform/resource/before/DelegateOnGetterNone.java b/test/transform/resource/before/DelegateOnGetterNone.java
new file mode 100644
index 00000000..f9642e6b
--- /dev/null
+++ b/test/transform/resource/before/DelegateOnGetterNone.java
@@ -0,0 +1,14 @@
+import lombok.AccessLevel;
+import lombok.Delegate;
+import lombok.Getter;
+
+@Getter
+class DelegateOnGetterNone {
+
+ @Delegate @Getter(AccessLevel.NONE) private final Bar bar;
+
+ private interface Bar {
+ void setList(java.util.ArrayList<java.lang.String> list);
+ int getInt();
+ }
+}
diff --git a/test/transform/resource/before/DelegateOnMethods.java b/test/transform/resource/before/DelegateOnMethods.java
new file mode 100644
index 00000000..1606e18c
--- /dev/null
+++ b/test/transform/resource/before/DelegateOnMethods.java
@@ -0,0 +1,11 @@
+import lombok.Delegate;
+
+abstract class DelegateOnMethods {
+
+ @Delegate
+ public abstract Bar getBar();
+
+ public static interface Bar {
+ void bar(java.util.ArrayList<java.lang.String> list);
+ }
+} \ No newline at end of file
diff --git a/test/transform/resource/before/GetterNone.java b/test/transform/resource/before/GetterNone.java
new file mode 100644
index 00000000..8497e4fc
--- /dev/null
+++ b/test/transform/resource/before/GetterNone.java
@@ -0,0 +1,8 @@
+import lombok.AccessLevel;
+import lombok.Getter;
+
+@Getter
+class GetterNone {
+ int i;
+ @Getter(AccessLevel.NONE) int foo;
+} \ No newline at end of file