Currently I have two clone o master. The HEAD and 4d36 and I see the
difference on the file system.

I think this is wrong:
reader.close()
reader = null;
finally {
IOUtils.close(reader);
}
I know that IOUtils swallows exception on close().
I agree that better would be

method () throws IOException
<read>
}
finally
{
reader.close();
}
Most probably read/write operation would fail on before closing the stream,
but I would rather not to use IOUtil.close() since it swallows the
exception.

In case of PrintWriter it was just more simple to use it because of not
needed additional three objects:
FileOutputStream
OutputStreamWriter
BufferedWriter

I still do not understand why Oracle does not have IOException in method
signatures of PrintWriter but hopefully they introduced checkError().
For user it does not matter if the exception was originated from write() or
synthetic one. The important is that the plugin fails on fatal error
without hanging and with meaningful message.
I think we can do both:
+ compact code
+ IOException as well
We can add our utility class which closes PrintWriter, calls checkError()
and throws IOException. WDYT?







On Sun, Jan 8, 2017 at 2:43 AM, Christian Schulte <[email protected]> wrote:

> Am 01/08/17 um 01:27 schrieb Tibor Digana:
> > You committed right after me and you have reverted two Jira issue.
>
> This would not have been possible. What reverts are you talking about. I
> am locking at
> <https://git-wip-us.apache.org/repos/asf?p=maven-surefire.git>.
>
> > I do not want to continue until we make agreement.
> > If you want to see thrown IOException, then we can use
> InputStream.close()
> > instead of IOUtils.close().
> > Please nobody commit until we know what we clarify.
>
> Have you read the Javadoc of the 'closeQuietly' methods as I suggested?
> <http://commons.apache.org/proper/commons-io/javadocs/
> api-release/org/apache/commons/io/IOUtils.html>
>
> Looking at the commits, I get the impression, you haven't got the point
> in closing resources on failure and again added things suppressing
> exceptions not to ignore.
>
> > Except for PrintWriter there is again all old staff back like missed
> > flush(), etc.
>
> There are no missing flush calls. Where?
>
> > Btw. PrintWriter has a method which could be called and throw exception
> > from our code
>
> Why use the PrintWriter class in some private method if you must add
> special exception handling to it when you could just use a writer with
> standard exception handling? That's been my intention. I am still
> running the ITs locally. Will take a look if things don't succeed.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>


-- 
Cheers
Tibor

Reply via email to