aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/javac/handlers/JavacHandlerUtil.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/lombok/javac/handlers/JavacHandlerUtil.java')
-rw-r--r--src/core/lombok/javac/handlers/JavacHandlerUtil.java19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/core/lombok/javac/handlers/JavacHandlerUtil.java b/src/core/lombok/javac/handlers/JavacHandlerUtil.java
index 23206b43..956ab446 100644
--- a/src/core/lombok/javac/handlers/JavacHandlerUtil.java
+++ b/src/core/lombok/javac/handlers/JavacHandlerUtil.java
@@ -1388,17 +1388,18 @@ public class JavacHandlerUtil {
}
public static JCExpression namePlusTypeParamsToTypeReference(JavacTreeMaker maker, Name typeName, List<JCTypeParameter> params) {
+ if (params.isEmpty()) {
+ return maker.Ident(typeName);
+ }
+ return maker.TypeApply(maker.Ident(typeName), typeParameterNames(maker, params));
+ }
+
+ public static List<JCExpression> typeParameterNames(JavacTreeMaker maker, List<JCTypeParameter> params) {
ListBuffer<JCExpression> typeArgs = new ListBuffer<JCExpression>();
-
- if (!params.isEmpty()) {
- for (JCTypeParameter param : params) {
- typeArgs.append(maker.Ident(param.name));
- }
-
- return maker.TypeApply(maker.Ident(typeName), typeArgs.toList());
+ for (JCTypeParameter param : params) {
+ typeArgs.append(maker.Ident(param.name));
}
-
- return maker.Ident(typeName);
+ return typeArgs.toList();
}
public static void sanityCheckForMethodGeneratingAnnotationsOnBuilderClass(JavacNode typeNode, JavacNode errorNode) {