Source:
public IterableMappingMethod build() { Type sourceParameterType = method.getSourceParameters().iterator().next().getType(); Type resultType = method.getResultType(); Type sourceElementType = sourceParameterType.isArrayType() ? sourceParameterType.getComponentType() : sourceParameterType.getTypeParameters().get( 0 ); Type targetElementType = resultType.isArrayType() ? resultType.getComponentType() : resultType.getTypeParameters().get( 0 ); String elementTypeName = sourceParameterType.isArrayType() ? sourceParameterType.getComponentType().getName() : sourceParameterType.getTypeParameters().get( 0 ).getName(); String loopVariableName = Strings.getSaveVariableName( elementTypeName, method.getParameterNames() ); Assignment assignment = ctx.getMappingResolver().getTargetAssignment( method, "collection element", sourceElementType, targetElementType, null, dateFormat, qualifiers, null, loopVariableName ); if ( assignment == null ) { String message = String.format( "Can't create implementation of method %s. Found no method nor built-in conversion for mapping " + "source element type into target element type.", method ); ctx.getMessager().printMessage( Diagnostic.Kind.ERROR, message, method.getExecutable() ); } if ( resultType.isArrayType() ) { assignment = new LocalVarWrapper( assignment, method.getThrownTypes() ); } else { assignment = new SetterWrapper( assignment, method.getThrownTypes() ); } NullValueMappingPrism prism = NullValueMappingPrism.getInstanceOn( method.getExecutable() ); boolean mapNullToDefault = MapperConfig.getInstanceOn( ctx.getMapperTypeElement() ).isMapToDefault( prism ); MethodReference factoryMethod = ctx.getMappingResolver().getFactoryMethod( method, method.getResultType() ); return new IterableMappingMethod( method, assignment, factoryMethod, mapNullToDefault, loopVariableName ); }

Target:
public IterableMappingMethod build() { Type sourceParameterType = method.getSourceParameters().iterator().next().getType(); Type resultType = method.getResultType(); Type sourceElementType = sourceParameterType.isArrayType() ? sourceParameterType.getComponentType() : sourceParameterType.getTypeParameters().get( 0 ); Type targetElementType = resultType.isArrayType() ? resultType.getComponentType() : resultType.getTypeParameters().get( 0 ); String elementTypeName = sourceParameterType.isArrayType() ? sourceParameterType.getComponentType().getName() : sourceParameterType.getTypeParameters().get( 0 ).getName(); String loopVariableName = Strings.getSaveVariableName( elementTypeName, method.getParameterNames() ); Assignment assignment = ctx.getMappingResolver().getTargetAssignment( method, "collection element", sourceElementType, targetElementType, null, dateFormat, qualifiers, qualifyingElementTargetType, loopVariableName ); if ( assignment == null ) { String message = String.format( "Can't create implementation of method %s. Found no method nor built-in conversion for mapping " + "source element type into target element type.", method ); ctx.getMessager().printMessage( Diagnostic.Kind.ERROR, message, method.getExecutable() ); } if ( resultType.isArrayType() ) { assignment = new LocalVarWrapper( assignment, method.getThrownTypes() ); } else { assignment = new SetterWrapper( assignment, method.getThrownTypes() ); } NullValueMappingPrism prism = NullValueMappingPrism.getInstanceOn( method.getExecutable() ); boolean mapNullToDefault = MapperConfig.getInstanceOn( ctx.getMapperTypeElement() ).isMapToDefault( prism ); MethodReference factoryMethod = ctx.getMappingResolver().getFactoryMethod( method, method.getResultType() ); return new IterableMappingMethod( method, assignment, factoryMethod, mapNullToDefault, loopVariableName ); }