zx8410-ops commented on PR #870:
URL: https://github.com/apache/commons-io/pull/870#issuecomment-5312679098

   Thank you. I agree that reusing `Files.walkFileTree()` is the preferable 
implementation direction and that #871 can supersede this PR.
   
   One detail I think we should verify before closing #870: 
`FileAlterationObserver` still builds its entry tree recursively 
(`createFileEntry()` -> `listFileEntries()` -> `listFiles()`), while #871 
starts a new walk with the full `maxDepth` for every directory. Because 
`maxDepth` is relative to each walk's start path, this appears to reset the 
depth at each recursive call. For example, with `maxDepth=1`, the root walk can 
return the boundary directory, and creating that entry then starts another 
`maxDepth=1` walk from the boundary, potentially exposing its children. 
Returning `SKIP_SUBTREE` for non-start directories also makes each individual 
walk effectively list one level.
   
   The deep-event test in #871 currently uses `maxDepth=0`, so it may not catch 
the `maxDepth=1` case. Could we keep a test that sets `maxDepth=1` and verifies 
that events below the boundary are ignored, and either pass the remaining depth 
(`maxDepth - relativeDepth`) or perform one root-relative walk?
   
   With that boundary case covered, I am happy for #871 to replace #870 and for 
this PR to be closed.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to