Skip to content

Commit e0fbce7

Browse files
committed
Fix AbstractReader#readMapByType
1 parent 3e6a5c0 commit e0fbce7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/net/elytrium/serializer/language/reader/AbstractReader.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,9 @@ private Map<Object, Object> readMapByType(Field owner, Type type) {
267267
} catch (InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException e) {
268268
throw new SerializableReadException(e);
269269
}
270-
} else if (Map.class.isAssignableFrom(owner.getType())) {
270+
} else {
271271
try {
272-
Constructor<?> constructor = owner.getType().getDeclaredConstructor();
272+
Constructor<?> constructor = GenericUtils.unwrapClassParameterizedType(type).getDeclaredConstructor();
273273
constructor.setAccessible(true);
274274
return this.readMap(owner, (Map<Object, Object>) constructor.newInstance(), mapKeyType, mapValueType);
275275
} catch (InstantiationException | IllegalAccessException | InvocationTargetException e) {

0 commit comments

Comments
 (0)