aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/javac/handlers/JavacSingularsRecipes.java
diff options
context:
space:
mode:
authorReinier Zwitserloot <r.zwitserloot@projectlombok.org>2021-03-13 04:53:44 +0100
committerReinier Zwitserloot <r.zwitserloot@projectlombok.org>2021-03-13 04:53:44 +0100
commite8cd744d3b2d986dd847b9ff6bdf2750a8dd6764 (patch)
tree6e7e21207fb5475534d10234617dca1e071f9fd5 /src/core/lombok/javac/handlers/JavacSingularsRecipes.java
parentc1bf4ec3b66cf6632cfd3e554d59ad4f8ad1b3b8 (diff)
downloadlombok-e8cd744d3b2d986dd847b9ff6bdf2750a8dd6764.tar.gz
lombok-e8cd744d3b2d986dd847b9ff6bdf2750a8dd6764.tar.bz2
lombok-e8cd744d3b2d986dd847b9ff6bdf2750a8dd6764.zip
[superbuilder] toBuilder + singular + javac6 was broken
superbuilder generated the node `x.pluralName(plural == null ? Collections.emptyList() : plural)`. java6 is not smart enough to infer the appropriate generics for the emptyList() call. Fixed by always specifying the needed type explicitly: Collections.<String>emptyList();
Diffstat (limited to 'src/core/lombok/javac/handlers/JavacSingularsRecipes.java')
-rw-r--r--src/core/lombok/javac/handlers/JavacSingularsRecipes.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/lombok/javac/handlers/JavacSingularsRecipes.java b/src/core/lombok/javac/handlers/JavacSingularsRecipes.java
index 15607ce0..4ca09b82 100644
--- a/src/core/lombok/javac/handlers/JavacSingularsRecipes.java
+++ b/src/core/lombok/javac/handlers/JavacSingularsRecipes.java
@@ -501,5 +501,11 @@ public class JavacSingularsRecipes {
protected abstract int getTypeArgumentsCount();
protected abstract String getEmptyMaker(String target);
+
+ public JCExpression getEmptyExpression(String target, JavacTreeMaker maker, SingularData data, JavacNode builderType, JavacNode source) {
+ String emptyMaker = getEmptyMaker(target);
+ List<JCExpression> typeArgs = createTypeArgs(getTypeArgumentsCount(), false, builderType, data.getTypeArgs(), source);
+ return maker.Apply(typeArgs, chainDots(builderType, emptyMaker.split("\\.")), List.<JCExpression>nil());
+ }
}
}