re PR libgcj/1913 (reading closed streams throws NullPointerException, not IOException)
From paul@dawa.demon.co.uk. Fix for PR libgcj/1913: * java/io/InputStreamReader.java (ready, read): Throw IOException if stream has been closed. From-SVN: r39553
This commit is contained in:
parent
1b43b6be4a
commit
8a5f950e04
@ -1,3 +1,9 @@
|
||||
2001-02-08 Tom Tromey <tromey@redhat.com>
|
||||
|
||||
From paul@dawa.demon.co.uk. Fix for PR libgcj/1913:
|
||||
* java/io/InputStreamReader.java (ready, read): Throw IOException
|
||||
if stream has been closed.
|
||||
|
||||
2001-02-08 Joseph S. Myers <jsm28@cam.ac.uk>
|
||||
|
||||
* README, gij.cc, java/lang/natClass.cc, java/lang/natSystem.cc:
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1998, 1999 Free Software Foundation
|
||||
/* Copyright (C) 1998, 1999, 2001 Free Software Foundation
|
||||
|
||||
This file is part of libgcj.
|
||||
|
||||
@ -71,6 +71,9 @@ public class InputStreamReader extends Reader
|
||||
{
|
||||
synchronized (lock)
|
||||
{
|
||||
if (in == null)
|
||||
throw new IOException("Stream closed");
|
||||
|
||||
if (wpos < wcount)
|
||||
return true;
|
||||
if (work == null)
|
||||
@ -102,6 +105,9 @@ public class InputStreamReader extends Reader
|
||||
{
|
||||
synchronized (lock)
|
||||
{
|
||||
if (in == null)
|
||||
throw new IOException("Stream closed");
|
||||
|
||||
int wavail = wcount - wpos;
|
||||
if (wavail > 0)
|
||||
{
|
||||
@ -136,6 +142,9 @@ public class InputStreamReader extends Reader
|
||||
{
|
||||
synchronized (lock)
|
||||
{
|
||||
if (in == null)
|
||||
throw new IOException("Stream closed");
|
||||
|
||||
int wavail = wcount - wpos;
|
||||
if (wavail > 0)
|
||||
return work[wpos++];
|
||||
|
Loading…
Reference in New Issue
Block a user