Skip to content

Conversation

scordio
Copy link
Contributor

@scordio scordio commented Jun 12, 2025

What's changed?

Prior to this change, the JSpecify recipes add org.jspecify:jspecify as a dependency, even for cases where the dependency is already available transitively.

Now, acceptTransitive is set to true, so that the dependency isn't added when it's already available transitively.

What's your motivation?

Checklist

  • I've added unit tests to cover both positive and negative cases
  • I've read and applied the recipe conventions and best practices
  • I've used the IntelliJ IDEA auto-formatter on affected files

@github-project-automation github-project-automation bot moved this to In Progress in OpenRewrite Jun 12, 2025
@scordio
Copy link
Contributor Author

scordio commented Jun 12, 2025

  • I've added unit tests to cover both positive and negative cases

Is there any test case I could use as an example to verify the behavior with transitive dependencies?

My best guess so far is to duplicate the existing methods in JSpecifyBestPracticesTest and add something to the POM that brings JSpecify transitively. To be precise, spring-core would be what I'd add to the MigrateFromSpringFrameworkAnnotations test case but I'm unsure about the other cases.

@timtebeek
Copy link
Member

Only spotted this now! Sorry about that, I don't get notified about drafts. Looks perfect to me as is; no need to add tests beyond what we already have for this one in particular. Thanks a lot!

@timtebeek timtebeek marked this pull request as ready for review June 13, 2025 14:43
@timtebeek timtebeek merged commit 1b9b615 into openrewrite:main Jun 13, 2025
@github-project-automation github-project-automation bot moved this from In Progress to Done in OpenRewrite Jun 13, 2025
@scordio scordio deleted the gh-757 branch June 13, 2025 14:44
@timtebeek timtebeek added the bug Something isn't working label Jun 13, 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
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Avoid adding org.jspecify:jspecify when running MigrateFromSpringFrameworkAnnotations
2 participants