mapstruct/mapstruct — pull request #258 by sjaakd (2014-07-02 21:20:54+00:00)
Title: #205 using autoboxing iso typeconversion for source parameters when sele...

...cting a suitable mapping method

This took me a little bit longer than anticipated. After some investigation I found out that a 2 step approach ( source->type conversion->mapping method) was used to select mapping methods (hand written or otherwise). Preferably auto boxing is used of such a case. This has been introduced now.

The true problem showed in the `ExceptionTestMapper`. Here were 2 methods required iso 1. That has been fixed to show the problem is fixed.

Next NPE checks on type conversions carried out by MapStruct in `NullCheckTest#shouldSurroundConversionFromWrappedPassedToMappingMethodWithPrimitiveArgWithNullCheck` used a `Long` to `long` type conversion (via `customMapper.toMyBigIntWrapperViaPrimitive`) to show the problem that was solved in #231. That was no longer a relevant case, since that now is solved by auto boxing (and hence the responsibility lies within the called mapping method). I used a type that is not autobox-able (`BigInteger`) to demonstrate now.

Finally some tests have been added. They worked as well in the previous situation, but now generate neater code (autounboxing, no warnings from my IDE).