From e8cd744d3b2d986dd847b9ff6bdf2750a8dd6764 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Sat, 13 Mar 2021 04:53:44 +0100 Subject: [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.emptyList(); --- src/core/lombok/javac/handlers/JavacSingularsRecipes.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/core/lombok/javac/handlers/JavacSingularsRecipes.java') 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 typeArgs = createTypeArgs(getTypeArgumentsCount(), false, builderType, data.getTypeArgs(), source); + return maker.Apply(typeArgs, chainDots(builderType, emptyMaker.split("\\.")), List.nil()); + } } } -- cgit