mahout-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sean Owen <sro...@gmail.com>
Subject Re: [jira] Updated: (MAHOUT-175) Use IOUtils, FileLineIterable/Iterator across the project
Date Wed, 09 Sep 2009 16:37:40 GMT
It just packs up this...

if (closeable != null) {
  try {
    closeable.close();
  } catch (IOException ioe) {
    log.warning(ioe);
  }
}

That's 7 lines I don't need to repeat all over the place. It came in
very handy to convert 3x7 = 21 such lines into 1 since a JDBC call
involves 3 closeable things -- Connection, Statement, ResultSet. This
is for the common case that some failure on closing something you're
done reading is... noteworthy but probably not a reason to just stop
immediately with an exception.

I didn't change any such calls where it seemed plausible that one
would definitely want to stop. Like unit tests.

On Wed, Sep 9, 2009 at 5:33 PM, Ted Dunning<ted.dunning@gmail.com> wrote:
> How does IOUtils do this?
>
> On Wed, Sep 9, 2009 at 2:37 AM, Sean Owen (JIRA) <jira@apache.org> wrote:
>
>> > Uses IOUtils consistently to close Closeables,
>>
>
>
>
> --
> Ted Dunning, CTO
> DeepDyve
>

Mime
View raw message