You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Robert Muir (JIRA)" <ji...@apache.org> on 2014/11/06 17:33:34 UTC

[jira] [Commented] (LUCENE-6051) IOUtils methods taking Iterable try to delete every element of the path

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

Robert Muir commented on LUCENE-6051:
-------------------------------------

nice catch simon! 

I think we should change the signatures to take Collection instead. It will give 90% of the usefulness without bugs or traps.

> IOUtils methods taking Iterable<? extends Path> try to delete every element of the path
> ---------------------------------------------------------------------------------------
>
>                 Key: LUCENE-6051
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6051
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: core/other
>            Reporter: Simon Willnauer
>            Priority: Blocker
>             Fix For: 5.0, Trunk
>
>
> We have two methods in IOUtils
> {code}
> public static void deleteFilesIgnoringExceptions(Iterable<? extends Path> files);
>  public static void deleteFilesIfExist(Iterable<? extends Path> files) throws IOException
> {code}
> 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... 



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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org