Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fluent setters on fields with names starting with set are not working #1799

Closed
OhDearMoshe opened this issue Apr 26, 2019 · 6 comments · Fixed by #1917
Closed

Fluent setters on fields with names starting with set are not working #1799

OhDearMoshe opened this issue Apr 26, 2019 · 6 comments · Fixed by #1917
Labels
bug
Milestone

Comments

@OhDearMoshe
Copy link

@OhDearMoshe OhDearMoshe commented Apr 26, 2019

It seems in version MapStruct 1.3.0-Final theres an issue with builders and fields that begin with the word set such as settlement or setup.

Example (with lombok)

Source:

@Builder
public class Foo {
    private String setup;
    private LocalDate settlement;

}

Target:

@Builder
public class Bar {
    private String setup;
    private LocalDate settlement;

}

Neither of these fields are mapped. But I did get it to work by adding

@Mapping(source = "settlement", target = "tlement")
@Mapping(source = "setup", target = "up")
@filiphr filiphr added the bug label May 3, 2019
@filiphr filiphr added this to the 1.4.0 milestone May 3, 2019
@filiphr

This comment has been minimized.

Copy link
Member

@filiphr filiphr commented May 3, 2019

Thanks for raising this issue @OhDearMoshe. This is certainly a bug and we would try to fix it asap.

In case you have some time and are wiling to play a bit with the MapStruct codebase you could help out with a contribution 😉. We would of course guide you

@msymonov

This comment has been minimized.

Copy link

@msymonov msymonov commented May 8, 2019

Hi guys. Could you please review #1810.
Hopefully it fixes everything, however side effects are expected as for existing methods which are expected to be used as getters/setters, but not following Oracle's specification the code will be broken. For instance i noticed such cases in MapStruct tests: "getaName", "setaName" for a field named "aName".
Thanks in advance for review and comments.

msymonov pushed a commit to msymonov/mapstruct that referenced this issue May 9, 2019
msymonov pushed a commit to msymonov/mapstruct that referenced this issue May 10, 2019
@msymonov

This comment has been minimized.

Copy link

@msymonov msymonov commented May 15, 2019

@filiphr Could you please comment on this item? No pushing, just want to close my internal gestalt :). Thanks

msymonov pushed a commit to msymonov/mapstruct that referenced this issue May 29, 2019
msymonov pushed a commit to msymonov/mapstruct that referenced this issue May 29, 2019
@msymonov

This comment has been minimized.

Copy link

@msymonov msymonov commented May 31, 2019

any news, gentlemen?

@msymonov

This comment has been minimized.

Copy link

@msymonov msymonov commented Jul 22, 2019

guys, could someone comment on this item please.

@filiphr

This comment has been minimized.

Copy link
Member

@filiphr filiphr commented Aug 18, 2019

I reviewed the PR @msymonov, sorry for taking such a long time.

@filiphr filiphr modified the milestones: 1.4.0, 1.3.1 Sep 22, 2019
filiphr added a commit to filiphr/mapstruct that referenced this issue Sep 22, 2019
filiphr added a commit that referenced this issue Sep 22, 2019
filiphr added a commit to filiphr/mapstruct that referenced this issue Sep 22, 2019
sjaakd added a commit that referenced this issue Sep 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.