diff options
author | Jan Rieke <rieke@subshell.com> | 2018-08-21 12:47:52 +0200 |
---|---|---|
committer | Roel Spilker <r.spilker@gmail.com> | 2018-08-27 21:38:19 +0200 |
commit | ca2b8c281b6efd1ebc99b212483c9751834f570b (patch) | |
tree | 57905dc938ee922f4ef3cfdf7b0858665eb9ea9c /src/core/lombok/javac/handlers | |
parent | e23cf0bcbeb2f5562adf0512048766712ac83774 (diff) | |
download | lombok-ca2b8c281b6efd1ebc99b212483c9751834f570b.tar.gz lombok-ca2b8c281b6efd1ebc99b212483c9751834f570b.tar.bz2 lombok-ca2b8c281b6efd1ebc99b212483c9751834f570b.zip |
SuperBuilder now with generics on self() method
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 aaf94dd8..18e74908 100644 --- a/src/core/lombok/javac/handlers/HandleSuperBuilder.java +++ b/src/core/lombok/javac/handlers/HandleSuperBuilder.java @@ -286,7 +286,7 @@ public class HandleSuperBuilder extends JavacAnnotationHandler<SuperBuilder> { if (cd != null) injectMethod(builderImplType, cd); // Create the self() and build() methods in the BuilderImpl. - injectMethod(builderImplType, generateSelfMethod(builderImplType)); + injectMethod(builderImplType, generateSelfMethod(builderImplType, typeParams)); injectMethod(builderImplType, generateBuildMethod(buildMethodName, returnType, builderImplType, thrownExceptions)); recursiveSetGeneratedBy(builderImplType.get(), ast, annotationNode.getContext()); @@ -509,14 +509,14 @@ public class HandleSuperBuilder extends JavacAnnotationHandler<SuperBuilder> { return maker.MethodDef(modifiers, name, returnType, List.<JCTypeParameter>nil(), List.<JCVariableDecl>nil(), List.<JCExpression>nil(), null, null); } - private JCMethodDecl generateSelfMethod(JavacNode builderImplType) { + private JCMethodDecl generateSelfMethod(JavacNode builderImplType, List<JCTypeParameter> typeParams) { JavacTreeMaker maker = builderImplType.getTreeMaker(); JCAnnotation overrideAnnotation = maker.Annotation(genJavaLangTypeRef(builderImplType, "Override"), List.<JCExpression>nil()); JCModifiers modifiers = maker.Modifiers(Flags.PROTECTED, List.of(overrideAnnotation)); Name name = builderImplType.toName(SELF_METHOD); - JCExpression returnType = maker.Ident(builderImplType.toName(builderImplType.getName())); + JCExpression returnType = namePlusTypeParamsToTypeReference(maker, builderImplType.toName(builderImplType.getName()), typeParams); JCStatement statement = maker.Return(maker.Ident(builderImplType.toName("this"))); JCBlock body = maker.Block(0, List.<JCStatement>of(statement)); |