aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/javac/handlers/singulars
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2015-01-30 15:49:36 +0100
committerReinier Zwitserloot <reinier@zwitserloot.com>2015-01-30 15:49:36 +0100
commit26b2fb5cd6d4d73b270be3787fa876cc1bfe80f2 (patch)
treec3cccc68a0a4da222966fef26d096725b678b14a /src/core/lombok/javac/handlers/singulars
parenta7bd812893ecb1fa603229d81c924823426ea973 (diff)
downloadlombok-26b2fb5cd6d4d73b270be3787fa876cc1bfe80f2.tar.gz
lombok-26b2fb5cd6d4d73b270be3787fa876cc1bfe80f2.tar.bz2
lombok-26b2fb5cd6d4d73b270be3787fa876cc1bfe80f2.zip
* the j.u.List recipe is now used to singularize java.lang.Iterables.
* Code gen for builder now adheres to format options when delomboking (doesn’t generate java.lang. FQNs if you ask it not to do that).
Diffstat (limited to 'src/core/lombok/javac/handlers/singulars')
-rw-r--r--src/core/lombok/javac/handlers/singulars/JavacGuavaSingularizer.java2
-rw-r--r--src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSingularizer.java2
-rw-r--r--src/core/lombok/javac/handlers/singulars/JavacJavaUtilSingularizer.java2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/core/lombok/javac/handlers/singulars/JavacGuavaSingularizer.java b/src/core/lombok/javac/handlers/singulars/JavacGuavaSingularizer.java
index 2474ce7b..e23837dc 100644
--- a/src/core/lombok/javac/handlers/singulars/JavacGuavaSingularizer.java
+++ b/src/core/lombok/javac/handlers/singulars/JavacGuavaSingularizer.java
@@ -140,7 +140,7 @@ abstract class JavacGuavaSingularizer extends JavacSingularizer {
if (mapMode) {
paramType = chainDots(builderType, "java", "util", "Map");
} else {
- paramType = chainDots(builderType, "java", "lang", "Iterable");
+ paramType = genJavaLangTypeRef(builderType, "Iterable");
}
paramType = addTypeArgs(mapMode ? 2 : 1, true, builderType, paramType, data.getTypeArgs(), source);
JCVariableDecl param = maker.VarDef(maker.Modifiers(paramFlags), data.getPluralName(), paramType, null);
diff --git a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSingularizer.java b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSingularizer.java
index 65e91fa0..9ec77e78 100644
--- a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSingularizer.java
+++ b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSingularizer.java
@@ -43,7 +43,7 @@ import com.sun.tools.javac.util.Name;
@ProviderFor(JavacSingularizer.class)
public class JavacJavaUtilListSingularizer extends JavacJavaUtilListSetSingularizer {
@Override public LombokImmutableList<String> getSupportedTypes() {
- return LombokImmutableList.of("java.util.List", "java.util.Collection", "java.util.Iterable");
+ return LombokImmutableList.of("java.util.List", "java.util.Collection", "java.lang.Iterable");
}
@Override public void appendBuildCode(SingularData data, JavacNode builderType, JCTree source, ListBuffer<JCStatement> statements, Name targetVariableName) {
diff --git a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilSingularizer.java b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilSingularizer.java
index c75dfbdd..f419a014 100644
--- a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilSingularizer.java
+++ b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilSingularizer.java
@@ -137,7 +137,7 @@ abstract class JavacJavaUtilSingularizer extends JavacSingularizer {
// this.varName.size() < MAX_POWER_OF_2 ? 1 + this.varName.size() + (this.varName.size() - 3) / 3 : Integer.MAX_VALUE;
// lessThanCutOff = this.varName.size() < MAX_POWER_OF_2
JCExpression lessThanCutoff = maker.Binary(CTC_LESS_THAN, getSize(maker, builderType, varName, nullGuard), maker.Literal(CTC_INT, 0x40000000));
- JCExpression integerMaxValue = chainDots(builderType, "java", "lang", "Integer", "MAX_VALUE");
+ JCExpression integerMaxValue = genJavaLangTypeRef(builderType, "Integer", "MAX_VALUE");
JCExpression sizeFormulaLeft = maker.Binary(CTC_PLUS, maker.Literal(CTC_INT, 1), getSize(maker, builderType, varName, nullGuard));
JCExpression sizeFormulaRightLeft = maker.Binary(CTC_MINUS, getSize(maker, builderType, varName, nullGuard), maker.Literal(CTC_INT, 3));
JCExpression sizeFormulaRight = maker.Binary(CTC_DIV, sizeFormulaRightLeft, maker.Literal(CTC_INT, 3));