diff options
author | Tom Tromey <tromey@redhat.com> | 2001-02-13 18:55:13 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2001-02-13 18:55:13 +0000 |
commit | f3b43865acd32bed18eb7316eb8f9916bf8bfc9e (patch) | |
tree | c25167f3e73e64441f8cd01df631a5cab6684b6c /libjava/java/io/BufferedReader.java | |
parent | 967eb03e12d367a679c5a33a0fc13297dfadf327 (diff) | |
download | gcc-f3b43865acd32bed18eb7316eb8f9916bf8bfc9e.zip gcc-f3b43865acd32bed18eb7316eb8f9916bf8bfc9e.tar.gz gcc-f3b43865acd32bed18eb7316eb8f9916bf8bfc9e.tar.bz2 |
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
Diffstat (limited to 'libjava/java/io/BufferedReader.java')
-rw-r--r-- | libjava/java/io/BufferedReader.java | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/libjava/java/io/BufferedReader.java b/libjava/java/io/BufferedReader.java index 9a293da..6c54f03 100644 --- a/libjava/java/io/BufferedReader.java +++ b/libjava/java/io/BufferedReader.java @@ -1,4 +1,4 @@ -/* Copyright (C) 1998, 1999, 2000 Free Software Foundation +/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation This file is part of libgcj. @@ -128,9 +128,9 @@ public class BufferedReader extends Reader */ public void mark(int readLimit) throws IOException { - checkStatus(); synchronized (lock) { + checkStatus(); // In this method we need to be aware of the special case where // pos + 1 == limit. This indicates that a '\r' was the last char // in the buffer during a readLine. We'll want to maintain that @@ -185,9 +185,9 @@ public class BufferedReader extends Reader */ public void reset() throws IOException { - checkStatus(); synchronized (lock) { + checkStatus(); if (markPos < 0) throw new IOException("mark never set or invalidated"); @@ -215,9 +215,9 @@ public class BufferedReader extends Reader */ public boolean ready() throws IOException { - checkStatus(); synchronized (lock) { + checkStatus(); return pos < limit || in.ready(); } } @@ -242,9 +242,9 @@ public class BufferedReader extends Reader */ public int read(char[] buf, int offset, int count) throws IOException { - checkStatus(); synchronized (lock) { + checkStatus(); // Once again, we need to handle the special case of a readLine // that has a '\r' at the end of the buffer. In this case, we'll // need to skip a '\n' if it is the next char to be read. @@ -329,9 +329,9 @@ public class BufferedReader extends Reader public int read() throws IOException { - checkStatus(); synchronized (lock) { + checkStatus(); if (pos >= limit && fill () <= 0) return -1; return buffer[pos++]; @@ -444,11 +444,11 @@ public class BufferedReader extends Reader */ public long skip(long count) throws IOException { - checkStatus(); - if (count <= 0) - return 0; synchronized (lock) { + checkStatus(); + if (count <= 0) + return 0; // Yet again, we need to handle the special case of a readLine // that has a '\r' at the end of the buffer. In this case, we need // to ignore a '\n' if it is the next char to be read. |