Package org.openrewrite.java
Class RemoveUnusedImports
- java.lang.Object
-
- org.openrewrite.Recipe
-
- org.openrewrite.java.RemoveUnusedImports
-
public class RemoveUnusedImports extends org.openrewrite.RecipeThis recipe will remove any imports for types that are not referenced within the compilation unit. This recipe is aware of the import layout style and will correctly handle unfolding of wildcard imports if the import counts drop below the configured values.
-
-
Constructor Summary
Constructors Constructor Description RemoveUnusedImports()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetDescription()java.lang.StringgetDisplayName()java.time.DurationgetEstimatedEffortPerOccurrence()protected @Nullable org.openrewrite.TreeVisitor<?,org.openrewrite.ExecutionContext>getSingleSourceApplicableTest()java.util.Set<java.lang.String>getTags()protected org.openrewrite.TreeVisitor<?,org.openrewrite.ExecutionContext>getVisitor()
-
-
-
Method Detail
-
getDisplayName
public java.lang.String getDisplayName()
- Specified by:
getDisplayNamein classorg.openrewrite.Recipe
-
getDescription
public java.lang.String getDescription()
- Overrides:
getDescriptionin classorg.openrewrite.Recipe
-
getTags
public java.util.Set<java.lang.String> getTags()
- Overrides:
getTagsin classorg.openrewrite.Recipe
-
getEstimatedEffortPerOccurrence
public java.time.Duration getEstimatedEffortPerOccurrence()
- Overrides:
getEstimatedEffortPerOccurrencein classorg.openrewrite.Recipe
-
getSingleSourceApplicableTest
@Nullable protected @Nullable org.openrewrite.TreeVisitor<?,org.openrewrite.ExecutionContext> getSingleSourceApplicableTest()
- Overrides:
getSingleSourceApplicableTestin classorg.openrewrite.Recipe
-
getVisitor
protected org.openrewrite.TreeVisitor<?,org.openrewrite.ExecutionContext> getVisitor()
- Overrides:
getVisitorin classorg.openrewrite.Recipe
-
-