Open timo-a opened 2 months ago
Hi! Thanks for reporting in such detail with reproduction samples; looking above this seems at least closely related to this issue:
Would you say those are the same case? Or do you think your use of a custom style factors in here as well?
What I like about that other issue is that we have a fairly simple unit test to replicate the issue there: https://github.com/openrewrite/rewrite/issues/3283#issuecomment-1927091821 We just haven't yet gotten around to a fix of this particular issue, as it's hard to get to everything.
Do appreciate you calling this out! Definitely something we should fix to have a good experience running OrderImports
.
Yeah, I think that PR is similar to my first observation.
What version of OpenRewrite are you using?
I am using
How are you running OpenRewrite?
I am using the Maven plugin, and my project is a single module project.
What is the ~smallest, simplest~ way to reproduce the problem?
This example is not minimal, but it is reproducible.
./gradlew publishToMavenLocal
mvn -P openrewrite org.openrewrite.maven:rewrite-maven-plugin:run
What did you see?
this change set: https://github.com/timo-a/jackson-core/commit/c2970c0192090c3cb35f7bd32332d5dd49cde76f
Collapsing enum imports into a wildcard breaks the build.
are replaced with
in PrettyPrinterTest. As a consequence
Spacing.NONE
in line 271 can no longer be resolved. I don't know what issue the compiler has here, but apparently there is an edge case concerning enum imports. Other files are affected as well, but it is the same pattern there.extends
on new line is indented Example: https://github.com/timo-a/jackson-core/commit/c2970c0192090c3cb35f7bd32332d5dd49cde76f#diff-88fe5e2a29aa76eab8d3ec510f7aeb1ed3505a08c183f74e01543ff398ef7d0d The docs only speak of ordering imports:so this is unexpected.
Are you interested in contributing a fix to OpenRewrite?
no, just reporting