Patch: java.io.PrintStream - PR/13176

Mark Wielaard mark@klomp.org
Sun Dec 7 10:50:00 GMT 2003


Hi,

On Sun, 2003-12-07 at 01:32, Bryce McKinlay wrote:

> PrintStream methods must catch InterruptedIOException because its a 
> checked exception. On the other hand, the docs for checkError state 
> that "The internal error state is set to true when the underlying 
> output stream throws an IOException other than InterruptedIOException 
> ...".

Interesting. The Class Library Books say nothing about
InterruptedIOException at all. It just says that any IOException makes
checkError() return true. Your documentation seems to indicate that
InterruptedIOExceptions are special, but don't mention anything about
the interrupted status of the Thread. But checking the online 1.4.1 docs
for checkError() on java.sun.com seem to indicate that the original code
was actually correct: "The internal error state is set to true when the
underlying output stream throws an IOException other than
InterruptedIOException, and when the setError method is invoked. If an
operation on the underlying output stream throws an
InterruptedIOException, then the PrintStream converts the exception back
into an interrupt by doing Thread.currentThread().interrupt(); or the
equivalent."

Sigh. I am sorry I brought this up. Clearly there isn't a consensus on
this point. Having a real spec for the core class libraries would be
nice... Maybe we need a Mauve test for this. 

But for now I think we should go for Michael his original patch since it
does fix a regression.

Cheers,

Mark

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20031207/52920bb0/attachment.sig>


More information about the Java-patches mailing list