private static void expungeStaleExceptions(){
  for (Object x; (x=exceptionTableRefQueue.poll()) != null; ) {
    if (x instanceof ExceptionNode) {
      ExceptionNode[] t=exceptionTable;
      int i=((ExceptionNode)x).hashCode & (t.length - 1);
      ExceptionNode e=t[i];
      ExceptionNode pred=null;
      while (e != null) {
        ExceptionNode next=e.next;
        if (e == x) {
          if (pred == null)           t[i]=next;
 else           pred.next=next;
          break;
        }
        pred=e;
        e=next;
      }
    }
  }
}

private static void expungeStaleExceptions ( ) { for ( Object x ; ( x = exceptionTableRefQueue . poll ( ) ) != null ; ) { if ( x instanceof ExceptionNode ) { ExceptionNode [ ] t = exceptionTable ; int i = ( ( ExceptionNode ) x ) . hashCode & ( t . length - 1 ) ; ExceptionNode e = t [ i ] ; ExceptionNode pred = null ; while ( e != null ) { ExceptionNode next = e . next ; if ( e == x ) { if ( pred == null ) t [ i ] = next ; else pred . next = next ; break ; } pred = e ; e = next ; } } } }
polls stale refs and removes them . call only while holding lock .
