mirror of
https://github.com/mapstruct/mapstruct.git
synced 2025-07-12 00:00:08 +08:00
#544 only implementation types should be added in case of creating a new collection as propertymapping
This commit is contained in:
parent
f69f035bd5
commit
5ed7caedee
@ -302,7 +302,14 @@ public class PropertyMapping extends ModelElement {
|
||||
// mapping method. Note, typeconversons do not apply to collections or maps
|
||||
Assignment newCollectionOrMap = null;
|
||||
if ( result.getType() == DIRECT ) {
|
||||
newCollectionOrMap = new NewCollectionOrMapWrapper( result, targetType.getImportTypes() );
|
||||
Set<Type> implementationTypes;
|
||||
if ( targetType.getImplementationType() != null ) {
|
||||
implementationTypes = targetType.getImplementationType().getImportTypes();
|
||||
}
|
||||
else {
|
||||
implementationTypes = targetType.getImportTypes();
|
||||
}
|
||||
newCollectionOrMap = new NewCollectionOrMapWrapper( result, implementationTypes );
|
||||
newCollectionOrMap = new SetterWrapper( newCollectionOrMap, method.getThrownTypes() );
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user