Closed
Description
Hello,
I've recently encountered a new bug.
Issue Description:
Describe the bug
A newly created ModelConverter
is being registered in duplicate when used with Spring Boot DevTools, due to the class loader being different.
To Reproduce
Steps to reproduce the behavior:
- Create a Spring Boot application and include Spring Boot DevTools.
- Add a new
ModelConverter
and annotate it with@Component
@Component
public final class OwnConverter implements ModelConverter {
@Override
public Schema resolve(AnnotatedType type, ModelConverterContext context, Iterator<ModelConverter> chain) {
return (chain.hasNext()) ? chain.next().resolve(type, context, chain) : null;
}
}
Expected behavior
The ModelConverter
should be registered only once but every time the devtool restart the app, a new OwnConverter
is added to the list of converters.
Additional context
I think the issue might comes from the following line where the comparaison is done through reference equality.
ModelConverterRegistrar.java#L102
Metadata
Metadata
Assignees
Labels
No labels