This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch: java.io.PrintStream - PR/13176


Hi,

On Fri, 2003-12-05 at 18:22, Michael Koch wrote:
> On Fri, Dec 05, 2003 at 04:50:48PM +0100, Mark Wielaard wrote:
> > On Fri, 2003-12-05 at 16:32, Michael Koch wrote:
> > > On Fri, Dec 05, 2003 at 12:55:30AM +0100, Mark Wielaard wrote:
> > > > > @@ -435,6 +522,10 @@
> > > > >          if (auto_flush && (oneByte == '\n'))
> > > > >            flush ();
> > > > >        }
> > > > > +    catch (InterruptedIOException iioe)
> > > > > +      {
> > > > > +        Thread.currentThread ().interrupt ();
> > > > > +      }
> > > > >      catch (IOException e)
> > > > >        {
> > > > >          setError ();
> > > > 
> > > > How/why does this work and why do we need to do this?
> > > 
> > > After looking closer into this I removed that part of the patch. It was
> > > removed in revision 1.19 which fixed an PR.
> > 
> > Since you didn't remove it from flush(), close() and print() I assume it
> > is till needed there?
> 
> I dont know if its needed but doesnt seem to be wrong according to the
> testcase in PR/11778.
> 
> > How/Why does it work?
> 
> It uses always the current OutputStream object in "out". That way a
> subclass of PrintStream can always set a new object to it. The old
> implementation using PrintWriter could only use the object set to out
> during constructor execution because it gave a reference to the
> PrintWriter constructor.

OK. I understand that. I just don't understand why the catching of
InterruptedIOException and the calling Thread.interrupt() is needed in
the above methods, but not in the method were you say you removed it
again. It looks like for example print() can be interrupted, a
InterruptedIOException is thrown from natFileDescriptor who notices
that, but we catch it in print() and just return with as only indication
that something strange happened the fact that Thread.interrupted() will
return true. Is that on purpose?

Cheers,

Mark

Attachment: signature.asc
Description: This is a digitally signed message part


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]