andrewgaul requested changes on this pull request.
Overall looks good; please address comments. Also reword the commit message to
something meaningful and just use JCLOUDS-1334 instead of the URL.
> @@ -113,7 +153,7 @@ protected void configure() { // NO_UCD
@Provides
@Singleton
final TimeLimiter timeLimiter(@Named(PROPERTY_USER_THREADS)
ListeningExecutorService userExecutor) {
- return new SimpleTimeLimiter(userExecutor);
+ return createSimpleTimeLimiter(userExecutor);
Could you also make changes to `BaseRestApiExpectTest` and
`BaseRestApiTest.java` for consistency?
> @@ -54,6 +58,42 @@
@ConfiguresExecutorService
public class ExecutorServiceModule extends AbstractModule {
+ private static final Method CREATE_STL;
Please add a comment explaining that this code works around Guava 18 and 23
compatibility.
> + }
+
+ static SimpleTimeLimiter createSimpleTimeLimiter(ExecutorService
executorService) {
+ try {
+ if (CREATE_STL != null) {
+ return (SimpleTimeLimiter) CREATE_STL.invoke(null,
executorService);
+ } else if (CONSTRUCT_STL != null) {
+ return CONSTRUCT_STL.newInstance(executorService);
+ }
+ // fall through
+ } catch (IllegalAccessException iae) {
+ // fall through
+ } catch (InstantiationException ie) {
+ // fall through
+ } catch (InvocationTargetException ite) {
+ // fall through
It would be better to propagate the cause of these exceptions.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/1133#pullrequestreview-58808745