Closed hduelme closed 7 months ago
Currently the WrongUsageOfMappersFactoryInspection does not check if a @MapperConfig is used to configure the componentModel. Example: Config:
WrongUsageOfMappersFactoryInspection
@MapperConfig
componentModel
import org.mapstruct.MapperConfig; @MapperConfig(componentModel = "spring") public interface MyConfig { }
Mapper:
import maps.Target; import org.mapstruct.Mapper; import org.mapstruct.factory.Mappers; @Mapper(config = MyConfig.class) interface WrongComponentModelMapper { WrongComponentModelMapper INSTANCE = Mappers.getMapper(WrongComponentModelMapper.class); Target map(Target source); }
I expect to get a warning, but currently it is ignored.
Good catch @hduelme
Currently the
WrongUsageOfMappersFactoryInspection
does not check if a@MapperConfig
is used to configure thecomponentModel
. Example: Config:Mapper:
I expect to get a warning, but currently it is ignored.