aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/javac/handlers/JavacHandlerUtil.java
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2018-09-04 01:53:07 +0200
committerReinier Zwitserloot <reinier@zwitserloot.com>2018-09-04 01:54:49 +0200
commita39ef3ba0cae1fd6038c4407ec7e66f9bf0f5ea2 (patch)
treedc934ba79df1a2b071a3695779b8961e5fdea519 /src/core/lombok/javac/handlers/JavacHandlerUtil.java
parentaf55bd0a328aa05f3ffb53a57a37306d1372a478 (diff)
downloadlombok-a39ef3ba0cae1fd6038c4407ec7e66f9bf0f5ea2.tar.gz
lombok-a39ef3ba0cae1fd6038c4407ec7e66f9bf0f5ea2.tar.bz2
lombok-a39ef3ba0cae1fd6038c4407ec7e66f9bf0f5ea2.zip
[issue #1851] Lombok needs to generate type-use annotations when copying over types from, say, a field, to getter/setter/constructor/builder/wither/etc.
Diffstat (limited to 'src/core/lombok/javac/handlers/JavacHandlerUtil.java')
-rw-r--r--src/core/lombok/javac/handlers/JavacHandlerUtil.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/lombok/javac/handlers/JavacHandlerUtil.java b/src/core/lombok/javac/handlers/JavacHandlerUtil.java
index 570d1a7e..92c642d4 100644
--- a/src/core/lombok/javac/handlers/JavacHandlerUtil.java
+++ b/src/core/lombok/javac/handlers/JavacHandlerUtil.java
@@ -1583,6 +1583,14 @@ public class JavacHandlerUtil {
return node;
}
+ public static List<JCExpression> cloneTypes(JavacTreeMaker maker, List<JCExpression> in, JCTree source, Context context) {
+ if (in.isEmpty()) return List.nil();
+ if (in.size() == 1) return List.of(cloneType(maker, in.get(0), source, context));
+ ListBuffer<JCExpression> lb = new ListBuffer<JCExpression>();
+ for (JCExpression expr : in) lb.append(cloneType(maker, expr, source, context));
+ return lb.toList();
+ }
+
/**
* Creates a full clone of a given javac AST type node. Every part is cloned (every identifier, every select, every wildcard, every type apply).
*