diff options
author | Jan Rieke <it@janrieke.de> | 2018-04-16 20:21:02 +0200 |
---|---|---|
committer | Jan Rieke <it@janrieke.de> | 2018-04-16 20:21:02 +0200 |
commit | 460c70890cea12e0224d8b978b36bfc89b3b0e1e (patch) | |
tree | 641c5078c0f4f6e753ca927e18bf69d9c45c413c /src/core/lombok/javac/handlers | |
parent | 054a966bad3037a758af50d5801461c8995fffa9 (diff) | |
download | lombok-460c70890cea12e0224d8b978b36bfc89b3b0e1e.tar.gz lombok-460c70890cea12e0224d8b978b36bfc89b3b0e1e.tar.bz2 lombok-460c70890cea12e0224d8b978b36bfc89b3b0e1e.zip |
let @SuperBuilder's toString() call super.toString()
Diffstat (limited to 'src/core/lombok/javac/handlers')
-rw-r--r-- | src/core/lombok/javac/handlers/HandleSuperBuilder.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/lombok/javac/handlers/HandleSuperBuilder.java b/src/core/lombok/javac/handlers/HandleSuperBuilder.java index 31976447..bd0f3b70 100644 --- a/src/core/lombok/javac/handlers/HandleSuperBuilder.java +++ b/src/core/lombok/javac/handlers/HandleSuperBuilder.java @@ -181,7 +181,7 @@ public class HandleSuperBuilder extends JavacAnnotationHandler<SuperBuilder> { String superclassBuilderClassName = extendsClause.toString() + "Builder"; superclassBuilderClassExpression = chainDots(tdParent, extendsClause.toString(), superclassBuilderClassName); } - // If there is no superclass, superclassBuilderClassName is still == null at this point. + // If there is no superclass, superclassBuilderClassExpression is still == null at this point. // You can use it to check whether to inherit or not. returnType = namePlusTypeParamsToTypeReference(tdParent.getTreeMaker(), td.name, td.typarams); @@ -257,8 +257,8 @@ public class HandleSuperBuilder extends JavacAnnotationHandler<SuperBuilder> { for (BuilderFieldData bfd : builderFields) { fieldNodes.addAll(bfd.createdFields); } - // TODO: toString() should also call super.toString(), so that it also shows fields from the superclass. - JCMethodDecl md = HandleToString.createToString(builderType, fieldNodes, true, false, FieldAccess.ALWAYS_FIELD, ast); + // Let toString() call super.toString() if there is a superclass, so that it also shows fields from the superclass' builder. + JCMethodDecl md = HandleToString.createToString(builderType, fieldNodes, true, superclassBuilderClassExpression != null, FieldAccess.ALWAYS_FIELD, ast); if (md != null) injectMethod(builderType, md); } |