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

Directory.copy -> Directory.copyFrom

Details

    • Task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 5.0, 6.0
    • core/store
    • None
    • New

    Description

      Spinoff of LUCENE-4746.

      This method is currently:

      copy(Directory to, String src, String dest, IOContext context)
      

      But it would be better to restructure this so the destination directory is the one actually being changed by the operation:

      copyFrom(Directory from, String src, String dest, IOContext context)
      

      Besides fixing the order to make sense, adding it to the name might help prevent bugs like the current TrackingDirectoryWrapper impl (used by IndexWriter to track what files are used):

      public void copy(Directory to, String src, String dest, IOContext context) throws IOException {
        createdFileNames.add(dest); // BUG!
        in.copy(to, src, dest, context);
      }
      

      Attachments

        1. LUCENE-6146.patch
          19 kB
          Robert Muir

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rcmuir Robert Muir
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: