@Test public void closeAndConvert_withNull_swallow() { Closeables.closeAndConvert(null, true); }
public static void closeAndConvert(@Nullable final Closeable closeable, final boolean swallowIOException) { if (closeable != null) { try { closeable.close(); } catch (final IOException e) { if (!swallowIOException) { throw new CannotCloseException(e.getLocalizedMessage(), e); } LOG.warn(e.getLocalizedMessage(), e); } } }
Closeables { public static void closeAndConvert(@Nullable final Closeable closeable, final boolean swallowIOException) { if (closeable != null) { try { closeable.close(); } catch (final IOException e) { if (!swallowIOException) { throw new CannotCloseException(e.getLocalizedMessage(), e); } LOG.warn(e.getLocalizedMessage(), e); } } } }
Closeables { public static void closeAndConvert(@Nullable final Closeable closeable, final boolean swallowIOException) { if (closeable != null) { try { closeable.close(); } catch (final IOException e) { if (!swallowIOException) { throw new CannotCloseException(e.getLocalizedMessage(), e); } LOG.warn(e.getLocalizedMessage(), e); } } } private  Closeables(); }
Closeables { public static void closeAndConvert(@Nullable final Closeable closeable, final boolean swallowIOException) { if (closeable != null) { try { closeable.close(); } catch (final IOException e) { if (!swallowIOException) { throw new CannotCloseException(e.getLocalizedMessage(), e); } LOG.warn(e.getLocalizedMessage(), e); } } } private  Closeables(); static void close(@Nullable final Closeable closeable, final boolean swallowIOException); static void closeAndConvert(@Nullable final Closeable closeable, final boolean swallowIOException); }
Closeables { public static void closeAndConvert(@Nullable final Closeable closeable, final boolean swallowIOException) { if (closeable != null) { try { closeable.close(); } catch (final IOException e) { if (!swallowIOException) { throw new CannotCloseException(e.getLocalizedMessage(), e); } LOG.warn(e.getLocalizedMessage(), e); } } } private  Closeables(); static void close(@Nullable final Closeable closeable, final boolean swallowIOException); static void closeAndConvert(@Nullable final Closeable closeable, final boolean swallowIOException);  }