mirror of
https://github.com/mapstruct/mapstruct.git
synced 2025-07-12 00:00:08 +08:00
parent
60611d94cf
commit
1266796921
@ -198,7 +198,6 @@ public class MappingResolverImpl implements MappingResolver {
|
|||||||
if ( sourceType.isLiteral()
|
if ( sourceType.isLiteral()
|
||||||
&& "java.lang.String".equals( sourceType.getFullyQualifiedName( ) )
|
&& "java.lang.String".equals( sourceType.getFullyQualifiedName( ) )
|
||||||
&& targetType.isNative() ) {
|
&& targetType.isNative() ) {
|
||||||
// TODO: convey some error message
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -273,8 +272,6 @@ public class MappingResolverImpl implements MappingResolver {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a reference to a method mapping the given source type to the given target type, if such a method
|
* Returns a reference to a method mapping the given source type to the given target type, if such a method
|
||||||
* exists.
|
* exists.
|
||||||
@ -485,6 +482,7 @@ public class MappingResolverImpl implements MappingResolver {
|
|||||||
|
|
||||||
if ( sourceRHS.getSourceErrorMessagePart() != null ) {
|
if ( sourceRHS.getSourceErrorMessagePart() != null ) {
|
||||||
messager.printMessage( mappingMethod.getExecutable(),
|
messager.printMessage( mappingMethod.getExecutable(),
|
||||||
|
positionHint,
|
||||||
Message.GENERAL_AMBIGIOUS_MAPPING_METHOD,
|
Message.GENERAL_AMBIGIOUS_MAPPING_METHOD,
|
||||||
sourceRHS.getSourceErrorMessagePart(),
|
sourceRHS.getSourceErrorMessagePart(),
|
||||||
returnType,
|
returnType,
|
||||||
@ -493,6 +491,7 @@ public class MappingResolverImpl implements MappingResolver {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
messager.printMessage( mappingMethod.getExecutable(),
|
messager.printMessage( mappingMethod.getExecutable(),
|
||||||
|
positionHint,
|
||||||
Message.GENERAL_AMBIGIOUS_FACTORY_METHOD,
|
Message.GENERAL_AMBIGIOUS_FACTORY_METHOD,
|
||||||
returnType,
|
returnType,
|
||||||
Strings.join( candidates, ", " )
|
Strings.join( candidates, ", " )
|
||||||
|
@ -100,7 +100,7 @@ public class QualifierTest {
|
|||||||
diagnostics = {
|
diagnostics = {
|
||||||
@Diagnostic( type = ErroneousMapper.class,
|
@Diagnostic( type = ErroneousMapper.class,
|
||||||
kind = Kind.ERROR,
|
kind = Kind.ERROR,
|
||||||
line = 29,
|
line = 28,
|
||||||
messageRegExp = "Ambiguous mapping methods found for mapping property "
|
messageRegExp = "Ambiguous mapping methods found for mapping property "
|
||||||
+ "\"java.lang.String title\" to java.lang.String.*" )
|
+ "\"java.lang.String title\" to java.lang.String.*" )
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user