-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Labels
Milestone
Description
Expected behavior
Assuming the following code and configuration below, I expect the compilation to succeed and the mapper to generate something like this:
public Foo.CarDto toDto(Foo.Car car) {
if (car == null) {
return null;
} else {
Foo.CarDto carDto = new Foo.CarDto();
carDto.setEWhatever2(car.getEWhatever1());
return carDto;
}
}Actual behavior
Compilation fails and no implementation is generated.
java: No property named "eWhatever1" exists in source parameter(s). Did you mean "EWhatever1"?
Steps to reproduce the problem
- Java 17
- MapStruct 1.5.3.Final
- Lombok 1.18.22
- Lombok Mapstruct Binding 0.2.0
@Mapper
public interface BadMapper {
@Mapping(target = "eWhatever2", source = "eWhatever1")
CarDto toDto(Car car);
}@Data
public class Car {
private String eWhatever1;
}@Data
public class CarDto {
private String eWhatever2;
}It is important the 1st letter of the variable is lowercase and the 2nd one is uppercase.
Ewhateverinterestingly produces a similar error.eWhateverdoesn't work.ewHateveris ok.ewhateveris ok.
MapStruct Version
MapStruct 1.5.3.Final