zx8410-ops commented on code in PR #870:
URL: https://github.com/apache/commons-io/pull/870#discussion_r3780352547
##########
src/main/java/org/apache/commons/io/monitor/FileAlterationObserver.java:
##########
@@ -508,6 +555,17 @@ public Iterable<FileAlterationListener> getListeners() {
return new ArrayList<>(listeners);
}
+ /**
+ * Gets the maximum depth of entries to monitor. The root directory has
depth 0.
+ *
+ * @return The maximum depth.
+ * @since 2.23.0
+ */
+ public int getMaxDepth() {
+ // A null value preserves unlimited recursion when deserializing
streams written before this field was added.
+ return maxDepth != null ? maxDepth : Integer.MAX_VALUE;
Review Comment:
Addressed in 5cde511f8: all construction paths assign the primitive `int`
field, and `getMaxDepth()` now returns it directly.
--
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]