public synchronized void removeBlanks(){
  if (DEBUG != null)   DEBUG.println("WeakTable.removeBlanks: starting");
  Reference ref;
  while ((ref=refQueue.poll()) != null) {
    if (ref instanceof WeakKeyReference) {
      final WeakReference valref=(WeakReference)table.remove(ref);
      if (valref != null && handler != null && valref.get() != null)       handler.keyGC(valref.get());
      if (DEBUG != null) {
        boolean removed=(valref != null);
        DEBUG.print("WeakTable.removeBlanks: key=" + ref);
        DEBUG.println(", " + (removed ? "" : "!") + "removed, "+ table.size()+ " remain");
      }
    }
 else {
      if (DEBUG != null)       DEBUG.println("WeakTable.removeBlanks: value=" + ref);
    }
  }
  if (DEBUG != null)   DEBUG.println("WeakTable.removeBlanks: finished");
}

public synchronized void removeBlanks ( ) { if ( DEBUG != null ) DEBUG . println ( "WeakTable.removeBlanks: starting" ) ; Reference ref ; while ( ( ref = refQueue . poll ( ) ) != null ) { if ( ref instanceof WeakKeyReference ) { final WeakReference valref = ( WeakReference ) table . remove ( ref ) ; if ( valref != null && handler != null && valref . get ( ) != null ) handler . keyGC ( valref . get ( ) ) ; if ( DEBUG != null ) { boolean removed = ( valref != null ) ; DEBUG . print ( "WeakTable.removeBlanks: key=" + ref ) ; DEBUG . println ( ", " + ( removed ? "" : "!" ) + "removed, " + table . size ( ) + " remain" ) ; } } else { if ( DEBUG != null ) DEBUG . println ( "WeakTable.removeBlanks: value=" + ref ) ; } } if ( DEBUG != null ) DEBUG . println ( "WeakTable.removeBlanks: finished" ) ; }
remove any blank entries from the table . this can be invoked by a reaping thread if you like .
