Closed
Description
The change (be8e702) introduced a more concrete converter lookup which causes trouble using the underlying ConversionService
that might not have the converter registered for the given type but one of its parent ones. This leads to a ConverterNotFoundException
during the mapping process.
interface Message<T> {
T getValue();
}
class GenericMessage<T> implements Message<T> {
T value;
}
class TypedMessage extends GenericMessage<String> {
}
@ReadingConverter
class MessageConverter implements Converter<Document, Message<?>> {
@Override
public Message<?> convert(org.bson.Document source) {
// ...
}
}
// ...
Document source = new Document("_class", TypedMessage.class.getName())
.append("value", "v1");
Message<?> target = converter.read(Message.class, source);