@SuppressWarnings("unchecked") private void expungeStaleEntries(){
synchronized (sync) {
    ListWeakReference r;
    while ((r=(ListWeakReference)queue.poll()) != null) {
      ListEntry le=r.getListEntry();
      int i=list.indexOf(le);
      if (i != -1) {
        list.remove(i);
      }
    }
  }
}

@ SuppressWarnings ( "unchecked" ) private void expungeStaleEntries ( ) { synchronized ( sync ) { ListWeakReference r ; while ( ( r = ( ListWeakReference ) queue . poll ( ) ) != null ) { ListEntry le = r . getListEntry ( ) ; int i = list . indexOf ( le ) ; if ( i != - 1 ) { list . remove ( i ) ; } } } }
expunge stale entries from the list .
