garydgregory commented on code in PR #870:
URL: https://github.com/apache/commons-io/pull/870#discussion_r3740882981


##########
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:
   This value should always be set to an `int` on construction. See my other 
comment.



##########
src/main/java/org/apache/commons/io/monitor/FileAlterationObserver.java:
##########
@@ -236,8 +264,14 @@ private static Comparator<File> toComparator(final IOCase 
ioCase) {
      */
     private final Comparator<File> comparator;
 
+    /**
+     * The maximum depth of entries to monitor.
+     */
+    private final Integer maxDepth;

Review Comment:
   Make this an `int`.



-- 
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