mirror of
https://github.com/mapstruct/mapstruct.git
synced 2025-07-12 00:00:08 +08:00
#544 avoid that implementationtypes are added to imports in case of parameterized types
This commit is contained in:
parent
5ed7caedee
commit
0890257700
@ -179,6 +179,9 @@ public class IterableMappingMethod extends MappingMethod {
|
|||||||
}
|
}
|
||||||
if ( ( factoryMethod == null ) && ( !isExistingInstanceMapping() ) ) {
|
if ( ( factoryMethod == null ) && ( !isExistingInstanceMapping() ) ) {
|
||||||
types.addAll( getReturnType().getImportTypes() );
|
types.addAll( getReturnType().getImportTypes() );
|
||||||
|
if ( getReturnType().getImplementationType() != null ) {
|
||||||
|
types.addAll( getReturnType().getImplementationType().getImportTypes() );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return types;
|
return types;
|
||||||
}
|
}
|
||||||
|
@ -217,6 +217,9 @@ public class MapMappingMethod extends MappingMethod {
|
|||||||
}
|
}
|
||||||
if ( ( factoryMethod == null ) && ( !isExistingInstanceMapping() ) ) {
|
if ( ( factoryMethod == null ) && ( !isExistingInstanceMapping() ) ) {
|
||||||
types.addAll( getReturnType().getImportTypes() );
|
types.addAll( getReturnType().getImportTypes() );
|
||||||
|
if ( getReturnType().getImplementationType() != null ) {
|
||||||
|
types.addAll( getReturnType().getImplementationType().getImportTypes() );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return types;
|
return types;
|
||||||
|
@ -268,10 +268,6 @@ public class Type extends ModelElement implements Comparable<Type> {
|
|||||||
|
|
||||||
result.add( this );
|
result.add( this );
|
||||||
|
|
||||||
if ( implementationType != null ) {
|
|
||||||
result.addAll( implementationType.getImportTypes() );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( componentType != null ) {
|
if ( componentType != null ) {
|
||||||
result.addAll( componentType.getImportTypes() );
|
result.addAll( componentType.getImportTypes() );
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user