Changeset 11982


Ignore:
Timestamp:
06/01/09 19:18:24 (12 years ago)
Author:
ehuelsmann
Message:

Don't use exceptions to find out the reader is null;
instead, check it on function entry.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/Stream.java

    r11980 r11982  
    18391839  protected void _unreadChar(int n) throws ConditionThrowable
    18401840  {
     1841    if (reader == null)
     1842        streamNotCharacterInputStream();
     1843
    18411844    try
    18421845      {
     
    18461849        if (n == eolChar)
    18471850          --lineNumber;
    1848       }
    1849     catch (NullPointerException e)
    1850       {
    1851         // reader is null
    1852         streamNotCharacterInputStream();
    18531851      }
    18541852    catch (IOException e)
     
    18651863  protected boolean _charReady() throws ConditionThrowable
    18661864  {
     1865    if (reader == null)
     1866        streamNotCharacterInputStream();
     1867
    18671868    try
    18681869      {
    18691870        return reader.ready();
    1870       }
    1871     catch (NullPointerException e)
    1872       {
    1873         // reader is null
    1874         streamNotCharacterInputStream();
    18751871      }
    18761872    catch (IOException e)
Note: See TracChangeset for help on using the changeset viewer.