@InheritInverseConfiguration cannot directly inherit from prototype methods
I have the simple use case:
- SharedConfig
- Reuse SharedConfig to separate from-to, to-from into 2 separate classes, define the mappings once.
It does not work..
Applied to our unit test: org.mapstruct.ap.test.inheritfromconfig.InheritFromConfigTest, this is the reproducer:
@Mapper( uses = NotToBeUsedMapper.class, config = AutoInheritedConfig.class, mappingInheritanceStrategy = MappingInheritanceStrategy.EXPLICIT ) public abstract class CarMapperReverseWithExplicitInheritance { public static final CarMapperReverseWithExplicitInheritance INSTANCE = Mappers.getMapper( CarMapperReverseWithExplicitInheritance.class ); @InheritInverseConfiguration(name = "baseDtoToEntity") public abstract CarDto toCarDto(CarEntity entity); }
Note: a similar method is there in CarMapperWithExplicitInheritance, but there the reverse mapping runs via a local present method.