> + // Guava 18 and earlier method
> + isSuperTypeOfType =
> TypeToken.class.getDeclaredMethod("isAssignableFrom", Type.class);
> + isSuperTypeOfTypeToken =
> TypeToken.class.getDeclaredMethod("isAssignableFrom", TypeToken.class);
> + } catch (NoSuchMethodException nsme2) {
> + throw Throwables.propagate(nsme2);
> + }
> + }
> + IS_SUPERTYPE_OF_TYPE = isSuperTypeOfType;
> + IS_SUPERTYPE_OF_TYPETOKEN = isSuperTypeOfTypeToken;
> + }
> +
> + private TypeTokenUtils() {
> + throw new AssertionError("intentionally not implemented");
> + }
> +
> + public static <C> boolean isSupertypeOf(TypeToken<C> token, Type type) {
Do we know if this is much more efficient that simply doing:
```
return isSupertypeOf(token, TypeToken.of(type));
```
? See
https://google.github.io/guava/releases/19.0/api/docs/com/google/common/reflect/TypeToken.html#of(java.lang.reflect.Type).
That would allow to get down the class to use only _one_ method?
--
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/982/files/5be952718a45dd48d05cd93bb2f3a0b2a51b23ff#r77363270