Skip to content

AvoidStarImport: Replace with single class import #5413

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Pankraz76 opened this issue May 12, 2025 · 3 comments
Closed

AvoidStarImport: Replace with single class import #5413

Pankraz76 opened this issue May 12, 2025 · 3 comments
Labels
enhancement New feature or request

Comments

@Pankraz76
Copy link

Pankraz76 commented May 12, 2025

@Pankraz76 Pankraz76 added the enhancement New feature or request label May 12, 2025
@Pankraz76
Copy link
Author

Pankraz76 commented May 12, 2025

https://github.com/apache/maven/blob/ec56597f9ba8a8d68491bbee989756d3dcdd41d9/impl/maven-impl/src/main/java/org/apache/maven/impl/DefaultPluginXmlFactory.java

What problem are you trying to solve?

import org.apache.maven.api.annotations.Nonnull;
import org.apache.maven.api.di.Named;
import org.apache.maven.api.di.Singleton;
import org.apache.maven.api.plugin.descriptor.PluginDescriptor;
import org.apache.maven.api.services.xml.*;
import org.apache.maven.plugin.descriptor.io.PluginDescriptorStaxReader;
import org.apache.maven.plugin.descriptor.io.PluginDescriptorStaxWriter;

Describe the solution you'd like

import org.apache.maven.api.annotations.Nonnull;
import org.apache.maven.api.di.Named;
import org.apache.maven.api.di.Singleton;
import org.apache.maven.api.plugin.descriptor.PluginDescriptor;
import org.apache.maven.api.services.xml.PluginXmlFactory;
import org.apache.maven.api.services.xml.XmlReaderException;
import org.apache.maven.api.services.xml.XmlReaderRequest;
import org.apache.maven.api.services.xml.XmlWriterException;
import org.apache.maven.api.services.xml.XmlWriterRequest;
import org.apache.maven.plugin.descriptor.io.PluginDescriptorStaxReader;
import org.apache.maven.plugin.descriptor.io.PluginDescriptorStaxWriter;

Have you considered any alternatives or workarounds?

Additional context

Are you interested in contributing this feature to OpenRewrite?

@Pankraz76 Pankraz76 changed the title AvoidStarImport AvoidStarImport: Replace with single class import May 12, 2025
@Pankraz76 Pankraz76 changed the title AvoidStarImport: Replace with single class import AvoidStarImport: Replace with single class import May 12, 2025
@timtebeek
Copy link
Member

hi! This should already be possible by using Styles to set the number of imports, and then running OrderImports.
https://docs.openrewrite.org/concepts-and-explanations/styles#example
https://docs.openrewrite.org/recipes/java/orderimports

@Pankraz76
Copy link
Author

thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

No branches or pull requests

2 participants