protected boolean replace ( final K key , final boolean _compare , final V _oldValue , final V _newValue ) { Entry e = lookupEntry ( key ) ; if ( e == null ) { metrics . peekMiss ( ) ; return false ; } synchronized ( e ) { e . waitForProcessing ( ) ; if ( e . isGone ( ) || ! e . hasFreshData ( clock ) ) { return false ; } if ( _compare && ! e . equalsValue ( _oldValue ) ) { return false ; } putValue ( e , _newValue ) ; } return true ; }
replace if value matches . if value not matches return the existing entry or the dummy entry .