diff options
author | Jan Rieke <rieke@subshell.com> | 2018-09-24 09:26:37 +0200 |
---|---|---|
committer | Jan Rieke <rieke@subshell.com> | 2018-09-24 09:26:37 +0200 |
commit | 279ceaa72795ea7b427ab37535892e3c5cbde958 (patch) | |
tree | c8d78adb99f3a7bb34dc63721429a5fb4e3a6489 /src | |
parent | 68318742ef2e4f6b680ea90a279c2c96da7c2d74 (diff) | |
download | lombok-279ceaa72795ea7b427ab37535892e3c5cbde958.tar.gz lombok-279ceaa72795ea7b427ab37535892e3c5cbde958.tar.bz2 lombok-279ceaa72795ea7b427ab37535892e3c5cbde958.zip |
SuperBuilder toBuilder with generics (ecj)
Diffstat (limited to 'src')
-rw-r--r-- | src/core/lombok/eclipse/handlers/HandleSuperBuilder.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/core/lombok/eclipse/handlers/HandleSuperBuilder.java b/src/core/lombok/eclipse/handlers/HandleSuperBuilder.java index 640e5a71..a2ea11c6 100644 --- a/src/core/lombok/eclipse/handlers/HandleSuperBuilder.java +++ b/src/core/lombok/eclipse/handlers/HandleSuperBuilder.java @@ -572,9 +572,6 @@ public class HandleSuperBuilder extends EclipseAnnotationHandler<SuperBuilder> { out.modifiers = ClassFileConstants.AccPublic; out.bits |= ECLIPSE_DO_NOT_TOUCH_FLAG; - // Add type params if there are any. - if (typeParams != null && typeParams.length > 0) out.typeParameters = copyTypeParams(typeParams, source); - TypeReference[] wildcards = new TypeReference[] {new Wildcard(Wildcard.UNBOUND), new Wildcard(Wildcard.UNBOUND) }; out.returnType = new ParameterizedSingleTypeReference(builderClassName.toCharArray(), mergeToTypeReferences(typeParams, wildcards), 0, p); @@ -609,7 +606,7 @@ public class HandleSuperBuilder extends EclipseAnnotationHandler<SuperBuilder> { if (inherited) out.annotations = new Annotation[] {makeMarkerAnnotation(TypeConstants.JAVA_LANG_OVERRIDE, tdParent.get())}; out.returnType = new SingleTypeReference(builderGenericName.toCharArray(), 0); - TypeReference builderType = createTypeReferenceWithTypeParameters(classGenericName, typeParams); + TypeReference builderType = new SingleTypeReference(classGenericName.toCharArray(), 0); out.arguments = new Argument[] {new Argument(INSTANCE_VARIABLE_NAME, 0, builderType, Modifier.FINAL)}; List<Statement> body = new ArrayList<Statement>(); @@ -662,7 +659,11 @@ public class HandleSuperBuilder extends EclipseAnnotationHandler<SuperBuilder> { TypeReference[] wildcards = new TypeReference[] {new Wildcard(Wildcard.UNBOUND), new Wildcard(Wildcard.UNBOUND)}; TypeReference builderType = new ParameterizedSingleTypeReference(builderClassName.toCharArray(), mergeToTypeReferences(typeParams, wildcards), 0, 0); Argument builderArgument = new Argument(BUILDER_VARIABLE_NAME, 0, builderType, Modifier.FINAL); - out.arguments = new Argument[] {new Argument(INSTANCE_VARIABLE_NAME, 0, new SingleTypeReference(tdParent.getName().toCharArray(), 0), Modifier.FINAL), builderArgument}; + TypeReference parentArgument = new ParameterizedSingleTypeReference(tdParent.getName().toCharArray(), mergeToTypeReferences(typeParams, new TypeReference[0]), 0, 0); + out.arguments = new Argument[] {new Argument(INSTANCE_VARIABLE_NAME, 0, parentArgument, Modifier.FINAL), builderArgument}; + + // Add type params if there are any. + if (typeParams.length > 0) out.typeParameters = copyTypeParams(typeParams, source); List<Statement> body = new ArrayList<Statement>(); |