Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-6051

IOUtils methods taking Iterable<? extends Path> try to delete every element of the path

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • None
    • 5.0, 6.0
    • core/other
    • None
    • New

    Description

      We have two methods in IOUtils

       public static void deleteFilesIgnoringExceptions(Iterable<? extends Path> files);
      
       public static void deleteFilesIfExist(Iterable<? extends Path> files) throws IOException
      

      if you call these with a single Path instance it interprets it as Iterable<Path> since Path implements Iternable<Path> and in-turn tries to delete every element of the path. I guess we should fix this before we release. We also need to check if there are other places where we do this... it's nasty...

      Attachments

        1. LUCENE-6051.patch
          4 kB
          Robert Muir

        Activity

          People

            Unassigned Unassigned
            simonw Simon Willnauer
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: