aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/javac/handlers/HandleBuilder.java
diff options
context:
space:
mode:
authorcnuessgens <christian@nuessgens.com>2018-01-18 21:18:14 +0100
committercnuessgens <christian@nuessgens.com>2018-01-18 21:18:14 +0100
commit1b6de01bf187def687cb0e757da4295b0790f0ac (patch)
treef86c0951a8669fb67689a92fd9059df7589d17da /src/core/lombok/javac/handlers/HandleBuilder.java
parentcdee2996514723dfbcf6ac177d82446acef260f3 (diff)
parent01754d914056b3baa0a6bfe3b20bf5c40f6a5199 (diff)
downloadlombok-1b6de01bf187def687cb0e757da4295b0790f0ac.tar.gz
lombok-1b6de01bf187def687cb0e757da4295b0790f0ac.tar.bz2
lombok-1b6de01bf187def687cb0e757da4295b0790f0ac.zip
Merge remote-tracking branch 'remotes/upstream/master'
Diffstat (limited to 'src/core/lombok/javac/handlers/HandleBuilder.java')
-rw-r--r--src/core/lombok/javac/handlers/HandleBuilder.java9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/core/lombok/javac/handlers/HandleBuilder.java b/src/core/lombok/javac/handlers/HandleBuilder.java
index 420d4b72..d5a342e4 100644
--- a/src/core/lombok/javac/handlers/HandleBuilder.java
+++ b/src/core/lombok/javac/handlers/HandleBuilder.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013-2017 The Project Lombok Authors.
+ * Copyright (C) 2013-2018 The Project Lombok Authors.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -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) {