aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/javac/handlers
diff options
context:
space:
mode:
authorRoel Spilker <r.spilker@gmail.com>2018-01-08 22:00:28 +0100
committerRoel Spilker <r.spilker@gmail.com>2018-01-08 22:00:28 +0100
commit4dd59e07dadb6f0e1bdcfd50ea03a60d9da72f17 (patch)
tree34ab66b32517bcd37b3fa2a54f84336a28e0ecac /src/core/lombok/javac/handlers
parentad2194a3fb18fc70228bafe866964760a77258db (diff)
downloadlombok-4dd59e07dadb6f0e1bdcfd50ea03a60d9da72f17.tar.gz
lombok-4dd59e07dadb6f0e1bdcfd50ea03a60d9da72f17.tar.bz2
lombok-4dd59e07dadb6f0e1bdcfd50ea03a60d9da72f17.zip
jdk9 Builder.Default works again. Fixes #1547
Diffstat (limited to 'src/core/lombok/javac/handlers')
-rw-r--r--src/core/lombok/javac/handlers/HandleBuilder.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/core/lombok/javac/handlers/HandleBuilder.java b/src/core/lombok/javac/handlers/HandleBuilder.java
index 420d4b72..725a436e 100644
--- a/src/core/lombok/javac/handlers/HandleBuilder.java
+++ b/src/core/lombok/javac/handlers/HandleBuilder.java
@@ -554,11 +554,10 @@ public class HandleBuilder extends JavacAnnotationHandler<Builder> {
ListBuffer<JCExpression> args = new ListBuffer<JCExpression>();
for (BuilderFieldData bfd : builderFields) {
if (bfd.nameOfSetFlag != null) {
- args.append(maker.Conditional(maker.Ident(bfd.nameOfSetFlag), maker.Ident(bfd.name),
- maker.Apply(typeParameterNames(maker, ((JCClassDecl) tdParent.get()).typarams), maker.Select(maker.Ident(((JCClassDecl) tdParent.get()).name), bfd.nameOfDefaultProvider), List.<JCExpression>nil())));
- } else {
- args.append(maker.Ident(bfd.name));
+ statements.append(maker.VarDef(maker.Modifiers(0L), bfd.name, cloneType(maker, bfd.type, source, tdParent.getContext()), maker.Select(maker.Ident(type.toName("this")), bfd.name)));
+ statements.append(maker.If(maker.Unary(CTC_NOT, maker.Ident(bfd.nameOfSetFlag)), maker.Exec(maker.Assign(maker.Ident(bfd.name),maker.Apply(typeParameterNames(maker, ((JCClassDecl) tdParent.get()).typarams), maker.Select(maker.Ident(((JCClassDecl) tdParent.get()).name), bfd.nameOfDefaultProvider), List.<JCExpression>nil()))), null));
}
+ args.append(maker.Ident(bfd.name));
}
if (addCleaning) {