private synchronized void expungeStaleEntries ( ) { if ( size == 0 ) return ; Object r ; while ( ( r = queue . poll ( ) ) != null ) { Entry e = ( Entry ) r ; unlink ( e ) ; int h = e . hash ; int i = indexFor ( h , table . length ) ; Entry prev = table [ i ] ; Entry p = prev ; while ( p != null ) { Entry next = p . next ; if ( p == e ) { if ( prev == e ) table [ i ] = next ; else prev . next = next ; e . next = null ; // Help GC size -- ; break ; } prev = p ; p = next ; } } }
Expunge stale entries from the table .