You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When explicitly marking a target in MapStruct, if the target is a boolean with the "is" prefix, and the target class uses lombok's @Getter and @Setter on the field, MapStruct fails to compile.
No property named "isPublic" exists in source parameter(s). Did you mean "public"?
I suspect MapStruct is attempting to guess the original field name by removing the "is" from lombok, but it fails to take in account that lombok does not add the "is" prefix if the field already has it (eg. the "isPublic" field in our case).
Setting lombok.getter.noIsPrefix=true in lombok.config fixes the issue.
Version info (please complete the following information):
Lombok 1.18.34
javac 21.0.4
Eclipse 4.32.0
Mapstruct 1.5.5.Final and 1.6.0
lombok-mapstruct-binding 0.2.0
Additional context
Happens on both MacOS and Fedora Linux
The text was updated successfully, but these errors were encountered:
cocoliliace
changed the title
[BUG] mapstruct-lombok-binding incorrectly removes the "is" prefix
[BUG] lombok-mapstruct-binding incorrectly removes the "is" prefix
Aug 30, 2024
Describe the bug
When explicitly marking a target in MapStruct, if the target is a boolean with the "is" prefix, and the target class uses lombok's
@Getter
and@Setter
on the field, MapStruct fails to compile.For example,
would throw
I suspect MapStruct is attempting to guess the original field name by removing the "is" from lombok, but it fails to take in account that lombok does not add the "is" prefix if the field already has it (eg. the "isPublic" field in our case).
Setting
lombok.getter.noIsPrefix=true
inlombok.config
fixes the issue.To Reproduce
With Mapstruct and the lombok-mapstruct-binding plugin:
Expected behavior
The above code should compile.
Version info (please complete the following information):
Additional context
Happens on both MacOS and Fedora Linux
The text was updated successfully, but these errors were encountered: