diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/core/lombok/eclipse/handlers/HandleBuilder.java | 13 | ||||
-rw-r--r-- | src/core/lombok/javac/handlers/HandleBuilder.java | 16 |
2 files changed, 19 insertions, 10 deletions
diff --git a/src/core/lombok/eclipse/handlers/HandleBuilder.java b/src/core/lombok/eclipse/handlers/HandleBuilder.java index 890a04bc..3391b99d 100755 --- a/src/core/lombok/eclipse/handlers/HandleBuilder.java +++ b/src/core/lombok/eclipse/handlers/HandleBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2018 The Project Lombok Authors. + * Copyright (C) 2013-2019 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 @@ -87,6 +87,7 @@ import lombok.core.HandlerPriority; import lombok.eclipse.Eclipse; import lombok.eclipse.EclipseAnnotationHandler; import lombok.eclipse.EclipseNode; +import lombok.eclipse.handlers.EclipseHandlerUtil.MemberExistsResult; import lombok.eclipse.handlers.EclipseSingularsRecipes.EclipseSingularizer; import lombok.eclipse.handlers.EclipseSingularsRecipes.SingularData; import lombok.eclipse.handlers.HandleConstructor.SkipIfConstructorExists; @@ -460,9 +461,13 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { makeSetterMethodsForBuilder(builderType, bfd, annotationNode, fluent, chain); } - if (methodExists(buildMethodName, builderType, -1) == MemberExistsResult.NOT_EXISTS) { - MethodDeclaration md = generateBuildMethod(tdParent, isStatic, buildMethodName, nameOfStaticBuilderMethod, returnType, builderFields, builderType, thrownExceptions, addCleaning, ast); - if (md != null) injectMethod(builderType, md); + { + MemberExistsResult methodExists = methodExists(buildMethodName, builderType, -1); + if (methodExists == MemberExistsResult.EXISTS_BY_LOMBOK) methodExists = methodExists(buildMethodName, builderType, 0); + if (methodExists == MemberExistsResult.NOT_EXISTS) { + MethodDeclaration md = generateBuildMethod(tdParent, isStatic, buildMethodName, nameOfStaticBuilderMethod, returnType, builderFields, builderType, thrownExceptions, addCleaning, ast); + if (md != null) injectMethod(builderType, md); + } } if (methodExists("toString", builderType, 0) == MemberExistsResult.NOT_EXISTS) { diff --git a/src/core/lombok/javac/handlers/HandleBuilder.java b/src/core/lombok/javac/handlers/HandleBuilder.java index 081123aa..c1e93547 100644 --- a/src/core/lombok/javac/handlers/HandleBuilder.java +++ b/src/core/lombok/javac/handlers/HandleBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2018 The Project Lombok Authors. + * Copyright (C) 2013-2019 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 @@ -405,11 +405,15 @@ public class HandleBuilder extends JavacAnnotationHandler<Builder> { makeSetterMethodsForBuilder(builderType, bfd, annotationNode, fluent, chain); } - if (methodExists(buildMethodName, builderType, -1) == MemberExistsResult.NOT_EXISTS) { - JCMethodDecl md = generateBuildMethod(tdParent, isStatic, buildMethodName, nameOfBuilderMethod, returnType, builderFields, builderType, thrownExceptions, ast, addCleaning); - if (md != null) { - injectMethod(builderType, md); - recursiveSetGeneratedBy(md, ast, annotationNode.getContext()); + { + MemberExistsResult methodExists = methodExists(builderMethodName, builderType, -1); + if (methodExists == MemberExistsResult.EXISTS_BY_LOMBOK) methodExists = methodExists(buildMethodName, builderType, 0); + if (methodExists == MemberExistsResult.NOT_EXISTS) { + JCMethodDecl md = generateBuildMethod(tdParent, isStatic, buildMethodName, nameOfBuilderMethod, returnType, builderFields, builderType, thrownExceptions, ast, addCleaning); + if (md != null) { + injectMethod(builderType, md); + recursiveSetGeneratedBy(md, ast, annotationNode.getContext()); + } } } |