Skip to content

Forward-port: Remove PathSelector include-based directory pre-filtering optimization - #12624

Merged
gnodet merged 1 commit into
masterfrom
forward-port/pathselector-directory-prefilter
Jul 30, 2026
Merged

Forward-port: Remove PathSelector include-based directory pre-filtering optimization#12624
gnodet merged 1 commit into
masterfrom
forward-port/pathselector-directory-prefilter

Conversation

@gnodet

@gnodet gnodet commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Forward-port of #12623 from maven-4.0.x to master.

Removes the unsafe include-based directory pre-filtering optimization from PathSelector.DirectoryPrefiltering. Using exclude filters for directory traversal is safe, but using include filters causes false negatives because parent directories need to be traversed before matching children.

Cherry-pick applied cleanly with no conflicts.

Author: Martin Desruisseaux (@desruisseaux)

🤖 Generated with Claude Code

The optimization was producing false negatives. It is safe to use an
exclude filter for directories during FileVisitor traversal, but unsafe
to use an include filter because parent directories need to be traversed
first before matching children.

PR: #12623
Author: Martin Desruisseaux (@desruisseaux)
Closes #12623

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — Clean forward-port

This is a verified clean forward-port of #12623 from maven-4.0.x to master. The diffs are byte-for-byte identical, the cherry-pick applied with no conflicts, and the language nits noted in the original review were already addressed before merge.

The change correctly removes the unsafe include-based directory pre-filtering optimization from DirectoryPrefiltering, retaining only exclude-based filtering which is safe. Test assertions are correctly flipped to reflect the new (more permissive) directory matching behavior, with clear explanatory comments.

Note: Cannot submit as APPROVE on self-authored PRs. This review would be APPROVE otherwise.

This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.

Claude Code on behalf of gnodet

@gnodet
gnodet merged commit 236a8c9 into master Jul 30, 2026
24 checks passed
@gnodet
gnodet deleted the forward-port/pathselector-directory-prefilter branch July 30, 2026 05:51
@github-actions github-actions Bot added this to the 4.1.0 milestone Jul 30, 2026
@github-actions

Copy link
Copy Markdown

@gnodet Please assign appropriate label to PR according to the type of change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants