Skip to content

Document Set semantics for selectClasspathResource(), selectClasspathRoots(), and selectModules() in DiscoverySelectors #4868

@sbrannen

Description

@sbrannen

Overview

The selectClasspathResource(Set<Resource>), selectClasspathRoots(Set<Path>), and selectModules(Set<String>) methods in DiscoverySelectors all accept a Set and return a List.

The Set semantics are intended to enforce uniqueness.

Whereas, the List semantics are intended to enforce order.

However, if the user supplies a Set that does not enforce a particular iteration order, the discovery results can change the effective execution order of the test suite.

Deliverables

  • Add notes to the Javadoc for selectClasspathResource(Set<Resource>), selectClasspathRoots(Set<Path>), and selectModules(Set<String>), stating that the supplied Set should ideally be a SequencedSet (on Java 21+), a LinkedHashSet, or similar in order to guarantee reliable selection/execution order.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions