@Test public void testIOExceptionBeforeClose() throws Exception { final IOException thrown = new IOException("mmm, baby"); final Reader throwingReader = createThrowingReader(thrown); final JavaCCReader reader = new JavaCCReader(throwingReader); try { reader.read(); fail("didn't get an exception"); } catch (RuntimeException caught) { assertSame(thrown, caught.getCause()); } }
@Override public int read(char[] cbuf, int off, int len) throws IOException { try { return reader.read(cbuf, off, len); } catch (IOException e) { return handleIOException(e); } }
JavaCCReader extends Reader { @Override public int read(char[] cbuf, int off, int len) throws IOException { try { return reader.read(cbuf, off, len); } catch (IOException e) { return handleIOException(e); } } }
JavaCCReader extends Reader { @Override public int read(char[] cbuf, int off, int len) throws IOException { try { return reader.read(cbuf, off, len); } catch (IOException e) { return handleIOException(e); } } JavaCCReader(Reader reader); }
JavaCCReader extends Reader { @Override public int read(char[] cbuf, int off, int len) throws IOException { try { return reader.read(cbuf, off, len); } catch (IOException e) { return handleIOException(e); } } JavaCCReader(Reader reader); @Override void close(); @Override int read(char[] cbuf, int off, int len); }
JavaCCReader extends Reader { @Override public int read(char[] cbuf, int off, int len) throws IOException { try { return reader.read(cbuf, off, len); } catch (IOException e) { return handleIOException(e); } } JavaCCReader(Reader reader); @Override void close(); @Override int read(char[] cbuf, int off, int len);  }