ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephane Bailliez <sbaill...@imediation.com>
Subject RE: cvs commit: jakarta-ant/src/main/org/apache/tools/ant Default Logger.java
Date Tue, 11 Dec 2001 15:18:59 GMT
> -----Original Message-----
> From: Stefan Bodewig [mailto:bodewig@apache.org]

> On Tue, 11 Dec 2001, Stephane Bailliez <sbailliez@imediation.com>
> wrote:
> 
> > It calls flush of the wrapped stream if there is any '\n'
> > encountered in what is being written.
> 
> This is what the documentation of flush says, the rest has not been
> that clear to me.  Anyway, I've changed the class and remove the
> printlnAndFlush method.

I'm always looking at the source code to be sure :)

Sample from PrintStream...they are all using the same logic

    private void write(String s) {
	try {
	    synchronized (this) {
		ensureOpen();
		textOut.write(s);
		textOut.flushBuffer();
		charOut.flushBuffer();
		if (autoFlush && (s.indexOf('\n') >= 0))
		    out.flush();
	    }
	}
	catch (InterruptedIOException x) {
	    Thread.currentThread().interrupt();
	}
	catch (IOException x) {
	    trouble = true;
	}
    }

Stephane

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message