aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2021-09-16 02:03:29 +0200
committerGitHub <noreply@github.com>2021-09-16 02:03:29 +0200
commit602a68b8f8ad0504b2aaf7c939328617dc2f2326 (patch)
treea71716d6a1cb520884b5ba98d25a3adb9e3a6d68 /test
parent8ed91a03622a083bd0062d8a236527d25f3ac178 (diff)
parentbd00fc4b83dd758c4369c8da97243691c04ac3fa (diff)
downloadlombok-602a68b8f8ad0504b2aaf7c939328617dc2f2326.tar.gz
lombok-602a68b8f8ad0504b2aaf7c939328617dc2f2326.tar.bz2
lombok-602a68b8f8ad0504b2aaf7c939328617dc2f2326.zip
Merge pull request #2840 from Rawi01/copy-vartype
Also copy vartype.type in TreeMirrorMaker
Diffstat (limited to 'test')
-rw-r--r--test/transform/resource/after-delombok/ValAnonymousSubclassSelfReference.java17
-rw-r--r--test/transform/resource/after-ecj/ValAnonymousSubclassSelfReference.java23
-rw-r--r--test/transform/resource/before/ValAnonymousSubclassSelfReference.java21
3 files changed, 61 insertions, 0 deletions
diff --git a/test/transform/resource/after-delombok/ValAnonymousSubclassSelfReference.java b/test/transform/resource/after-delombok/ValAnonymousSubclassSelfReference.java
new file mode 100644
index 00000000..a1176a3c
--- /dev/null
+++ b/test/transform/resource/after-delombok/ValAnonymousSubclassSelfReference.java
@@ -0,0 +1,17 @@
+import java.util.Map;
+import java.util.HashMap;
+
+public class ValAnonymousSubclassSelfReference {
+ public <T> void test(T arg) {
+ T d = arg;
+ Integer[] e = new Integer[1];
+ int[] f = new int[0];
+ java.util.Map<java.lang.String, Integer> g = new HashMap<String, Integer>();
+ Integer h = 0;
+ int i = 0;
+ final int j = 1;
+ final int k = 2;
+ new ValAnonymousSubclassSelfReference() {
+ };
+ }
+} \ No newline at end of file
diff --git a/test/transform/resource/after-ecj/ValAnonymousSubclassSelfReference.java b/test/transform/resource/after-ecj/ValAnonymousSubclassSelfReference.java
new file mode 100644
index 00000000..12b0f640
--- /dev/null
+++ b/test/transform/resource/after-ecj/ValAnonymousSubclassSelfReference.java
@@ -0,0 +1,23 @@
+import java.util.Map;
+import java.util.HashMap;
+import lombok.val;
+public class ValAnonymousSubclassSelfReference {
+ public ValAnonymousSubclassSelfReference() {
+ super();
+ }
+ public <T>void test(T arg) {
+ T d = arg;
+ Integer[] e = new Integer[1];
+ int[] f = new int[0];
+ java.util.Map<java.lang.String, Integer> g = new HashMap<String, Integer>();
+ Integer h = 0;
+ int i = 0;
+ final @val int j = 1;
+ final @val int k = 2;
+ new ValAnonymousSubclassSelfReference() {
+ x() {
+ super();
+ }
+ };
+ }
+} \ No newline at end of file
diff --git a/test/transform/resource/before/ValAnonymousSubclassSelfReference.java b/test/transform/resource/before/ValAnonymousSubclassSelfReference.java
new file mode 100644
index 00000000..e7c30c84
--- /dev/null
+++ b/test/transform/resource/before/ValAnonymousSubclassSelfReference.java
@@ -0,0 +1,21 @@
+// issue 2420: to trigger the problem 2 var/val, at least one normal variable and a anonymous self reference is required
+import java.util.Map;
+import java.util.HashMap;
+
+import lombok.val;
+
+public class ValAnonymousSubclassSelfReference {
+ public <T> void test(T arg) {
+ T d = arg;
+ Integer[] e = new Integer[1];
+ int[] f = new int[0];
+ java.util.Map<java.lang.String, Integer> g = new HashMap<String, Integer>();
+ Integer h = 0;
+ int i = 0;
+
+ val j = 1;
+ val k = 2;
+
+ new ValAnonymousSubclassSelfReference() { };
+ }
+} \ No newline at end of file