Skip to content

Commit

Permalink
Merge branch '2.10'
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Dec 15, 2018
2 parents 66550f5 + 396e9d1 commit c374783
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,8 @@ EclipseMapDeserializer<T, I, K, V> createDeserializer(JavaType type) {
MapIterable.class.isAssignableFrom(rawClass);
boolean refKey = refValue ? (typeParameters.size() == 2) : (typeParameters.size() == 1);

K keyHandler = typeHandlerPair.keyHandler(refKey ? typeParameters.get(typeParameters.size() - 1) : null);
V valueHandler = typeHandlerPair.valueHandler(refValue ? typeParameters.get(0) : null);
K keyHandler = typeHandlerPair.keyHandler(refKey ? typeParameters.get(0) : null);
V valueHandler = typeHandlerPair.valueHandler(refValue ? typeParameters.get(typeParameters.size() - 1) : null);

return new DeserializerImpl(keyHandler, valueHandler);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -650,4 +650,14 @@ public void pairTyped() throws Exception {
mapperWithModule().readValue(json, new TypeReference<ObjectIntPair<A>>() {})
);
}

@Test
public void nestedMap() throws Exception {
MutableMap<String, MutableMap<String, String>> pair = Maps.mutable.of("a", Maps.mutable.of("b", "c"));
String json = "{\"a\":{\"b\":\"c\"}}";
TypeReference<MutableMap<String, MutableMap<String, String>>> type =
new TypeReference<MutableMap<String, MutableMap<String, String>>>() {};
Assert.assertEquals(json, mapperWithModule().writerFor(type).writeValueAsString(pair));
Assert.assertEquals(pair, mapperWithModule().readValue(json, type));
}
}
1 change: 1 addition & 0 deletions release-notes/VERSION-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Modules:
#37: (eclipse-collections) Implement pair deserialization
(contributed by Jonas K)

2.9.8 (15-Dec-2018)
2.9.7 (19-Sep-2018)

No changes since 2.9.6
Expand Down

0 comments on commit c374783

Please sign in to comment.