diff options
author | Jan Rieke <it@janrieke.de> | 2018-04-03 12:12:48 +0200 |
---|---|---|
committer | Jan Rieke <rieke@subshell.com> | 2018-04-05 18:42:59 +0200 |
commit | c37c33be46961fd6ebc8bec24cee24f62d066f03 (patch) | |
tree | 306cc216cb03687ad99c8a3aa4381e8fa95746da | |
parent | d586cc6b4fc1afb0a9e59e73ac3db1f5c914e191 (diff) | |
download | lombok-c37c33be46961fd6ebc8bec24cee24f62d066f03.tar.gz lombok-c37c33be46961fd6ebc8bec24cee24f62d066f03.tar.bz2 lombok-c37c33be46961fd6ebc8bec24cee24f62d066f03.zip |
wildcards for the constructor parameter
-rw-r--r-- | src/core/lombok/javac/handlers/HandleSuperBuilder.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/core/lombok/javac/handlers/HandleSuperBuilder.java b/src/core/lombok/javac/handlers/HandleSuperBuilder.java index 2d844432..2c292822 100644 --- a/src/core/lombok/javac/handlers/HandleSuperBuilder.java +++ b/src/core/lombok/javac/handlers/HandleSuperBuilder.java @@ -377,7 +377,13 @@ public class HandleSuperBuilder extends JavacAnnotationHandler<SuperBuilder> { ListBuffer<JCVariableDecl> params = new ListBuffer<JCVariableDecl>(); long flags = JavacHandlerUtil.addFinalIfNeeded(Flags.PARAMETER, typeNode.getContext()); Name builderClassname = typeNode.toName(builderClassName); - JCVariableDecl param = maker.VarDef(maker.Modifiers(flags), builderVariableName, maker.Ident(builderClassname), null); + // Now add the <?, ?>. + ListBuffer<JCExpression> typeParams = new ListBuffer<JCExpression>(); + JCWildcard wildcard = maker.Wildcard(maker.TypeBoundKind(BoundKind.UNBOUND), null); + typeParams.add(wildcard); + typeParams.add(wildcard); + JCTypeApply paramType = maker.TypeApply(maker.Ident(builderClassname), typeParams.toList()); + JCVariableDecl param = maker.VarDef(maker.Modifiers(flags), builderVariableName, paramType, null); params.append(param); if (callBuilderBasedSuperConstructor) { |