[ 
https://issues.apache.org/jira/browse/LUCENE-6146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14262240#comment-14262240
 ] 

Robert Muir commented on LUCENE-6146:
-------------------------------------

{quote}
Ah, don't forget to add a note into MIGRATE.txt of Lucene 5! This may affect 
users who implement own directories where their optimization may suddenly no 
longer used (and they have not used @Override annotation, so compiler does not 
catch the bug).
{quote}

Not a chance. Such cases will still work correctly, and thats the users fault. 
We don't need to clutter up migration notes with unnecessary shit like that.

> Directory.copy -> Directory.copyFrom
> ------------------------------------
>
>                 Key: LUCENE-6146
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6146
>             Project: Lucene - Core
>          Issue Type: Task
>          Components: core/store
>            Reporter: Robert Muir
>             Fix For: 5.0, Trunk
>
>         Attachments: LUCENE-6146.patch
>
>
> Spinoff of LUCENE-4746.
> This method is currently:
> {code}
> copy(Directory to, String src, String dest, IOContext context)
> {code}
> But it would be better to restructure this so the destination directory is 
> the one actually being changed by the operation:
> {code}
> copyFrom(Directory from, String src, String dest, IOContext context)
> {code}
> 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):
> {code}
> public void copy(Directory to, String src, String dest, IOContext context) 
> throws IOException {
>   createdFileNames.add(dest); // BUG!
>   in.copy(to, src, dest, context);
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to