morphia
morphia copied to clipboard
ClassCastException in dev.morphia.mapping.codec.pojo.TypeData
Describe the bug
in dev.morphia.mapping.codec.pojo.TypeData#get(java.lang.reflect.Type)
} else if (type instanceof Class) {
var typeData = new TypeData((Class) type);
for (Type argType : TypeParameters.of(type)) {
typeData.typeParameters.add(argType.equals(type) ? type : get(argType));
}
return typeData;
}
Type type is added to List<TypeData<?>> typeParameters instead of TypeData typeData
which leads to
class java.lang.Class cannot be cast to class dev.morphia.mapping.codec.pojo.TypeData (java.lang.Class is in module java.base of loader 'bootstrap'; dev.morphia.mapping.codec.pojo.TypeData is in unnamed module of loader 'app')
java.lang.ClassCastException: class java.lang.Class cannot be cast to class dev.morphia.mapping.codec.pojo.TypeData (java.lang.Class is in module java.base of loader 'bootstrap'; dev.morphia.mapping.codec.pojo.TypeData is in unnamed module of loader 'app')
at dev.morphia.mapping.conventions.ConfigureProperties.isNotConcrete(ConfigureProperties.java:100)
at dev.morphia.mapping.conventions.ConfigureProperties.buildProperty(ConfigureProperties.java:57)
at dev.morphia.mapping.conventions.ConfigureProperties.processProperties(ConfigureProperties.java:92)
at dev.morphia.mapping.conventions.ConfigureProperties.apply(ConfigureProperties.java:41)
at dev.morphia.mapping.codec.pojo.EntityModelBuilder.build(EntityModelBuilder.java:135)
at dev.morphia.mapping.Mapper.getEntityModel(Mapper.java:266)
** Please complete the following information: **
- Morphia Version: 2.5.0
If you could put together a reproducer I'd be happy to take a look and see.
Hello, please refer to https://github.com/renat-nosto/morphia-3787