Yeah agree, not a problem in general. But it just seems odd. Returning true if a fileName can be null will blow up a lot more in the reader as far as my understanding goes. I just want to understand whether this is an erroneous condition or an actual use case. Lets say is it possible to get a null file name for some sub directories and hence important to return true so that the File Source can monitor inside those sub directories? On Friday, 27 October, 2023 at 12:58:44 am IST, Alexander Fedulov <alexander.fedu...@gmail.com> wrote: Is there an actual issue behind this question? In general: this is a form of defensive programming for a public interface and the decision here is to be more lenient when facing potentially erroneous user input rather than blow up the whole application with a NullPointerException. Best,Alexander Fedulov On Thu, 26 Oct 2023 at 07:35, Chirag Dewan via user <user@flink.apache.org> wrote:
Hi, I was looking at this check in DefaultFileFilter: public boolean test(Path path) { final String fileName = path.getName(); if (fileName == null || fileName.length() == 0) { return true; }Was wondering how can a file name be null? And if null, shouldnt this be return false? I created a JIRA for this - [FLINK-33367] Invalid Check in DefaultFileFilter - ASF JIRA | | | | [FLINK-33367] Invalid Check in DefaultFileFilter - ASF JIRA | | | Any input is appreciated. Thanks