Source:
public BeanMappingMethod build() { boolean mappingErrorOccured = handleDefinedMappings(); if ( mappingErrorOccured ) { return null; } applyPropertyNameBasedMapping(); applyParameterNameBasedMapping(); reportErrorForUnmappedTargetPropertiesIfRequired(); boolean mapNullToDefault = method.getMapperConfiguration().isMapToDefault( nullValueMappingStrategy ); BeanMappingPrism beanMappingPrism = BeanMappingPrism.getInstanceOn( method.getExecutable() ); MethodReference factoryMethod = null; if ( !method.isUpdateMethod() ) { factoryMethod = ctx.getMappingResolver().getFactoryMethod( method, method.getResultType(), selectionParameters ); } Type resultType = null; if ( factoryMethod == null ) { if ( selectionParameters != null && selectionParameters.getResultType() != null ) { resultType = ctx.getTypeFactory().getType( selectionParameters.getResultType() ); if ( resultType.isAbstract() ) { ctx.getMessager().printMessage( method.getExecutable(), beanMappingPrism.mirror, Message.BEANMAPPING_ABSTRACT, resultType, method.getResultType() ); } else if ( !resultType.isAssignableTo( method.getResultType() ) ) { ctx.getMessager().printMessage( method.getExecutable(), beanMappingPrism.mirror, Message.BEANMAPPING_NOT_ASSIGNABLE, resultType, method.getResultType() ); } } else if ( !method.isUpdateMethod() && method.getReturnType().isAbstract() ) { ctx.getMessager().printMessage( method.getExecutable(), Message.GENERAL_ABSTRACT_RETURN_TYPE, method.getReturnType() ); } } sortPropertyMappingsByDependencies(); List<LifecycleCallbackMethodReference> beforeMappingMethods = LifecycleCallbackFactory.beforeMappingMethods( method, selectionParameters, ctx, existingVariableNames ); List<LifecycleCallbackMethodReference> afterMappingMethods = LifecycleCallbackFactory.afterMappingMethods( method, selectionParameters, ctx, existingVariableNames ); return new BeanMappingMethod( method, propertyMappings, factoryMethod, mapNullToDefault, resultType, beforeMappingMethods, afterMappingMethods ); }

Target:
public BeanMappingMethod build() { boolean mappingErrorOccured = handleDefinedMappings(); if ( mappingErrorOccured ) { return null; } if ( !method.getMappingOptions().isRestrictToDefinedMappings() ) { applyPropertyNameBasedMapping(); applyParameterNameBasedMapping(); } handleUnprocessedDefinedTargets(); reportErrorForUnmappedTargetPropertiesIfRequired(); boolean mapNullToDefault = method.getMapperConfiguration().isMapToDefault( nullValueMappingStrategy ); BeanMappingPrism beanMappingPrism = BeanMappingPrism.getInstanceOn( method.getExecutable() ); MethodReference factoryMethod = null; if ( !method.isUpdateMethod() ) { factoryMethod = ctx.getMappingResolver().getFactoryMethod( method, method.getResultType(), selectionParameters ); } Type resultType = null; if ( factoryMethod == null ) { if ( selectionParameters != null && selectionParameters.getResultType() != null ) { resultType = ctx.getTypeFactory().getType( selectionParameters.getResultType() ); if ( resultType.isAbstract() ) { ctx.getMessager().printMessage( method.getExecutable(), beanMappingPrism.mirror, Message.BEANMAPPING_ABSTRACT, resultType, method.getResultType() ); } else if ( !resultType.isAssignableTo( method.getResultType() ) ) { ctx.getMessager().printMessage( method.getExecutable(), beanMappingPrism.mirror, Message.BEANMAPPING_NOT_ASSIGNABLE, resultType, method.getResultType() ); } } else if ( !method.isUpdateMethod() && method.getReturnType().isAbstract() ) { ctx.getMessager().printMessage( method.getExecutable(), Message.GENERAL_ABSTRACT_RETURN_TYPE, method.getReturnType() ); } } sortPropertyMappingsByDependencies(); List<LifecycleCallbackMethodReference> beforeMappingMethods = LifecycleCallbackFactory.beforeMappingMethods( method, selectionParameters, ctx, existingVariableNames ); List<LifecycleCallbackMethodReference> afterMappingMethods = LifecycleCallbackFactory.afterMappingMethods( method, selectionParameters, ctx, existingVariableNames ); return new BeanMappingMethod( method, propertyMappings, factoryMethod, mapNullToDefault, resultType, beforeMappingMethods, afterMappingMethods ); }