lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shai Erera (JIRA)" <>
Subject [jira] Commented: (LUCENE-2339) Allow Directory.copy() to accept a collection of file names to be copied
Date Tue, 23 Mar 2010 14:49:27 GMT


Shai Erera commented on LUCENE-2339:

Mike, that's what I wrote above "if someone does not want to suppress, he should call close".
I think that closeSafely (or as I prefer it - closeNoException) should be closed only when
you know you've hit an exception and you want to close the stream suppressing any exceptions.
Otherwise call close().

bq. can we add a boolean arg (suppressExceptions) to control that?

That would beat the purpose of the method no? I mean, currently it does not throw any exception,
not even declaring one, and if we add that boolean it will need to declare "throws IOException",
which will force the caller to try-catch that exception and ... suppress it or document "//
cannot happen because I've passed false"?

So how about we call it closeNoException, document that it does not throw any exception and
intentionally suppresses them, and if you don't want them to be suppressed, you can call io.close()

> Allow Directory.copy() to accept a collection of file names to be copied
> ------------------------------------------------------------------------
>                 Key: LUCENE-2339
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Earwin Burrfoot
>            Assignee: Michael McCandless
>         Attachments: LUCENE-2339.patch, LUCENE-2339.patch, LUCENE-2339.patch
> Par example, I want to copy files pertaining to a certain commit, and not everything
there is in a Directory.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message