Source:
<code>public IterableMappingMethod build() { Type sourceParameterType = first( method.getSourceParameters() ).getType(); Type resultType = method.getResultType(); Type sourceElementType = sourceParameterType.isArrayType() ? sourceParameterType.getComponentType() : first( sourceParameterType.getTypeParameters() ).getTypeBound(); Type targetElementType = resultType.isArrayType() ? resultType.getComponentType() : first( resultType.getTypeParameters() ).getTypeBound(); String loopVariableName = Strings.getSaveVariableName( sourceElementType.getName(), method.getParameterNames() ); Assignment assignment = ctx.getMappingResolver().getTargetAssignment( method, "collection element", sourceElementType, targetElementType, null, dateFormat, qualifiers, qualifyingElementTargetType, loopVariableName, false ); if ( method instanceof ForgedMethod ) { <START> method.getThrownTypes().addAll( assignment.getThrownTypes() ); <END> } if ( assignment == null ) { ctx.getMessager().printMessage( method.getExecutable(), Message.ITERABLEMAPPING_MAPPING_NOT_FOUND ); } if ( resultType.isArrayType() ) { assignment = new LocalVarWrapper( assignment, method.getThrownTypes() ); } else { assignment = new SetterWrapper( assignment, method.getThrownTypes() ); } boolean mapNullToDefault = false; if ( method.getMapperConfiguration() != null ) { mapNullToDefault = method.getMapperConfiguration().isMapToDefault( nullValueMappingStrategy ); } MethodReference factoryMethod = ctx.getMappingResolver().getFactoryMethod( method, method.getResultType(), null, null ); return new IterableMappingMethod( method, assignment, factoryMethod, mapNullToDefault, loopVariableName ); }</code><technical_language>For other Methods, getThrownTypes() returns immutable list. making requirement in ForgedMethod explicit adding a method addThrownTypes(..) ForgedMethod? contains-check implemented for MapMappingMethod builder. contains-check avoided declaring thrownTypes Set (using LinkedHashSet implementation, guarantees iteration in order of inserts)</technical_language>

Target:
public IterableMappingMethod build() { Type sourceParameterType = first( method.getSourceParameters() ).getType(); Type resultType = method.getResultType(); Type sourceElementType = sourceParameterType.isArrayType() ? sourceParameterType.getComponentType() : first( sourceParameterType.getTypeParameters() ).getTypeBound(); Type targetElementType = resultType.isArrayType() ? resultType.getComponentType() : first( resultType.getTypeParameters() ).getTypeBound(); String loopVariableName = Strings.getSaveVariableName( sourceElementType.getName(), method.getParameterNames() ); Assignment assignment = ctx.getMappingResolver().getTargetAssignment( method, "collection element", sourceElementType, targetElementType, null, dateFormat, qualifiers, qualifyingElementTargetType, loopVariableName, false ); if ( assignment == null ) { ctx.getMessager().printMessage( method.getExecutable(), Message.ITERABLEMAPPING_MAPPING_NOT_FOUND ); } else { if ( method instanceof ForgedMethod ) { ForgedMethod forgedMethod = (ForgedMethod) method; forgedMethod.addThrownTypes( assignment.getThrownTypes() ); } } if ( resultType.isArrayType() ) { assignment = new LocalVarWrapper( assignment, method.getThrownTypes() ); } else { assignment = new SetterWrapper( assignment, method.getThrownTypes() ); } boolean mapNullToDefault = false; if ( method.getMapperConfiguration() != null ) { mapNullToDefault = method.getMapperConfiguration().isMapToDefault( nullValueMappingStrategy ); } MethodReference factoryMethod = ctx.getMappingResolver().getFactoryMethod( method, method.getResultType(), null, null ); return new IterableMappingMethod( method, assignment, factoryMethod, mapNullToDefault, loopVariableName ); }