> @@ -201,6 +206,18 @@ public String toString() {
>        }
>     }
>  
> +   public static class ImmutableMapDeserializer implements 
> JsonDeserializer<ImmutableMap<?,?>> {
> +      @Override
> +      public ImmutableMap<?,?> deserialize(final JsonElement json, final 
> Type type,
> +            final JsonDeserializationContext context) throws 
> JsonParseException
> +      {
> +         final Type type2 =
> +               ParameterizedTypeImpl.make(Map.class, ((ParameterizedType) 
> type).getActualTypeArguments(), null);
> +         final Map<?,?> map = context.deserialize(json, type2);
> +         return ImmutableMap.copyOf(map);

I think moving.
Here is the case:
In neutron, I have a domain object which contains an ImmutableMap collection, 
as most (probably all) collections we use should be. Currently (before this 
fix) the constructor will take a regular Map, and then use copyOf to 
instantiate the ImmutableMap.

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

Reply via email to