From 4dd59e07dadb6f0e1bdcfd50ea03a60d9da72f17 Mon Sep 17 00:00:00 2001 From: Roel Spilker Date: Mon, 8 Jan 2018 22:00:28 +0100 Subject: jdk9 Builder.Default works again. Fixes #1547 --- src/core/lombok/javac/handlers/HandleBuilder.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src') 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 { ListBuffer args = new ListBuffer(); 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.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.nil()))), null)); } + args.append(maker.Ident(bfd.name)); } if (addCleaning) { -- cgit