/* * Decompiled with CFR 0.152. */ package com.google.common.cache; import com.google.common.annotations.Beta; import com.google.common.cache.AbstractCache; import com.google.common.cache.LoadingCache; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Maps; import com.google.common.util.concurrent.UncheckedExecutionException; import java.util.LinkedHashMap; import java.util.concurrent.ExecutionException; @Beta public abstract class AbstractLoadingCache extends AbstractCache implements LoadingCache { protected AbstractLoadingCache() { } @Override public V getUnchecked(K key) { try { return this.get(key); } catch (ExecutionException e) { throw new UncheckedExecutionException(e.getCause()); } } @Override public ImmutableMap getAll(Iterable keys) throws ExecutionException { LinkedHashMap result = Maps.newLinkedHashMap(); for (K key : keys) { if (result.containsKey(key)) continue; result.put(key, this.get(key)); } return ImmutableMap.copyOf(result); } @Override public final V apply(K key) { return this.getUnchecked(key); } @Override public void refresh(K key) { throw new UnsupportedOperationException(); } }