Aller au contenu

Broad Wildcard Import (ARCH4192)

Ce contenu n’est pas encore disponible dans votre langue.

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.

import java.util.*;
List<String> names = new ArrayList<>();
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.