You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would expect MapStruct to use the already generated method to map the list and not to generate the same method twice.
Actual behavior
MapStruct generates the method List<NodeDto> nodeListToNodeDtoList( List<Node> ) twice, provoking a compile error in the generated implementation.
If I don't specify the source the root element will get mapped, which is not wanted behaviour.
The Exception Message looks like this :
error: method nodeListToNodeDtoList(List<Node>) is already defined in class TargetMapperImpl
Expected behavior
I've got the following data structures I would like to map:
The map method looks as follows:
The reason for mapping it like this is to omit the root element of the tree since it is not wanted in this case.
MapStruct generates the methods with the following signature correctly :
I would expect MapStruct to use the already generated method to map the list and not to generate the same method twice.
Actual behavior
MapStruct generates the method
List<NodeDto> nodeListToNodeDtoList( List<Node> )
twice, provoking a compile error in the generated implementation.If I don't specify the source the root element will get mapped, which is not wanted behaviour.
The Exception Message looks like this :
error: method nodeListToNodeDtoList(List<Node>) is already defined in class TargetMapperImpl
Steps to reproduce the problem
My configuration looks as follows:
The problem should be reproducable with the snippets described above. I omitted the getters/setters and the Mapping class to keep it more readable.
MapStruct Version
MapStruct 1.5.3
The text was updated successfully, but these errors were encountered: