Skip to content

Commit bf403a1

Browse files
committed
Merge branch '2.11' into 2.12
2 parents 4d62d4c + 0d451d6 commit bf403a1

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

eclipse-collections/src/main/java/com/fasterxml/jackson/datatype/eclipsecollections/EclipseCollectionsDeserializers.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,8 @@ public JsonDeserializer<?> findCollectionDeserializer(
170170
JsonDeserializer<?> elementDeserializer
171171
) throws JsonMappingException {
172172
if (REFERENCE_TYPES.contains(type.getRawClass())) {
173-
return findReferenceDeserializer(type, elementTypeDeserializer, elementDeserializer);
173+
return findReferenceDeserializer(type, type.getContentType(),
174+
elementTypeDeserializer, elementDeserializer);
174175
}
175176
return null;
176177
}
@@ -184,7 +185,8 @@ public JsonDeserializer<?> findCollectionLikeDeserializer(
184185
JsonDeserializer<?> elementDeserializer
185186
) throws JsonMappingException {
186187
if (REFERENCE_TYPES.contains(type.getRawClass())) {
187-
return findReferenceDeserializer(type, elementTypeDeserializer, elementDeserializer);
188+
return findReferenceDeserializer(type, type.getContentType(),
189+
elementTypeDeserializer, elementDeserializer);
188190
}
189191
return null;
190192
}
@@ -225,7 +227,7 @@ public JsonDeserializer<?> findBeanDeserializer(
225227

226228
//noinspection SuspiciousMethodCalls
227229
if (REFERENCE_TYPES.contains(type.getRawClass())) {
228-
return findReferenceDeserializer(type, null, null);
230+
return findReferenceDeserializer(type, type.containedTypeOrUnknown(0), null, null);
229231
}
230232

231233
EclipseMapDeserializer<?, ?, ?, ?> mapDeserializer = EclipseMapDeserializers.createDeserializer(type);
@@ -239,10 +241,11 @@ public JsonDeserializer<?> findBeanDeserializer(
239241
@SuppressWarnings({ "ObjectEquality", "LocalVariableNamingConvention", "ConstantConditions" })
240242
private JsonDeserializer<?> findReferenceDeserializer(
241243
JavaType containerType,
242-
TypeDeserializer elementTypeDeserializer, JsonDeserializer<?> elementDeserializer
244+
JavaType elementType,
245+
TypeDeserializer elementTypeDeserializer,
246+
JsonDeserializer<?> elementDeserializer
243247
) {
244248
Class<?> rawClass = containerType.getRawClass();
245-
JavaType elementType = containerType.containedType(0);
246249

247250
// bags
248251
if (rawClass == MutableBag.class || rawClass == Bag.class || rawClass == UnsortedBag.class) {

eclipse-collections/src/main/java/com/fasterxml/jackson/datatype/eclipsecollections/EclipseCollectionsTypeModifier.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public JavaType modifyType(JavaType type, Type jdkType, TypeBindings context, Ty
1414
if (!type.isCollectionLikeType()) {
1515
JavaType collectionType = type.findSuperType(ImmutableCollection.class);
1616
if (collectionType != null) {
17-
return CollectionLikeType.upgradeFrom(type, collectionType.containedType(0));
17+
return CollectionLikeType.upgradeFrom(type, collectionType.containedTypeOrUnknown(0));
1818
}
1919
}
2020
return type;

eclipse-collections/src/test/java/com/fasterxml/jackson/datatype/eclipsecollections/DeserializerTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,10 @@ public void mutableCollection() throws IOException {
316316
testCollection(Lists.mutable.of("1", "2", "3"),
317317
"[\"1\", \"2\", \"3\"]",
318318
new TypeReference<MutableCollection<String>>() {});
319+
//noinspection rawtypes
320+
testCollection(Lists.mutable.of("1", "2", "3"),
321+
"[\"1\", \"2\", \"3\"]",
322+
new TypeReference<MutableCollection>() {});
319323
testCollection(BooleanLists.mutable.of(true, false, true),
320324
"[true, false, true]",
321325
MutableBooleanCollection.class);
@@ -335,6 +339,10 @@ public void immutableCollection() throws IOException {
335339
testCollection(Lists.immutable.of("1", "2", "3"),
336340
"[\"1\", \"2\", \"3\"]",
337341
new TypeReference<ImmutableCollection<String>>() {});
342+
//noinspection rawtypes
343+
testCollection(Lists.immutable.of("1", "2", "3"),
344+
"[\"1\", \"2\", \"3\"]",
345+
new TypeReference<ImmutableCollection>() {});
338346
testCollection(BooleanLists.immutable.of(true, false, true),
339347
"[true, false, true]",
340348
ImmutableBooleanCollection.class);

0 commit comments

Comments
 (0)