Skip to content

Preserve angle brackets when converting @param <T> to Markdown#1141

Merged
timtebeek merged 1 commit into
mainfrom
tim/javadoc-param-type-param
Jun 24, 2026
Merged

Preserve angle brackets when converting @param <T> to Markdown#1141
timtebeek merged 1 commit into
mainfrom
tim/javadoc-param-type-param

Conversation

@timtebeek

Copy link
Copy Markdown
Member

JavadocToMarkdownDocComment was dropping the angle brackets on generic type parameters, converting @param <T> into /// @param T instead of /// @param <T>. This happened because the Javadoc parser models a type-parameter name as a J.TypeParameter with the surrounding </> stripped, and printJ rendered only the inner name. The fix detects a J.TypeParameter name in convertParameter and re-adds the angle brackets. A genericTypeParameter test covering both a type parameter and a regular parameter is included and passes.

@github-project-automation github-project-automation Bot moved this to In Progress in OpenRewrite Jun 24, 2026
@timtebeek timtebeek merged commit ad1045d into main Jun 24, 2026
1 check passed
@timtebeek timtebeek deleted the tim/javadoc-param-type-param branch June 24, 2026 08:25
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite Jun 24, 2026
timtebeek added a commit that referenced this pull request Jun 24, 2026
…ytecode source/target compatibility (#1143)

* Fix JavadocToMarkdown's handling of <br>, varargs, type parameters, jdks newer than the bytecode source/target compatibility

* Remove duplicate tests that overlap with #1141 and #1142 after merge

---------

Co-authored-by: Tim te Beek <tim@moderne.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

1 participant