Skip to content

Commit 8d22e78

Browse files
committed
Document DeclaredMethodSelector
1 parent 1928f36 commit 8d22e78

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DeclaredMethodSelector.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,19 @@
1515

1616
import org.junit.platform.commons.util.Preconditions;
1717
import org.junit.platform.engine.DiscoverySelector;
18+
import org.junit.platform.engine.discovery.MethodSelector;
1819

1920
/**
21+
* Jupiter-specific selector for methods, potentially in nested classes.
22+
*
23+
* <p>The important difference to {@link MethodSelector} is that this selector's
24+
* {@link #equals(Object)} method takes into account the selected method's
25+
* {@linkplain Method#getDeclaringClass() declaring class} to support cases
26+
* where a package-private method is declared in a super class in a different
27+
* package and a method with the same signature is declared in a subclass. In
28+
* that case both methods should be discovered because the one declared in the
29+
* subclass does <em>not</em> override the one in the super class.
30+
*
2031
* @since 6.0.1
2132
*/
2233
record DeclaredMethodSelector(List<Class<?>> testClasses, Method method) implements DiscoverySelector {

0 commit comments

Comments
 (0)