mirror of
https://github.com/mapstruct/mapstruct.git
synced 2025-07-12 00:00:08 +08:00
#687 Fix detection of source property type in case the mapping is specified via annotation
This commit is contained in:
parent
8a3d5418df
commit
fc660e2c02
@ -18,6 +18,8 @@
|
|||||||
*/
|
*/
|
||||||
package org.mapstruct.ap.internal.model.source;
|
package org.mapstruct.ap.internal.model.source;
|
||||||
|
|
||||||
|
import static org.mapstruct.ap.internal.util.Collections.first;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -32,8 +34,6 @@ import org.mapstruct.ap.internal.util.FormattingMessager;
|
|||||||
import org.mapstruct.ap.internal.util.Message;
|
import org.mapstruct.ap.internal.util.Message;
|
||||||
import org.mapstruct.ap.internal.util.Strings;
|
import org.mapstruct.ap.internal.util.Strings;
|
||||||
|
|
||||||
import static org.mapstruct.ap.internal.util.Collections.first;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class describes the source side of a property mapping.
|
* This class describes the source side of a property mapping.
|
||||||
* <p>
|
* <p>
|
||||||
@ -176,7 +176,7 @@ public class SourceReference {
|
|||||||
Map<String, ExecutableElement> sourceReadAccessors = newType.getPropertyReadAccessors();
|
Map<String, ExecutableElement> sourceReadAccessors = newType.getPropertyReadAccessors();
|
||||||
for ( Map.Entry<String, ExecutableElement> getter : sourceReadAccessors.entrySet() ) {
|
for ( Map.Entry<String, ExecutableElement> getter : sourceReadAccessors.entrySet() ) {
|
||||||
if ( getter.getKey().equals( entryName ) ) {
|
if ( getter.getKey().equals( entryName ) ) {
|
||||||
newType = typeFactory.getType( getter.getValue().getReturnType() );
|
newType = typeFactory.getReturnType( newType.getTypeElement(), getter.getValue() );
|
||||||
sourceEntries.add( new PropertyEntry( entryName, getter.getValue(), newType ) );
|
sourceEntries.add( new PropertyEntry( entryName, getter.getValue(), newType ) );
|
||||||
matchFound = true;
|
matchFound = true;
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user