@Override public void close() throws IOException { boolean done = isDone(); Throwable thrown = null; try { baseYielder.close(); } catch (Throwable t) { thrown = t; throw t; } finally { if (done) { if (thrown != null) { try { executor.execute(runnable); } catch (Throwable t) { thrown.addSuppressed(t); } } else { executor.execute(runnable); } } } } }
@Override public void close() throws IOException { boolean done = isDone(); Throwable thrown = null; try { baseYielder.close(); } catch (Throwable t) { thrown = t; throw t; } finally { if (done) { if (thrown != null) { try { executor.execute(runnable); } catch (Throwable t) { thrown.addSuppressed(t); } } else { executor.execute(runnable); } } } } }