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

RemoveUnusedImports should not remove imports for used nested classes #4479

Merged
merged 5 commits into from
Sep 10, 2024

Conversation

Laurens-W
Copy link
Contributor

@Laurens-W Laurens-W commented Sep 9, 2024

What's changed?

Some improvements to handling nested inner class imports

What's your motivation?

Anyone you would like to review specifically?

@timtebeek

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 added the bug Something isn't working label Sep 9, 2024
@Laurens-W Laurens-W requested a review from timtebeek September 9, 2024 16:13
@Laurens-W Laurens-W self-assigned this Sep 9, 2024
@timtebeek timtebeek changed the title Add testcases for nested imports RemoveUnusedImports should not remove imports for used nested classes Sep 9, 2024
@timtebeek timtebeek marked this pull request as ready for review September 9, 2024 16:28
@timtebeek
Copy link
Contributor

Two new curious failures in ChangeTypeTest: https://ge.openrewrite.org/s/2lfbsonpxu4f6/tests/overview?outcome=FAILED
I guess you can see why I was hesitant to change rewrite-java/src/main/java/org/openrewrite/java/tree/JavaType.java ;)

Copy link
Contributor

@timtebeek timtebeek left a comment

Choose a reason for hiding this comment

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

Great to see these subtle fixes; should help make these recipes something we can enforce going forward.

@timtebeek
Copy link
Contributor

Let's merge when you're done validating against those Spring projects, just to be safe

@Laurens-W Laurens-W merged commit 2236981 into main Sep 10, 2024
2 checks passed
@Laurens-W Laurens-W deleted the nested-imports branch September 10, 2024 09:10
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.

org.openrewrite.java.RemoveUnusedImports should not removed imports for public static inner class usage
2 participants