Source:
<code>public ValueHolder<V> compute(final K key, final BiFunction<? super K, ? super V, ? extends V> mappingFunction, final NullaryFunction<Boolean> replaceEqual) throws CacheAccessException { checkKey(key); final long now = timeSource.getTimeMillis(); try { OnHeapValueHolder<V> computeResult = map.compute(key, new BiFunction<K, OnHeapValueHolder<V>, OnHeapValueHolder<V>>() { @Override public OnHeapValueHolder<V> apply(K mappedKey, OnHeapValueHolder<V> mappedValue) { if (mappedValue != null && mappedValue.isExpired(now, TimeUnit.MILLISECONDS)) { onExpiration(mappedKey, mappedValue); mappedValue = null; } V existingValue = mappedValue == null ? null : mappedValue.value(); V computedValue = mappingFunction.apply(mappedKey, existingValue); if (computedValue == null) { return null; } else if ((eq(existingValue, computedValue)) && (!replaceEqual.apply())) { if (mappedValue != null) { setAccessTimeAndExpiry(key, mappedValue, now); } return mappedValue; } checkValue(computedValue); if (mappedValue != null) { long expirationTime = mappedValue.expirationTime(OnHeapValueHolder.TIME_UNIT); return newUpdateValueHolder(key, existingValue, computedValue, now, expirationTime); } else { return newCreateValueHolder(key, computedValue, now); } } }); return enforceCapacityIfValueNotNull(computeResult); } catch (CachePassThroughException cpte) { <START> Throwable cause = cpte.getCause(); <END> if(cause instanceof RuntimeException) { throw (RuntimeException) cause; } else { throw wrapAsCacheAccessException(cause); } } catch (RuntimeException re) { throw wrapAsCacheAccessException(re); } }</code><technical_language>lines repeated place in AbstractOffHeapStore well. extracted. is interesting is of this requires context of this class, a valid candidate for a method CachePassThroughException</technical_language>

Target:
public ValueHolder<V> compute(final K key, final BiFunction<? super K, ? super V, ? extends V> mappingFunction, final NullaryFunction<Boolean> replaceEqual) throws CacheAccessException { checkKey(key); final long now = timeSource.getTimeMillis(); try { OnHeapValueHolder<V> computeResult = map.compute(key, new BiFunction<K, OnHeapValueHolder<V>, OnHeapValueHolder<V>>() { @Override public OnHeapValueHolder<V> apply(K mappedKey, OnHeapValueHolder<V> mappedValue) { if (mappedValue != null && mappedValue.isExpired(now, TimeUnit.MILLISECONDS)) { onExpiration(mappedKey, mappedValue); mappedValue = null; } V existingValue = mappedValue == null ? null : mappedValue.value(); V computedValue = mappingFunction.apply(mappedKey, existingValue); if (computedValue == null) { return null; } else if ((eq(existingValue, computedValue)) && (!replaceEqual.apply())) { if (mappedValue != null) { setAccessTimeAndExpiry(key, mappedValue, now); } return mappedValue; } checkValue(computedValue); if (mappedValue != null) { long expirationTime = mappedValue.expirationTime(OnHeapValueHolder.TIME_UNIT); return newUpdateValueHolder(key, existingValue, computedValue, now, expirationTime); } else { return newCreateValueHolder(key, computedValue, now); } } }); return enforceCapacityIfValueNotNull(computeResult); } catch (RuntimeException re) { handleRuntimeException(re); return null; } }