Updated Branches: refs/heads/JCLOUDS-427-1.6.x d3849e2ff -> 17c11f2b2 (forced update)
Upgrade to Guava 15.0 Release notes: https://code.google.com/p/guava-libraries/wiki/Release15 Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/49491a56 Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/49491a56 Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/49491a56 Branch: refs/heads/JCLOUDS-427-1.6.x Commit: 49491a56a43f48d2972139cb157213d7071f249d Parents: e86462d Author: Andrew Gaul <[email protected]> Authored: Tue Aug 27 20:49:05 2013 -0700 Committer: Andrew Phillips <[email protected]> Committed: Fri Jan 24 02:04:05 2014 -0500 ---------------------------------------------------------------------- core/pom.xml | 2 +- .../concurrent/config/WithSubmissionTrace.java | 31 ++++++++++++++------ ...ctorAndReflectiveTypeAdapterFactoryTest.java | 3 +- 3 files changed, 25 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/jclouds/blob/49491a56/core/pom.xml ---------------------------------------------------------------------- diff --git a/core/pom.xml b/core/pom.xml index 781f2e3..c4364bd 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -90,7 +90,7 @@ <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> - <version>14.0.1</version> + <version>15.0</version> </dependency> <dependency> <groupId>org.osgi</groupId> http://git-wip-us.apache.org/repos/asf/jclouds/blob/49491a56/core/src/main/java/org/jclouds/concurrent/config/WithSubmissionTrace.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/jclouds/concurrent/config/WithSubmissionTrace.java b/core/src/main/java/org/jclouds/concurrent/config/WithSubmissionTrace.java index 0facd97..ff2ebd6 100644 --- a/core/src/main/java/org/jclouds/concurrent/config/WithSubmissionTrace.java +++ b/core/src/main/java/org/jclouds/concurrent/config/WithSubmissionTrace.java @@ -26,6 +26,7 @@ import java.util.Set; import java.util.concurrent.Callable; import java.util.concurrent.Delayed; import java.util.concurrent.ExecutionException; +import java.util.concurrent.Executor; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; @@ -113,7 +114,8 @@ public class WithSubmissionTrace { private static final Set<String> stackTracesToTrim = ImmutableSet.of(WithSubmissionTrace.class.getName(), ListeningExecutorService.class.getName(), ListenableFuture.class.getName(), - ListeningScheduledExecutorService.class.getName(), ScheduledFuture.class.getName()); + ListeningScheduledExecutorService.class.getName(), ScheduledFuture.class.getName(), + ListenableScheduledFuture.class.getName()); /** returns the stack trace at the caller */ private static StackTraceElement[] getStackTraceHere() { @@ -182,25 +184,25 @@ public class WithSubmissionTrace { @SuppressWarnings({ "rawtypes", "unchecked" }) @Override - public ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit) { - return new ScheduledFuture(delegate().schedule(command, delay, unit)); + public ListenableScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit) { + return new ListenableScheduledFuture(delegate().schedule(command, delay, unit)); } @Override - public <V> ScheduledFuture<V> schedule(Callable<V> callable, long delay, TimeUnit unit) { - return new ScheduledFuture<V>(delegate().schedule(callable, delay, unit)); + public <V> ListenableScheduledFuture<V> schedule(Callable<V> callable, long delay, TimeUnit unit) { + return new ListenableScheduledFuture(delegate().schedule(callable, delay, unit)); } @SuppressWarnings({ "rawtypes", "unchecked" }) @Override - public ScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) { - return new ScheduledFuture(delegate().scheduleAtFixedRate(command, initialDelay, period, unit)); + public ListenableScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) { + return new ListenableScheduledFuture(delegate().scheduleAtFixedRate(command, initialDelay, period, unit)); } @SuppressWarnings({ "rawtypes", "unchecked" }) @Override - public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) { - return new ScheduledFuture(delegate().scheduleWithFixedDelay(command, initialDelay, delay, unit)); + public ListenableScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) { + return new ListenableScheduledFuture(delegate().scheduleWithFixedDelay(command, initialDelay, delay, unit)); } } @@ -250,4 +252,15 @@ public class WithSubmissionTrace { } } + private static class ListenableScheduledFuture<T> extends ScheduledFuture<T> + implements com.google.common.util.concurrent.ListenableScheduledFuture<T> { + private ListenableScheduledFuture(com.google.common.util.concurrent.ListenableScheduledFuture<T> delegate) { + super(delegate); + } + + @Override + public void addListener(Runnable listener, Executor executor) { + ((com.google.common.util.concurrent.ListenableScheduledFuture<T>) delegate()).addListener(listener, executor); + } + } } http://git-wip-us.apache.org/repos/asf/jclouds/blob/49491a56/core/src/test/java/org/jclouds/json/internal/DeserializationConstructorAndReflectiveTypeAdapterFactoryTest.java ---------------------------------------------------------------------- diff --git a/core/src/test/java/org/jclouds/json/internal/DeserializationConstructorAndReflectiveTypeAdapterFactoryTest.java b/core/src/test/java/org/jclouds/json/internal/DeserializationConstructorAndReflectiveTypeAdapterFactoryTest.java index 0c57cef..8a3e62c 100644 --- a/core/src/test/java/org/jclouds/json/internal/DeserializationConstructorAndReflectiveTypeAdapterFactoryTest.java +++ b/core/src/test/java/org/jclouds/json/internal/DeserializationConstructorAndReflectiveTypeAdapterFactoryTest.java @@ -116,7 +116,8 @@ public final class DeserializationConstructorAndReflectiveTypeAdapterFactoryTest } } - @Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = "duplicate key: foo") + @Test(expectedExceptions = IllegalArgumentException.class, + expectedExceptionsMessageRegExp = "Multiple entries with same key: foo.*") public void testNoDuplicateSerializedNamesRequiredOnAllParameters() { parameterizedCtorFactory.create(gson, TypeToken.get(DuplicateSerializedNames.class)); }
