diff options
author | Bulgakov Alexander <buls@yandex.ru> | 2019-05-20 13:10:14 +0300 |
---|---|---|
committer | Bulgakov Alexander <buls@yandex.ru> | 2019-05-20 13:10:14 +0300 |
commit | 71aea086e4fa9d3fa77e29c5a208ef8e7458c387 (patch) | |
tree | c6b4aac622fa9e88210bbc0b813f8d3cbd7079b5 /src/core/lombok/eclipse | |
parent | 1fec035aa546b7a033acb67cf4f7c1afb8a79f52 (diff) | |
parent | c479920db17e36392fa69e386156c982fe60cc27 (diff) | |
download | lombok-71aea086e4fa9d3fa77e29c5a208ef8e7458c387.tar.gz lombok-71aea086e4fa9d3fa77e29c5a208ef8e7458c387.tar.bz2 lombok-71aea086e4fa9d3fa77e29c5a208ef8e7458c387.zip |
Merge branch 'master' into feature/typeInferenceImprovements
Diffstat (limited to 'src/core/lombok/eclipse')
-rwxr-xr-x | src/core/lombok/eclipse/handlers/HandleConstructor.java | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/core/lombok/eclipse/handlers/HandleConstructor.java b/src/core/lombok/eclipse/handlers/HandleConstructor.java index 660b9985..c6b51042 100755 --- a/src/core/lombok/eclipse/handlers/HandleConstructor.java +++ b/src/core/lombok/eclipse/handlers/HandleConstructor.java @@ -242,8 +242,7 @@ public class HandleConstructor { ASTNode source = sourceNode.get(); boolean staticConstrRequired = staticName != null && !staticName.equals(""); - - if (skipIfConstructorExists != SkipIfConstructorExists.NO && constructorExists(typeNode) != MemberExistsResult.NOT_EXISTS) return; + if (skipIfConstructorExists != SkipIfConstructorExists.NO) { for (EclipseNode child : typeNode.down()) { if (child.getKind() == Kind.ANNOTATION) { @@ -273,12 +272,18 @@ public class HandleConstructor { if (noArgs && noArgsConstructorExists(typeNode)) return; - ConstructorDeclaration constr = createConstructor( - staticConstrRequired ? AccessLevel.PRIVATE : level, typeNode, fieldsToParam, forceDefaults, - sourceNode, onConstructor); - injectMethod(typeNode, constr); + if (!(skipIfConstructorExists != SkipIfConstructorExists.NO && constructorExists(typeNode) != MemberExistsResult.NOT_EXISTS)) { + ConstructorDeclaration constr = createConstructor( + staticConstrRequired ? AccessLevel.PRIVATE : level, typeNode, fieldsToParam, forceDefaults, + sourceNode, onConstructor); + injectMethod(typeNode, constr); + } + generateStaticConstructor(staticConstrRequired, typeNode, staticName, level, fieldsToParam, source); + } + + private void generateStaticConstructor(boolean staticConstrRequired, EclipseNode typeNode, String staticName, AccessLevel level, Collection<EclipseNode> fields, ASTNode source) { if (staticConstrRequired) { - MethodDeclaration staticConstr = createStaticConstructor(level, staticName, typeNode, fieldsToParam, source); + MethodDeclaration staticConstr = createStaticConstructor(level, staticName, typeNode, fields, source); injectMethod(typeNode, staticConstr); } } |