Uploaded image for project: 'Commons IO'
  1. Commons IO
  2. IO-540

Ambiguous parameter in AbtractFileFilter.accept(File,String).

    XMLWordPrintableJSON

Details

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

      Attachments

        Activity

          People

            Unassigned Unassigned
            nikshinde1996 Nikhil Shinde
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: