public static < T extends Closeable > T close ( T toClose , Logger logExceptionTo , Object name ) { if ( toClose == null ) return null ; try { toClose . close ( ) ; } catch ( IOException e ) { ( logExceptionTo == null ? logger : logExceptionTo ) . warn ( "IOException closing " + ( name == null ? toClose . toString ( ) : name ) + " ignored." , e ) ; } return null ; }
Handle closing .