commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nikhil Shinde (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (IO-540) Ambiguous parameter in AbtractFileFilter.accept(File,String).
Date Wed, 14 Jun 2017 08:03:00 GMT

     [ https://issues.apache.org/jira/browse/IO-540?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Nikhil Shinde updated IO-540:
-----------------------------
    Description: 
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.


  was:
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 make change in other arguments passed in accept(File,String).
No exception occurs at runtime, as overridden method is to be used to avoid Infinite looping.



> 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
(v6.4.14#64029)

Mime
View raw message