You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary D. Gregory (Jira)" <ji...@apache.org> on 2022/08/08 15:03:00 UTC

[jira] [Commented] (IO-540) Ambiguous parameter in AbtractFileFilter.accept(File,String).

    [ https://issues.apache.org/jira/browse/IO-540?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17576842#comment-17576842 ] 

Gary D. Gregory commented on IO-540:
------------------------------------

Hi [~nikshinde1996] 

We welcome PRs on GitHub ;)

> Ambiguous parameter in AbtractFileFilter.accept(File,String). 
> --------------------------------------------------------------
>
>                 Key: IO-540
>                 URL: https://issues.apache.org/jira/browse/IO-540
>             Project: Commons IO
>          Issue Type: Improvement
>          Components: Filters
>            Reporter: Nikhil Shinde
>            Priority: Minor
>
> Although we are required to override the AbstractFilteFilter.accept() method to avoid Infinite loop, the arguments in current implementation seems ambiguous. File.getParentFile() is passed as argument to FilenameFilter.accept(File,String) overridden method. File.getParentFile() returns null if parent dir is not known(occurs mostly when using relative path). Java doc for FilenameFilter.accept() does not mention of allowing null value for File parameter. It would be better to change this argument that guarantee non-null value.
> No exception occurs at runtime, as overridden method is to be used to avoid Infinite looping. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)