RFR: 8285956: (fs) Excessive default poll interval in PollingWatchService [v4]

Tyler Steele duke at openjdk.java.net
Wed May 4 17:18:27 UTC 2022


On Wed, 4 May 2022 16:54:51 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>>> Can you move this up to the top of the file so it's with DEFAULT_POLLING_INTERVAL? I thin both will need a short one line comment.
>> 
>> The constants are used in different objects, so I'm not sure there is a sensible way to to do this. A constant reference to a private object might be a way, but that felt like too much indirection.
>> 
>>> I'm not sure about changing it to 1s as it may lead to complaints from macOS users with programs that monitor directories with a large number of files. The right thing is of course to include a native implementation for that platform, some day :-)
>> 
>> Changed to 2s interval between subsequent polls since there have been a few concerns about this :-). I also agree that a native implementation would be far superior.
>
> I think it would be cleaner to have both constants declared at the top in PollingWatchService. They are in the same nest so accessibility should not be an issue.

My mistake. I was thinking of them as two totally separate classes. I have made this change.

-------------

PR: https://git.openjdk.java.net/jdk/pull/8479


More information about the nio-dev mailing list