Skip to content

Commit

Permalink
Fixed generics in base builder => no more warnings (#1587)
Browse files Browse the repository at this point in the history
Co-authored-by: meluzinj <[email protected]>
  • Loading branch information
jiri-meluzin and meluzinj authored Sep 22, 2024
1 parent 79525f9 commit a8881a3
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 a8881a3

Please sign in to comment.