> +            out.name(String.valueOf(element.getKey()));
> +            valueAdapter.write(out, element.getValue());
> +         }
> +         out.endObject();
> +      }
> +
> +      public Map<K, V> read(JsonReader in) throws IOException {
> +         Map<K, V> result = Maps.newHashMap();
> +         in.beginObject();
> +         while (in.hasNext()) {
> +            JsonReaderInternalAccess.INSTANCE.promoteNameToValue(in);
> +            K name = keyAdapter.read(in);
> +            V value = valueAdapter.read(in);
> +            if (value != null) {
> +               // If there are repeated keys, only keep the last one
> +               result.remove(name);

Do we need this call? Doesn't `put` overwrite?

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

Reply via email to