Skip to content

Strip all leading asterisks in DanglingDocCommentToBlockComment (C9 of #1330) - #1364

Merged
timtebeek merged 1 commit into
mainfrom
fix/dangling-doc-comment-banners
Oct 25, 2026
Merged

timtebeek merged 1 commit into
mainfrom
fix/dangling-doc-comment-banners

Conversation

@timtebeek

@timtebeek timtebeek commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

Fixes C9 of #1330.

DanglingDocCommentToBlockComment stripped a single * per cycle, so a banner like /******** section ********/ never converged: each run turned it into another doc comment with one asterisk less. The recipe now strips the whole leading run of asterisks.

Skipping banners instead was not an option, as javac 25 with -Xlint:dangling-doc-comments flags /***/, /*** three ***/ and /******** section ********/ just like /**; I checked that, and that the rewritten /**/, /* section ********/ and multi-line /* forms compile without the warning.

Verified with ./gradlew test --tests DanglingDocCommentToBlockCommentTest (10 tests, all passing), including a new banners test.

@github-project-automation github-project-automation Bot moved this to In Progress in OpenRewrite Oct 25, 2026
@timtebeek
timtebeek enabled auto-merge (squash) October 25, 2026 22:21
@timtebeek
timtebeek merged commit 2ff6847 into main Oct 25, 2026
1 check passed
@timtebeek
timtebeek deleted the fix/dangling-doc-comment-banners branch October 25, 2026 22:43
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite Oct 25, 2026
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