From 588a4a88c19103670bffb4bcc81fc203379253e9 Mon Sep 17 00:00:00 2001 From: Jan Rieke Date: Fri, 15 Jul 2022 13:04:31 +0200 Subject: [fix #3230] switch setter and self/build methods to allow overloaded self/build methods --- src/core/lombok/eclipse/handlers/HandleSuperBuilder.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/core/lombok/eclipse/handlers/HandleSuperBuilder.java') diff --git a/src/core/lombok/eclipse/handlers/HandleSuperBuilder.java b/src/core/lombok/eclipse/handlers/HandleSuperBuilder.java index 558c6ec2..9951d1ab 100644 --- a/src/core/lombok/eclipse/handlers/HandleSuperBuilder.java +++ b/src/core/lombok/eclipse/handlers/HandleSuperBuilder.java @@ -51,7 +51,6 @@ import org.eclipse.jdt.internal.compiler.ast.FieldDeclaration; import org.eclipse.jdt.internal.compiler.ast.FieldReference; import org.eclipse.jdt.internal.compiler.ast.IfStatement; import org.eclipse.jdt.internal.compiler.ast.Initializer; -import org.eclipse.jdt.internal.compiler.ast.MarkerAnnotation; import org.eclipse.jdt.internal.compiler.ast.MessageSend; import org.eclipse.jdt.internal.compiler.ast.MethodDeclaration; import org.eclipse.jdt.internal.compiler.ast.NullLiteral; @@ -387,16 +386,16 @@ public class HandleSuperBuilder extends EclipseAnnotationHandler { injectMethod(job.builderType, generateStaticFillValuesMethod(job, annInstance.setterPrefix())); } - // Generate abstract self() and build() methods in the abstract builder. - injectMethod(job.builderType, generateAbstractSelfMethod(job, superclassBuilderClass != null, builderGenericName)); - job.setBuilderToAbstract(); - injectMethod(job.builderType, generateAbstractBuildMethod(job, superclassBuilderClass != null, classGenericName)); - // Create the setter methods in the abstract builder. for (BuilderFieldData bfd : job.builderFields) { generateSetterMethodsForBuilder(job, bfd, builderGenericName, annInstance.setterPrefix()); } + // Generate abstract self() and build() methods in the abstract builder. + injectMethod(job.builderType, generateAbstractSelfMethod(job, superclassBuilderClass != null, builderGenericName)); + job.setBuilderToAbstract(); + injectMethod(job.builderType, generateAbstractBuildMethod(job, superclassBuilderClass != null, classGenericName)); + // Create the toString() method for the abstract builder. if (methodExists("toString", job.builderType, 0) == MemberExistsResult.NOT_EXISTS) { List> fieldNodes = new ArrayList>(); -- cgit