mapstruct / mapstruct-idea

An IntelliJ IDEA plugin for working with MapStruct
Other
141 stars 38 forks source link

IntelliJ plugin reporting "Unmapped target property" although the property is sucesfully mapped by MapStruct for fields of child classes. #111

Closed Hobbesgoblin closed 1 year ago

Hobbesgoblin commented 2 years ago

When I generate my Mapping with Mapstruct, the Mapstruct Plugin reports unmapped proeprties, although the implementation has them mapped.

this seems to have to to do with inheritance, since the reportedly unmapped fields are the fields that the class has on its own. Inherited fields are NOT reported as unmapped.

My entities use lomboks @Superbuilder due to inheritance and my DTOs are records

I have the folling structure

Class 1 field A field B

Class 2 extends class 1 Field C Field D

Class 2a extends class 2 Field E

Class 2b extends class 2 Field F

in my mappers "class2aDtoToClass2a" and "class2bDtoToClass2b" fields E and F are reportedly unmapped respectivly If I check the implementation, all fields are correctly mapped, regardless of where in the inheritance classes 2a and 2b gain them from.

filiphr commented 2 years ago

@Hobbesgoblin the plugin currently has problems with Lombok. Have you tried to delombok and see if the problem persists?

Chr3is commented 1 year ago

probably the same: https://github.com/mapstruct/mapstruct-idea/issues/118#issuecomment-1419130542

filiphr commented 1 year ago

Closing this issue since we cannot reproduce it. If more information is provided we can reopen it.