From 5ed7caedeec46cd8553c08976c1d82294effc16d Mon Sep 17 00:00:00 2001 From: sjaakd Date: Sun, 17 May 2015 20:54:42 +0200 Subject: [PATCH] #544 only implementation types should be added in case of creating a new collection as propertymapping --- .../java/org/mapstruct/ap/model/PropertyMapping.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/processor/src/main/java/org/mapstruct/ap/model/PropertyMapping.java b/processor/src/main/java/org/mapstruct/ap/model/PropertyMapping.java index 53a8f5d11..efce549fb 100644 --- a/processor/src/main/java/org/mapstruct/ap/model/PropertyMapping.java +++ b/processor/src/main/java/org/mapstruct/ap/model/PropertyMapping.java @@ -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 implementationTypes; + if ( targetType.getImplementationType() != null ) { + implementationTypes = targetType.getImplementationType().getImportTypes(); + } + else { + implementationTypes = targetType.getImportTypes(); + } + newCollectionOrMap = new NewCollectionOrMapWrapper( result, implementationTypes ); newCollectionOrMap = new SetterWrapper( newCollectionOrMap, method.getThrownTypes() ); }