aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmil Lundberg <emil@emlun.se>2019-01-10 02:53:47 +0100
committerEmil Lundberg <emil@emlun.se>2019-01-13 02:13:57 +0100
commit85759a1949fe862a2baa2cb836d0bbea5349db66 (patch)
tree189ed389ba18cc72d795ee4dd88d7b652a9016b9
parentf84349965803816d46473b42d08ed0c0d288ce8a (diff)
downloadlombok-85759a1949fe862a2baa2cb836d0bbea5349db66.tar.gz
lombok-85759a1949fe862a2baa2cb836d0bbea5349db66.tar.bz2
lombok-85759a1949fe862a2baa2cb836d0bbea5349db66.zip
Detangle key/value param creation in JavacJavaUtilMapSingularizer.generateSingularMethod
-rw-r--r--src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java
index c7483be6..9373512a 100644
--- a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java
+++ b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java
@@ -149,15 +149,17 @@ public class JavacJavaUtilMapSingularizer extends JavacJavaUtilSingularizer {
Name name = data.getSingularName();
if (!fluent) name = builderType.toName(HandlerUtil.buildAccessorName("put", name.toString()));
+
JCExpression paramTypeKey = cloneParamType(0, maker, data.getTypeArgs(), builderType, source);
- JCExpression paramTypeValue = cloneParamType(1, maker, data.getTypeArgs(), builderType, source);
List<JCAnnotation> typeUseAnnsKey = getTypeUseAnnotations(paramTypeKey);
- List<JCAnnotation> typeUseAnnsValue = getTypeUseAnnotations(paramTypeValue);
paramTypeKey = removeTypeUseAnnotations(paramTypeKey);
- paramTypeValue = removeTypeUseAnnotations(paramTypeValue);
JCModifiers paramModsKey = typeUseAnnsKey.isEmpty() ? maker.Modifiers(paramFlags) : maker.Modifiers(paramFlags, typeUseAnnsKey);
- JCModifiers paramModsValue = typeUseAnnsValue.isEmpty() ? maker.Modifiers(paramFlags) : maker.Modifiers(paramFlags, typeUseAnnsValue);
JCVariableDecl paramKey = maker.VarDef(paramModsKey, keyName, paramTypeKey, null);
+
+ JCExpression paramTypeValue = cloneParamType(1, maker, data.getTypeArgs(), builderType, source);
+ List<JCAnnotation> typeUseAnnsValue = getTypeUseAnnotations(paramTypeValue);
+ paramTypeValue = removeTypeUseAnnotations(paramTypeValue);
+ JCModifiers paramModsValue = typeUseAnnsValue.isEmpty() ? maker.Modifiers(paramFlags) : maker.Modifiers(paramFlags, typeUseAnnsValue);
JCVariableDecl paramValue = maker.VarDef(paramModsValue, valueName, paramTypeValue, null);
finishAndInjectMethod(maker, returnType, builderType, source, mods, body, name, List.of(paramKey, paramValue));
}