PipedReader.java (ready): Throw IOException if pipe closed.

* java/io/PipedReader.java (ready): Throw IOException if pipe
	closed.
	* java/io/FilterReader.java (close): Don't clear `in'.
	* java/io/CharArrayReader.java (mark): Throw IOException if stream
	closed.
	(read, ready, reset, skip): Added exception message.
	* java/io/BufferedReader.java (mark, reset, ready, read, skip):
	Perform checkStatus check inside synchronized block.

From-SVN: r39641
This commit is contained in:
Tom Tromey 2001-02-13 18:55:13 +00:00 committed by Tom Tromey
parent 967eb03e12
commit f3b43865ac
5 changed files with 40 additions and 19 deletions

View file

@ -312,10 +312,15 @@ public class PipedReader extends Reader
public boolean ready() throws IOException
{
// The JDK 1.3 implementation does not appear to check for the closed or
// unconnected stream conditions here.
// unconnected stream conditions here. However, checking for a
// closed stream is explicitly required by the JDK 1.2 and 1.3
// documentation (for Reader.close()), so we do it.
synchronized (lock)
{
if (closed)
throw new IOException("Pipe closed");
if (in < 0)
return false;