mirror of
https://github.com/mapstruct/mapstruct.git
synced 2025-07-12 00:00:08 +08:00
#2614 Do not use FQN when mapping Stream to Array
This commit is contained in:
parent
e86c0faf04
commit
935c03e822
@ -444,8 +444,11 @@ public class Type extends ModelElement implements Comparable<Type> {
|
||||
}
|
||||
|
||||
private boolean shouldUseSimpleName() {
|
||||
String fqn = notToBeImportedTypes.get( name );
|
||||
return this.qualifiedName.equals( fqn );
|
||||
// Using trimSimpleClassName since the same is used in the isToBeImported()
|
||||
// to check whether notToBeImportedTypes contains it
|
||||
String trimmedName = trimSimpleClassName( name );
|
||||
String fqn = notToBeImportedTypes.get( trimmedName );
|
||||
return trimSimpleClassName( this.qualifiedName ).equals( fqn );
|
||||
}
|
||||
|
||||
public Type erasure() {
|
||||
|
@ -55,7 +55,7 @@
|
||||
<#if needVarDefine>
|
||||
<#assign needVarDefine = false />
|
||||
<#-- We create a null array which later will be directly assigned from the stream-->
|
||||
${resultElementType}[] ${resultName} = null;
|
||||
<@includeModel object=resultElementType/>[] ${resultName} = null;
|
||||
</#if>
|
||||
<#elseif resultType.iterableType>
|
||||
<#if existingInstanceMapping>
|
||||
|
@ -36,12 +36,12 @@ public class ConverterImpl extends Converter {
|
||||
}
|
||||
|
||||
@Override
|
||||
public org.mapstruct.ap.test.bugs._1707.Converter.Target[] convertArray(Stream<Source> source) {
|
||||
public Target[] convertArray(Stream<Source> source) {
|
||||
if ( source == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
org.mapstruct.ap.test.bugs._1707.Converter.Target[] targetTmp = null;
|
||||
Target[] targetTmp = null;
|
||||
|
||||
targetTmp = source.map( source1 -> convert( source1 ) )
|
||||
.toArray( Target[]::new );
|
||||
|
Loading…
x
Reference in New Issue
Block a user