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

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

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Filters
    • Labels:
      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

            • Assignee:
              Unassigned
              Reporter:
              nikshinde1996 Nikhil Shinde
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: