/** * {@inheritDoc} */ public final void close() { // state check needed to "try" not to overwrite exception (lack of // synchronization may still allow overwriting but who cares that much if ( ! closed ) { // not going to sync because who cares if it takes a little longer // to stop but we need to set cause before toggling closed state // or else check for closure can throw null cause cause = new CursorClosedException(); closed = true; } }
/** * {@inheritDoc} */ public final void close( final String cause ) { // state check needed to "try" not to overwrite exception (lack of // synchronization may still allow overwriting but who cares that much if ( ! closed ) { // not going to sync because who cares if it takes a little longer // to stop but we need to set cause before toggling closed state // or else check for closure can throw null cause this.cause = new CursorClosedException( cause ); closed = true; } }