You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "elharo (via GitHub)" <gi...@apache.org> on 2025/12/14 12:07:49 UTC
Re: [PR] Create the directory matchers only if requested and return a more direct `PathMatcher` for directories [maven]
elharo commented on code in PR #11551:
URL: https://github.com/apache/maven/pull/11551#discussion_r2616986706
##########
impl/maven-impl/src/main/java/org/apache/maven/impl/PathSelector.java:
##########
@@ -598,30 +581,73 @@ private static boolean isMatched(Path path, PathMatcher[] matchers) {
}
/**
- * Returns whether {@link #couldHoldSelected(Path)} may return {@code false} for some directories.
- * This method can be used to determine if directory filtering optimization is possible.
- *
- * @return {@code true} if directory filtering is possible, {@code false} if all directories
- * will be considered as potentially containing selected files
+ * Returns a matcher that can be used for pre-filtering the directories.
+ * The returned matcher can be used as an optimization for skipping whole directories when possible.
+ * If there is no such optimization, then this method returns {@link #INCLUDES_ALL}.
*/
- boolean canFilterDirectories() {
- return dirIncludes.length != 0 || dirExcludes.length != 0;
+ public PathMatcher createDirectoryMatcher() {
Review Comment:
Looks like this method doesn't have to be public
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org