From 258a9bf2886e841f2921208d44bd380d900ccc37 Mon Sep 17 00:00:00 2001 From: Emil Lundberg Date: Sun, 13 Jan 2019 01:32:55 +0100 Subject: Push Guava singularizer instances down from JavacJavaUtilSingularizer --- .../javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java | 1 + .../lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java | 2 ++ src/core/lombok/javac/handlers/singulars/JavacJavaUtilSingularizer.java | 2 -- 3 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src/core/lombok') diff --git a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java index c5cd0738..26054203 100644 --- a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java +++ b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java @@ -44,6 +44,7 @@ import com.sun.tools.javac.util.ListBuffer; import com.sun.tools.javac.util.Name; abstract class JavacJavaUtilListSetSingularizer extends JavacJavaUtilSingularizer { + private final JavacSingularizer guavaListSetSingularizer = new JavacGuavaSetListSingularizer(); @Override protected JavacSingularizer getGuavaInstead(JavacNode node) { return guavaListSetSingularizer; diff --git a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java index 69215c11..1d4d8eee 100644 --- a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java +++ b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java @@ -49,6 +49,8 @@ import com.sun.tools.javac.util.Name; @ProviderFor(JavacSingularizer.class) public class JavacJavaUtilMapSingularizer extends JavacJavaUtilSingularizer { + private final JavacSingularizer guavaMapSingularizer = new JavacGuavaMapSingularizer(); + @Override public LombokImmutableList getSupportedTypes() { return LombokImmutableList.of("java.util.Map", "java.util.SortedMap", "java.util.NavigableMap"); } diff --git a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilSingularizer.java b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilSingularizer.java index 47098467..8c22a41e 100644 --- a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilSingularizer.java +++ b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilSingularizer.java @@ -39,8 +39,6 @@ import lombok.javac.handlers.JavacSingularsRecipes.JavacSingularizer; import lombok.javac.handlers.JavacSingularsRecipes.SingularData; abstract class JavacJavaUtilSingularizer extends JavacSingularizer { - protected final JavacSingularizer guavaListSetSingularizer = new JavacGuavaSetListSingularizer(); - protected final JavacSingularizer guavaMapSingularizer = new JavacGuavaMapSingularizer(); protected List createJavaUtilSetMapInitialCapacitySwitchStatements(JavacTreeMaker maker, SingularData data, JavacNode builderType, boolean mapMode, String emptyCollectionMethod, String singletonCollectionMethod, String targetType, JCTree source, String builderVariable) { List jceBlank = List.nil(); -- cgit