void function ( @ Nullable Closeable arg0 , boolean arg1 ) { if ( arg0 == null ) { return ; } try { arg0 . close ( ) ; } catch ( IOException loc0 ) { if ( arg1 ) { logger . log ( Level . WARNING , "srini_string" , loc0 ) ; } else { throw loc0 ; } } }
closes a closeable , with control over whether an ioexception may be thrown.this is primarily useful in a finally block , where a thrown exception needs to be logged but not propagated otherwise the original exception will be lost . if swallowioexception is true then we never throw ioexception but merely logit . example : public void usestreamnicely throws ioexception somestream stream = new somestream `` foo '' ; boolean threw = true ; try / / ... code which does something with the stream ... threw = false ; finally / / if an exception occurs , rethrow it only if threw == false : closeables.close stream , threw ; concode_field_sep Logger logger concode_field_sep void closeQuietly concode_elem_sep void closeQuietly