Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce warnings by generating JavaDoc #45

Merged
merged 2 commits into from
Dec 17, 2023
Merged

Reduce warnings by generating JavaDoc #45

merged 2 commits into from
Dec 17, 2023

Conversation

timtebeek
Copy link
Contributor

What's changed?

Also generate a line of JavaDoc for classes.

What's your motivation?

Reduce warnings on use in error-prone-support.

Any additional context

@timtebeek timtebeek self-assigned this Dec 16, 2023
@timtebeek timtebeek added the enhancement New feature or request label Dec 16, 2023
@timtebeek timtebeek marked this pull request as ready for review December 16, 2023 22:59
Comment on lines +218 to +219
out.write("class " + templateFqn.substring(templateFqn.lastIndexOf('.') + 1) + " {\n");
out.write(" static JavaTemplate.Builder getTemplate() {\n");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class and method are accessed from the PatternBuilder. I don't expect issues with the reduced visibility, but figured ask for a second opinion just in case.

public JavaTemplate.Builder build(JavaVisitor<?> owner) {
try {
Class<?> templateClass = Class.forName(owner.getClass().getName() + "_" + name, true,
owner.getClass().getClassLoader());
Method getTemplate = templateClass.getDeclaredMethod("getTemplate");
return (JavaTemplate.Builder) getTemplate.invoke(null);
} catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException |
IllegalAccessException e) {
throw new RuntimeException(e);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively we had plans in the past to merge this into RefasterTemplateProcessor, which might make sense now too as I don't think we've come to use these templates separately.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just confirmed to work against apache/maven-build-cache-extension with a local build; figured that makes this a low impact enough change that we can see this through and at worst refine on the main branch later.

@timtebeek timtebeek merged commit bbf420f into main Dec 17, 2023
1 check passed
@timtebeek timtebeek deleted the generate-javadoc branch December 17, 2023 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

1 participant