mapstruct/mapstruct — pull request #67 by agudian (2013-09-14 18:04:30+00:00)
Title: Issue 34 - Find best matching property mapping methods

This is WIP, but I need some feedback on the desired behaviour. The newly added Test works fine, but three other Tests are failing now:

```
Failed tests:
CollectionMappingTest.shouldMapIntegerSetToRawSet:225 <['2', '1']> does not contain element(s):<[1, 2]>
MapMappingTest>MapperTestBase.generateMapperImplementation:138->MapperTestBase.assertDiagnostics:150 [Numbers of expected and actual diagnostics are diffent. Actual: [DiagnosticDescriptor: WARNING null:-1 Ambiguous mapping methods found for mapping from java.util.Map to java.util.Map: [java.util.Map stringStringMapToLongDateMap(java.util.Map source) void stringStringMapToLongDateMapUsingTargetParameter(@MappingTarget java.util.Map target java.util.Map source) java.util.Map stringStringMapToLongDateMapUsingTargetParameterAndReturn(java.util.Map source @MappingTarget java.util.Map target)]. Using the first one.]
Expected:
[].] expected size:<0> but was:<1> for <[DiagnosticDescriptor: WARNING null:-1 Ambiguous mapping methods found for mapping from java.util.Map to java.util.Map: [java.util.Map stringStringMapToLongDateMap(java.util.Map source), void stringStringMapToLongDateMapUsingTargetParameter(@MappingTarget java.util.Map target, java.util.Map source), java.util.Map stringStringMapToLongDateMapUsingTargetParameterAndReturn(java.util.Map source, @MappingTarget java.util.Map target)]. Using the first one.]>
MapMappingTest>MapperTestBase.generateMapperImplementation:138->MapperTestBase.assertDiagnostics:150 [Numbers of expected and actual diagnostics are diffent. Actual: [DiagnosticDescriptor: WARNING null:-1 Ambiguous mapping methods found for mapping from java.util.Map to java.util.Map: [java.util.Map stringStringMapToLongDateMap(java.util.Map source) void stringStringMapToLongDateMapUsingTargetParameter(@MappingTarget java.util.Map target java.util.Map source) java.util.Map stringStringMapToLongDateMapUsingTargetParameterAndReturn(java.util.Map source @MappingTarget java.util.Map target)]. Using the first one.]
Expected:
[].] expected size:<0> but was:<1> for <[DiagnosticDescriptor: WARNING null:-1 Ambiguous mapping methods found for mapping from java.util.Map to java.util.Map: [java.util.Map stringStringMapToLongDateMap(java.util.Map source), void stringStringMapToLongDateMapUsingTargetParameter(@MappingTarget java.util.Map target, java.util.Map source), java.util.Map stringStringMapToLongDateMapUsingTargetParameterAndReturn(java.util.Map source, @MappingTarget java.util.Map target)]. Using the first one.]>
```

Please give it a try and tell me what you think should happen.

Initially, I threw an error instead of the warnings above.

For the first test, I don't really know - all availabel mapping methods match because of their compatible return type, but the one taking the Set as parameter sure is the best fit. But did you expect that no mapping method would be selected?