Skip to content

Conversation

Laurens-W
Copy link
Contributor

What's changed?

Wildcard imports receive type Unknown however after we unfold them they should be specific imports that have type information

What's your motivation?

When a org.junit.* import is unfolded during the junit 4 to 5 migration and attempt is made to move some imports to their respective JUnit 5 variant ambiguity occurs because the type information is invalid

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

@Laurens-W Laurens-W self-assigned this Oct 9, 2025
@Laurens-W Laurens-W added the bug Something isn't working label Oct 9, 2025
@github-project-automation github-project-automation bot moved this to In Progress in OpenRewrite Oct 9, 2025
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.

That looks sensible but the "attempt" in the title and no test showing it works doesn't inspire great confidence

@Laurens-W
Copy link
Contributor Author

That looks sensible but the "attempt" in the title and no test showing it works doesn't inspire great confidence

I did write a test to validate my hypothesis, but the limited setup I have succeeds regardless of this change, I'll work on adding a testcase that proves the point and remove Attempt from the title :)

@timtebeek timtebeek marked this pull request as draft October 10, 2025 15:38
@MBoegers
Copy link
Contributor

Is there a reason why the recipe does 3 things in one visitor run? I understand that we don't want 3 recipes, as none of them is reasonable on its own, but we could create 3 visitors and chain them together in one recipe.
The upside here would be that we can write tests per visitor and probably replace old implementations with now existing atomic recipes.

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

Status: In Progress

Development

Successfully merging this pull request may close these issues.

3 participants