diff options
author | Emil Lundberg <emil@emlun.se> | 2019-01-13 01:12:59 +0100 |
---|---|---|
committer | Emil Lundberg <emil@emlun.se> | 2019-01-13 02:38:14 +0100 |
commit | f6d2933795d9091d0cace8d81df530967d84a779 (patch) | |
tree | d9b7d4ef7489a3e6293feda21b46421aa1e06000 /src/core/lombok/javac/handlers/singulars | |
parent | a633e395883d5d24806204a0c10d2ae5b008b8d8 (diff) | |
download | lombok-f6d2933795d9091d0cace8d81df530967d84a779.tar.gz lombok-f6d2933795d9091d0cace8d81df530967d84a779.tar.bz2 lombok-f6d2933795d9091d0cace8d81df530967d84a779.zip |
Pull useGuavaInstead logic up to JavacSingularizer
Diffstat (limited to 'src/core/lombok/javac/handlers/singulars')
3 files changed, 4 insertions, 16 deletions
diff --git a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java index 856a2295..c5cd0738 100644 --- a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java +++ b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java @@ -45,12 +45,8 @@ import com.sun.tools.javac.util.Name; abstract class JavacJavaUtilListSetSingularizer extends JavacJavaUtilSingularizer { - @Override - protected JavacSingularizer getGuavaInsteadIfNeeded(JavacNode node) { - if (useGuavaInstead(node)) { - return guavaListSetSingularizer; - } - return this; + @Override protected JavacSingularizer getGuavaInstead(JavacNode node) { + return guavaListSetSingularizer; } @Override public java.util.List<Name> listFieldsToBeGenerated(SingularData data, JavacNode builderType) { diff --git a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java index c2c1f233..69215c11 100644 --- a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java +++ b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java @@ -53,12 +53,8 @@ public class JavacJavaUtilMapSingularizer extends JavacJavaUtilSingularizer { return LombokImmutableList.of("java.util.Map", "java.util.SortedMap", "java.util.NavigableMap"); } - @Override - protected JavacSingularizer getGuavaInsteadIfNeeded(JavacNode node) { - if (useGuavaInstead(node)) { - return guavaMapSingularizer; - } - return this; + @Override protected JavacSingularizer getGuavaInstead(JavacNode node) { + return guavaMapSingularizer; } @Override public java.util.List<Name> listFieldsToBeGenerated(SingularData data, JavacNode builderType) { diff --git a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilSingularizer.java b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilSingularizer.java index df521fd8..47098467 100644 --- a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilSingularizer.java +++ b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilSingularizer.java @@ -42,10 +42,6 @@ abstract class JavacJavaUtilSingularizer extends JavacSingularizer { protected final JavacSingularizer guavaListSetSingularizer = new JavacGuavaSetListSingularizer(); protected final JavacSingularizer guavaMapSingularizer = new JavacGuavaMapSingularizer(); - protected boolean useGuavaInstead(JavacNode node) { - return Boolean.TRUE.equals(node.getAst().readConfiguration(ConfigurationKeys.SINGULAR_USE_GUAVA)); - } - protected List<JCStatement> createJavaUtilSetMapInitialCapacitySwitchStatements(JavacTreeMaker maker, SingularData data, JavacNode builderType, boolean mapMode, String emptyCollectionMethod, String singletonCollectionMethod, String targetType, JCTree source, String builderVariable) { List<JCExpression> jceBlank = List.nil(); ListBuffer<JCCase> cases = new ListBuffer<JCCase>(); |