Skip to content

Fail spotless check for wildcard imports #14553

Closed
@owaiskazi19

Description

@owaiskazi19

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions