Skip to content

Remove unused imports recipe is removing an used class #3903

Closed Answered by timtebeek
sergiogp98 asked this question in General
Discussion options

You must be logged in to vote

Hi @sergiogp98 ; did you already look at the implementation of the recipe?

return "Remove imports for types that are not referenced. As a precaution against incorrect changes no imports " +
"will be removed from any source where unknown types are referenced. The most common cause of unknown " +
"types is the use of annotation processors not supported by OpenRewrite, such as lombok.";

Roughly speaking we look at the types in use on Lossless Semantic Tree elements in the compilation unit; if such types are missing, then we are at risk of misidentifying a use…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@sergiogp98
Comment options

@timtebeek
Comment options

@timtebeek
Comment options

@timtebeek
Comment options

@sergiogp98
Comment options

Answer selected by timtebeek
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
2 participants