Closed
Description
Description
Currently, several files in the codebase contain wildcard imports (example).
Wildcard imports can:
- Make it harder to track dependencies
- Lead to naming conflicts
- Reduce code readability
- Make it difficult to identify unused imports
OpenSearch has already implemented a check to prevent wildcard imports (see). We can adopt a similar mechanism for Lucene to enforce explicit imports.
Proposed changes:
Add a spotless rule to detect wildcard imports to avoid committing wildcard imports. Replace existing wildcard with explicit imports.