(K key, int hash, CacheLoader<? super K, V> loader)
| 2255 | // loading |
| 2256 | |
| 2257 | V get(K key, int hash, CacheLoader<? super K, V> loader) throws ExecutionException { |
| 2258 | checkNotNull(key); |
| 2259 | checkNotNull(loader); |
| 2260 | try { |
| 2261 | if (count != 0) { // read-volatile |
| 2262 | // don't call getLiveEntry, which would ignore loading values |
| 2263 | ReferenceEntry<K, V> e = getEntry(key, hash); |
| 2264 | if (e != null) { |
| 2265 | long now = map.ticker.read(); |
| 2266 | V value = getLiveValue(e, now); |
| 2267 | if (value != null) { |
| 2268 | recordRead(e, now); |
| 2269 | statsCounter.recordHits(1); |
| 2270 | return scheduleRefresh(e, key, hash, value, now, loader); |
| 2271 | } |
| 2272 | ValueReference<K, V> valueReference = e.getValueReference(); |
| 2273 | if (valueReference.isLoading()) { |
| 2274 | return waitForLoadingValue(e, key, valueReference); |
| 2275 | } |
| 2276 | } |
| 2277 | } |
| 2278 | |
| 2279 | // at this point e is either null or expired; |
| 2280 | return lockedGetOrLoad(key, hash, loader); |
| 2281 | } catch (ExecutionException ee) { |
| 2282 | Throwable cause = ee.getCause(); |
| 2283 | if (cause instanceof Error) { |
| 2284 | throw new ExecutionError((Error) cause); |
| 2285 | } else if (cause instanceof RuntimeException) { |
| 2286 | throw new UncheckedExecutionException(cause); |
| 2287 | } |
| 2288 | throw ee; |
| 2289 | } finally { |
| 2290 | postReadCleanup(); |
| 2291 | } |
| 2292 | } |
| 2293 | |
| 2294 | V lockedGetOrLoad(K key, int hash, CacheLoader<? super K, V> loader) throws ExecutionException { |
| 2295 | ReferenceEntry<K, V> e; |
nothing calls this directly
no test coverage detected