You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the MapperFacadeImpl#convert method unenhancer is always called, but the
unenhanced class is only used when no converterId was specified. This could be
easily fixed by moving the call into the 'if' body.
public <S, D> D convert(S source, Type<S> sourceType, Type<D> destinationType, String converterId) {
Converter<S, D> converter;
ConverterFactory converterFactory = mapperFactory.getConverterFactory();
if (converterId == null) {
final Type<? extends Object> sourceClass = unenhanceStrategy.unenhanceType(source, sourceType);
converter = (Converter<S, D>) converterFactory.getConverter(sourceClass, destinationType);
} else {
converter = (Converter<S, D>) converterFactory.getConverter(converterId);
}
return converter.convert(source, destinationType);
}
This gives a small performance improvement when using named converters.
Original issue reported on code.google.com by lighteater on 17 Apr 2012 at 12:15
The text was updated successfully, but these errors were encountered:
Great!
We're thinking also about moving converter resolution to "generate time" so in
runtime (mapping) we can have a simple O(1) complexity
Thank you if you have any suggestions please do not hesitate :)
Original comment by elaat...@gmail.com on 20 Apr 2012 at 2:58
Original issue reported on code.google.com by
lighteater
on 17 Apr 2012 at 12:15The text was updated successfully, but these errors were encountered: