V remove(Object key,int hash,Object value,HashEntry<K,V> header,V defaultValue){
  lock();
  try {
    int c=count - 1;
    HashEntry<K,V>[] tab=table;
    int index=hash & (tab.length - 1);
    HashEntry<K,V> first=tab[index];
    HashEntry<K,V> e=first;
    while (e != null && (e.hash != hash || !key.equals(e.key)))     e=e.next;
    V old=defaultValue;
    if (e != null) {
      if (value == null || value.equals(e.value)) {
        old=e.value;
        e.recordRemoval(header);
        ++modCount;
        HashEntry<K,V> newFirst=e.next;
        for (HashEntry<K,V> p=first; p != e; p=p.next)         newFirst=p.clone(newFirst,header);
        tab[index]=newFirst;
        count=c;
      }
    }
    return old;
  }
  finally {
    unlock();
  }
}

V remove ( Object key , int hash , Object value , HashEntry < K , V > header , V defaultValue ) { lock ( ) ; try { int c = count - 1 ; HashEntry < K , V > [ ] tab = table ; int index = hash & ( tab . length - 1 ) ; HashEntry < K , V > first = tab [ index ] ; HashEntry < K , V > e = first ; while ( e != null && ( e . hash != hash || ! key . equals ( e . key ) ) ) e = e . next ; V old = defaultValue ; if ( e != null ) { if ( value == null || value . equals ( e . value ) ) { old = e . value ; e . recordRemoval ( header ) ; ++ modCount ; HashEntry < K , V > newFirst = e . next ; for ( HashEntry < K , V > p = first ; p != e ; p = p . next ) newFirst = p . clone ( newFirst , header ) ; tab [ index ] = newFirst ; count = c ; } } return old ; } finally { unlock ( ) ; } }
remove ; match on key only if value null , else match both .
