public synchronized V remove(Object key, boolean internal) {
        // noinspection SuspiciousMethodCalls
        CacheObject<V> cacheObject = map.remove(key);
        // If the object is not in cache, stop trying to remove it.
        if (cacheObject == null) {
            return null;
        }
        // Remove from the cache order list
        cacheObject.lastAccessedListNode.remove();
        cacheObject.ageListNode.remove();
        // Remove references to linked list nodes
        cacheObject.ageListNode = null;
        cacheObject.lastAccessedListNode = null;

        return cacheObject.object;
    }
public synchronized V remove(Object key, boolean internal) {
        
        CacheObject<V> cacheObject = map.remove(key);
        
        if (cacheObject == null) {
            return null;
        }
        
        cacheObject.lastAccessedListNode.remove();
        cacheObject.ageListNode.remove();
        
        cacheObject.ageListNode = null;
        cacheObject.lastAccessedListNode = null;

        return cacheObject.object;
    }
public synchronized V remove ( Object key , boolean internal ) { // noinspection SuspiciousMethodCalls CacheObject < V > cacheObject = map . remove ( key ) ; // If the object is not in cache, stop trying to remove it. if ( cacheObject == null ) { return null ; } // Remove from the cache order list cacheObject . lastAccessedListNode . remove ( ) ; cacheObject . ageListNode . remove ( ) ; // Remove references to linked list nodes cacheObject . ageListNode = null ; cacheObject . lastAccessedListNode = null ; return cacheObject . object ; }
/*
Remove operation with a flag so we can tell coherence if the remove was
caused by cache internal processing such as eviction or loading
/ * Remove operation with a flag so we can tell coherence if the remove was caused by cache internal processing such as eviction or loading