This inspection reports when constant or expression source property is used with a default source property inside the @Mapping


//wrong
@Mapper
public interface EmployeeMapper {
    @Mapping(target = "name", expression = "java(\"My name\")", defaultExpression = "java(\"My name\")")
    @Mapping(target = "lastName", constant = "My name", defaultValue = "My name")
    Employee toEmployee(EmployeeDto employeeDto, @Context CycleAvoidingMappingContext context);
}


//correct
@Mapper
public interface EmployeeMapper {
    @Mapping(target = "name", expression = "java(\"My name\")")
    @Mapping(target = "lastName", constant = "My name")
    Employee toEmployee(EmployeeDto employeeDto, @Context CycleAvoidingMappingContext context);
}