Broad Wildcard Import (ARCH4192)
Key java.quality.wildcard-import · Severity warning · Category quality
Wildcard (*) imports pollute the namespace and hide where a type comes from, setting up name collisions. Import only the types you actually use, explicitly.
Incorrect
Section titled “Incorrect”import java.util.*;
List<String> names = new ArrayList<>();Correct
Section titled “Correct”import java.util.List;import java.util.ArrayList;
List<String> names = new ArrayList<>();Replace wildcard imports with explicit imports of only the types actually used.