Skip to content

Commit

Permalink
Fixed generics in base builder => no more warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
meluzinj committed Feb 9, 2024
1 parent 72050f6 commit 70746a5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public JDefinedClass apply(String nodeName, JsonNode node, JsonNode parent, JDef
generateNoArgsBuilderConstructors(instanceClass, builderClass, concreteBuilderClass);
}

JMethod builderMethod = instanceClass.method(JMod.PUBLIC + JMod.STATIC, builderClass, "builder");
JMethod builderMethod = instanceClass.method(JMod.PUBLIC + JMod.STATIC, builderClass.narrow(instanceClass.wildcard()), "builder");
JBlock builderBody = builderMethod.body();
builderBody._return(JExpr._new(concreteBuilderClass));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ private JMethod addLegacyBuilder(JDefinedClass c, JFieldVar field, String jsonPr
private JMethod addInnerBuilderMethod(JDefinedClass c, JFieldVar field, String jsonPropertyName, JsonNode node) {
JDefinedClass builderClass = ruleFactory.getReflectionHelper().getBaseBuilderClass(c);

JMethod builderMethod = builderClass.method(JMod.PUBLIC, builderClass, getBuilderName(jsonPropertyName, node));
JMethod builderMethod = builderClass.method(JMod.PUBLIC, builderClass.narrow(builderClass.typeParams()), getBuilderName(jsonPropertyName, node));

JVar param = builderMethod.param(field.type(), field.name());
JBlock body = builderMethod.body();
Expand Down

0 comments on commit 70746a5

Please sign in to comment.