IntelliJ IDEA: how to disable automatic replacement of wildcard imports with individual imports?
Hello everyone! I'm a beginner Java developer, switched to IntelliJ IDEA and noticed strange behavior. When I write, for example, `import java.util.*;`, the IDE automatically expands it into a bunch of individual imports: `import java.util.List; import java.util.Map; import java.util.Set;` and so on. This is extremely annoying because I intentionally use wildcard imports to make the code shorter and cleaner. Especially when working with test classes or quick prototypes.
Here's an example: I write
```java
import java.util.*;
import java.io.*;
public class Test {
public static void main(String[] args) {
List list = new ArrayList<>();
File file = new File("test.txt");
}
}
```
But after pressing Ctrl+Alt+O (optimize imports) or simply saving the file, IDEA turns
No answers yet.
Log in to leave an answer
Blogs