private void cleanUp(Reference<?> reference) throws ShutDown {
  Method finalizeReferentMethod=getFinalizeReferentMethod();
  do {
    reference.clear();
    if (reference == frqReference) {
      throw new ShutDown();
    }
    try {
      finalizeReferentMethod.invoke(reference);
    }
 catch (    Throwable t) {
      logger.log(Level.SEVERE,"Error cleaning up after reference.",t);
    }
  }
 while ((reference=queue.poll()) != null);
}

private void cleanUp ( Reference < ? > reference ) throws ShutDown { Method finalizeReferentMethod = getFinalizeReferentMethod ( ) ; do { reference . clear ( ) ; if ( reference == frqReference ) { throw new ShutDown ( ) ; } try { finalizeReferentMethod . invoke ( reference ) ; } catch ( Throwable t ) { logger . log ( Level . SEVERE , "Error cleaning up after reference." , t ) ; } } while ( ( reference = queue . poll ( ) ) != null ) ; }
cleans up a single reference . catches and logs all throwables .
