Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
None
-
None
-
None
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.