Skip to content

Conversation

jevanlingen
Copy link
Contributor

@jevanlingen jevanlingen commented Aug 5, 2025

What's changed?

The remove import recipe takes imports of super types into account.

What's your motivation?

Kotlin can import a static java member of a parent class by importing the child class. The recipe did not take this feature into account. There's also the option of using imports of companion objects with an interface. These kind of setup was not supported as well.

Any additional context

At the moment I could not find a proper way to add Java source code as dependency of the Kotlin sources, so I added a @Disabled test. If there's a way to do this, it should be used.

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

@jevanlingen jevanlingen self-assigned this Aug 5, 2025
@jevanlingen jevanlingen added bug Something isn't working recipe Requested Recipe labels Aug 5, 2025
@github-project-automation github-project-automation bot moved this to In Progress in OpenRewrite Aug 5, 2025
@timtebeek timtebeek self-requested a review August 5, 2025 16:29
@jevanlingen jevanlingen changed the title RemoveImport-should-look-through-supertypes-in-kotlin RemoveImport should look through supertypes in kotlin Aug 6, 2025
github-actions[bot]

This comment was marked as spam.

@jevanlingen jevanlingen changed the title RemoveImport should look through supertypes in kotlin RemoveImport should look through supertypes for Kotlin Aug 7, 2025
@jevanlingen jevanlingen moved this from In Progress to Ready to Review in OpenRewrite Aug 7, 2025
@jevanlingen jevanlingen marked this pull request as draft August 20, 2025 13:06
@jevanlingen jevanlingen marked this pull request as ready for review September 4, 2025 08:55
github-actions[bot]

This comment was marked as spam.

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
Status: Ready to Review
Development

Successfully merging this pull request may close these issues.

2 participants