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

Gradle UpgradeDependencyVersion visitor should override isAcceptable #4327

Merged

Conversation

timtebeek
Copy link
Contributor

What's changed?

We returned a TreeVisitor from getVisitor(Accumulator), which then implicitly returns true, meaning we incorrectly skipped the Maven visitor for pom.xml files, calling the Gradle visitor instead. https://github.com/openrewrite/rewrite-java-dependencies/blob/2e3f39c4863b943cdaacb39d0e788c9c73e3f949/src/main/java/org/openrewrite/java/dependencies/UpgradeTransitiveDependencyVersion.java#L128-L133

With this change we only return true for Groovy and Properties files, as we should.

What's your motivation?

Copy link
Member

@sambsnyd sambsnyd left a comment

Choose a reason for hiding this comment

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

Good improvement

@sambsnyd sambsnyd merged commit 94c0500 into main Jul 12, 2024
2 checks passed
@sambsnyd sambsnyd deleted the gradle-UpgradeDependencyVersion-visitor-override-isAcceptable branch July 12, 2024 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants