#544 only implementation types should be added in case of creating a new collection as propertymapping

This commit is contained in:
sjaakd 2015-05-17 20:54:42 +02:00
parent f69f035bd5
commit 5ed7caedee

View File

@ -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() );
}