public void run(){
  try {
    while (true) {
      Reference ref=queue.remove();
      ref.clear();
synchronized (refs) {
        refs.remove(ref);
        if (refs.isEmpty()) {
          reaper=null;
          return;
        }
      }
    }
  }
 catch (  InterruptedException e) {
  }
}

public void run ( ) { try { while ( true ) { Reference ref = queue . remove ( ) ; ref . clear ( ) ; synchronized ( refs ) { refs . remove ( ref ) ; if ( refs . isEmpty ( ) ) { reaper = null ; return ; } } } } catch ( InterruptedException e ) { } }
keep removing refs from the queue , clearing them , and removing them from the refs list , until the refs list is empty .
