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
> <https://issues.apache.org/jira/browse/FLINK-33367>
>
> [FLINK-33367] Invalid Check in DefaultFileFilter - ASF JIRA
>
> <https://issues.apache.org/jira/browse/FLINK-33367>
> Any input is appreciated.
>
> Thanks
>
>
>
>

Reply via email to