mirror of
https://github.com/mapstruct/mapstruct.git
synced 2025-07-12 00:00:08 +08:00
#339 error message clarification: ambiguous mapping method
This commit is contained in:
parent
5bca22702e
commit
6a46ac068f
@ -426,8 +426,7 @@ public class MappingResolverImpl implements MappingResolver {
|
||||
if ( candidates.size() > 1 ) {
|
||||
|
||||
String errorMsg = String.format(
|
||||
"Ambiguous mapping methods found for mapping " + mappedElement + " from %s to %s: %s.",
|
||||
sourceType,
|
||||
"Ambiguous mapping methods found for mapping " + mappedElement + " to %s: %s.",
|
||||
returnType,
|
||||
Strings.join( candidates, ", " )
|
||||
);
|
||||
|
@ -84,7 +84,7 @@ public class ComplexInheritanceTest {
|
||||
line = 32,
|
||||
messageRegExp =
|
||||
"Ambiguous mapping methods found for mapping property "
|
||||
+ "\"org.mapstruct.ap.test.inheritance.complex.SourceExt prop1\" from .*SourceExt to .*Reference: "
|
||||
+ "\"org.mapstruct.ap.test.inheritance.complex.SourceExt prop1\" to .*Reference: "
|
||||
+ ".*Reference .*AdditionalMappingHelper\\.asReference\\(.*SourceBase source\\), "
|
||||
+ ".*Reference .*AdditionalMappingHelper\\.asReference\\(.*AdditionalFooSource source\\)"))
|
||||
public void ambiguousMappingMethodsReportError() {
|
||||
|
@ -110,7 +110,7 @@ public class QualifierTest {
|
||||
kind = Kind.ERROR,
|
||||
line = 42,
|
||||
messageRegExp = "Ambiguous mapping methods found for mapping property "
|
||||
+ "\"java.lang.String title\" from java.lang.String to java.lang.String.*" )
|
||||
+ "\"java.lang.String title\" to java.lang.String.*" )
|
||||
}
|
||||
)
|
||||
public void shouldNotProduceMatchingMethod() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user