From a80e1b07e6bae790868e15e51d3c061d31625590 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Thu, 22 Dec 2011 03:21:45 -0800 Subject: [PATCH] updated to guava 11 cache miss behavior --- .../cloudsigma/compute/CloudSigmaComputeServiceAdapter.java | 3 ++- .../compute/ElasticStackComputeServiceAdapter.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/compute/CloudSigmaComputeServiceAdapter.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/compute/CloudSigmaComputeServiceAdapter.java index 4221058ece..d67a7986be 100644 --- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/compute/CloudSigmaComputeServiceAdapter.java +++ b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/compute/CloudSigmaComputeServiceAdapter.java @@ -58,6 +58,7 @@ import org.jclouds.logging.Logger; import com.google.common.base.Function; import com.google.common.base.Predicate; import com.google.common.base.Predicates; +import com.google.common.cache.CacheLoader; import com.google.common.cache.LoadingCache; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; @@ -169,7 +170,7 @@ public class CloudSigmaComputeServiceAdapter implements public Future apply(String input) { try { return Futures.immediateFuture(cache.getUnchecked(input)); - } catch (NullPointerException e) { + } catch (CacheLoader.InvalidCacheLoadException e) { logger.debug("drive %s not found", input); } catch (UncheckedExecutionException e) { logger.warn(e, "error finding drive %s: %s", input, e.getMessage()); diff --git a/apis/elasticstack/src/main/java/org/jclouds/elasticstack/compute/ElasticStackComputeServiceAdapter.java b/apis/elasticstack/src/main/java/org/jclouds/elasticstack/compute/ElasticStackComputeServiceAdapter.java index 28bc3ebe73..3bfd57a83c 100644 --- a/apis/elasticstack/src/main/java/org/jclouds/elasticstack/compute/ElasticStackComputeServiceAdapter.java +++ b/apis/elasticstack/src/main/java/org/jclouds/elasticstack/compute/ElasticStackComputeServiceAdapter.java @@ -61,6 +61,7 @@ import org.jclouds.logging.Logger; import com.google.common.base.Function; import com.google.common.base.Predicate; +import com.google.common.cache.CacheLoader; import com.google.common.cache.LoadingCache; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; @@ -169,7 +170,7 @@ public class ElasticStackComputeServiceAdapter implements public Future apply(String input) { try { return Futures.immediateFuture(cache.getUnchecked(input)); - } catch (NullPointerException e) { + } catch (CacheLoader.InvalidCacheLoadException e) { logger.debug("drive %s not found", input); } catch (UncheckedExecutionException e) { logger.warn(e, "error finding drive %s: %s", input, e.getMessage());