RemoveUnusedImports
removes used imports for annotated method parameters
#4473
Labels
bug
Something isn't working
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.
The complete bug (configuration and code) is also shown within https://github.com/mvitz/openrewrite-bug-removeunusedimports
What is the smallest, simplest way to reproduce the problem?
Although
@BeanProperty
may not make sense at that place, it was the first annotation within the JDK that I found to make the example as small as possible. A more realistic scenario would be Spring Boots@DefaultValue
which is used within the reproducer repository.What did you expect to see?
The import for the
@BeanProperty
annotation should not be removed.What did you see instead?
The import for the
@BeanProperty
annotation is removed, and the code does not compile afterwards because the import is needed and should not be removed.What is the full stack trace of any errors you encountered?
Example output can be seen in the reproducer repository (mentioned above).
Are you interested in contributing a fix to OpenRewrite?
Probably I would like to contribute, but if this is something someone with prior knowledge can fix within a few minutes, I would not inisist in fixing that myself.
The text was updated successfully, but these errors were encountered: