aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/javac/handlers/HandleSuperBuilder.java
diff options
context:
space:
mode:
authorJan Rieke <it@janrieke.de>2018-04-16 20:21:02 +0200
committerJan Rieke <it@janrieke.de>2018-04-16 20:21:02 +0200
commit460c70890cea12e0224d8b978b36bfc89b3b0e1e (patch)
tree641c5078c0f4f6e753ca927e18bf69d9c45c413c /src/core/lombok/javac/handlers/HandleSuperBuilder.java
parent054a966bad3037a758af50d5801461c8995fffa9 (diff)
downloadlombok-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/HandleSuperBuilder.java')
-rw-r--r--src/core/lombok/javac/handlers/HandleSuperBuilder.java6
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);
}