(K key, int hash, CacheLoader<? super K, V> loader)
| 2183 | // loading |
| 2184 | |
| 2185 | V get(K key, int hash, CacheLoader<? super K, V> loader) throws ExecutionException { |
| 2186 | checkNotNull(key); |
| 2187 | checkNotNull(loader); |
| 2188 | try { |
| 2189 | if (count != 0) { // read-volatile |
| 2190 | // don't call getLiveEntry, which would ignore loading values |
| 2191 | ReferenceEntry<K, V> e = getEntry(key, hash); |
| 2192 | if (e != null) { |
| 2193 | long now = map.ticker.read(); |
| 2194 | V value = getLiveValue(e, now); |
| 2195 | if (value != null) { |
| 2196 | recordRead(e, now); |
| 2197 | statsCounter.recordHits(1); |
| 2198 | return scheduleRefresh(e, key, hash, value, now, loader); |
| 2199 | } |
| 2200 | ValueReference<K, V> valueReference = e.getValueReference(); |
| 2201 | if (valueReference.isLoading()) { |
| 2202 | return waitForLoadingValue(e, key, valueReference); |
| 2203 | } |
| 2204 | } |
| 2205 | } |
| 2206 | |
| 2207 | // at this point e is either null or expired; |
| 2208 | return lockedGetOrLoad(key, hash, loader); |
| 2209 | } catch (ExecutionException ee) { |
| 2210 | Throwable cause = ee.getCause(); |
| 2211 | if (cause instanceof Error) { |
| 2212 | throw new ExecutionError((Error) cause); |
| 2213 | } else if (cause instanceof RuntimeException) { |
| 2214 | throw new UncheckedExecutionException(cause); |
| 2215 | } |
| 2216 | throw ee; |
| 2217 | } finally { |
| 2218 | postReadCleanup(); |
| 2219 | } |
| 2220 | } |
| 2221 | |
| 2222 | V lockedGetOrLoad(K key, int hash, CacheLoader<? super K, V> loader) throws ExecutionException { |
| 2223 | ReferenceEntry<K, V> e; |
nothing calls this directly
no test coverage detected