Skip to content

Ensure proper "because" ordering for multiple Maven dependencies#6352

Merged
jkschneider merged 1 commit intomainfrom
bm/multi-because-comment-maven
Nov 28, 2025
Merged

Ensure proper "because" ordering for multiple Maven dependencies#6352
jkschneider merged 1 commit intomainfrom
bm/multi-because-comment-maven

Conversation

@bmuschko
Copy link
Copy Markdown
Contributor

@bmuschko bmuschko commented Nov 27, 2025

What's changed?

The fix introduces AddDependencyWithCommentVisitor, which adds both the comment and dependency in a single atomic operation, ensuring they stay together. Additionally, when finding the insertion position, the new logic skips over existing comments and inserts before any preceding comments that belong to an existing dependency, preventing new content from being inserted between a comment and its associated dependency.

What's your motivation?

Anything in particular you'd like reviewers to focus on?

No

@bmuschko bmuschko requested a review from timtebeek November 27, 2025 16:06
@bmuschko bmuschko self-assigned this Nov 27, 2025
@bmuschko bmuschko added bug Something isn't working recipe Requested Recipe labels Nov 27, 2025
@github-project-automation github-project-automation Bot moved this to In Progress in OpenRewrite Nov 27, 2025
@bmuschko bmuschko moved this from In Progress to Ready to Review in OpenRewrite Nov 27, 2025
@bmuschko bmuschko changed the title Ensure proper because ordering for multiple Maven dependencies Ensure proper "because" ordering for multiple Maven dependencies Nov 27, 2025
@jkschneider jkschneider merged commit 61b818e into main Nov 28, 2025
2 of 3 checks passed
@jkschneider jkschneider deleted the bm/multi-because-comment-maven branch November 28, 2025 14:57
@github-project-automation github-project-automation Bot moved this from Ready to Review to Done in OpenRewrite Nov 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working recipe Requested Recipe

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants