You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jclouds.apache.org by Andrew Phillips <no...@github.com> on 2014/01/23 09:10:10 UTC

Re: [jclouds] Avoiding broken parts of Guava (#261)

> +import com.google.common.reflect.TypeToken;
> +
> +/*
> + * FIXME: remove this class ASAP!
> + *
> + * Evil stuff, adapted from https://code.google.com/p/guava-libraries/source/browse/guava/src/com/google/common/reflect/TypeToken.java#236.
> + * See https://issues.apache.org/jira/browse/JCLOUDS-427 and
> + * https://code.google.com/p/guava-libraries/issues/detail?id=1635
> + */
> +public class TypeToken2<T> extends TypeToken<T> {
> +   @SuppressWarnings("unchecked")
> +   public <X, Y> TypeToken<T> where(TypeParameter<X> typeParam1, 
> +         TypeToken<X> typeArg1, TypeParameter<Y> typeParam2, TypeToken<Y> typeArg2) {
> +      // resolving both parameters in one shot seems to work around 1635
> +      TypeResolver resolver = new TypeResolver()
> +            .where(ImmutableMap.of(typeParam1.typeVariable, typeArg1.getType(), typeParam2.typeVariable, typeArg2.getType()));

Needs some line breaking here

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/261/files#r9105353