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

Improve ambiguous method error description #2156

Closed
sjaakd opened this issue Jul 17, 2020 · 0 comments
Closed

Improve ambiguous method error description #2156

sjaakd opened this issue Jul 17, 2020 · 0 comments
Assignees
Milestone

Comments

@sjaakd
Copy link
Contributor

sjaakd commented Jul 17, 2020

When doing name based automatically mapping it seems that mapstruct does not a clear hint what mapping goes wrong by stating a reference to the problematic mapping.

It could be that there's somewhere a List involved which breaks our current hierarchy.

Ambiguous mapping methods found for mapping property "org.mapstruct.ap.test.erroneous.ambigiousmapping.ErroneousMapper.LeafDTO leaf" to org.mapstruct.ap.test.erroneous.ambigiousmapping.ErroneousMapper.LeafEntity: org.mapstruct.ap.test.erroneous.ambigiousmapping.ErroneousMapper.LeafEntity map1(org.mapstruct.ap.test.erroneous.ambigiousmapping.ErroneousMapper.LeafDTO dto), org.mapstruct.ap.test.erroneous.ambigiousmapping.ErroneousMapper.LeafEntity map2(org.mapstruct.ap.test.erroneous.ambigiousmapping.ErroneousMapper.LeafDTO dto

does not offer a lot of info at one hand and is verbose in another way. If here's only one such branch leading up to a leaf, it's still to manage.. But if there are many you would like to have and indication which branch to look for..

So something like: Ambiguous mapping method found for source: trunk.branch.leaf with a short version of the types.

See also #2157

@sjaakd sjaakd self-assigned this Jul 17, 2020
sjaakd pushed a commit that referenced this issue Jul 17, 2020
@sjaakd sjaakd changed the title improved error messaging Improve ambigous method error description Jul 19, 2020
@sjaakd sjaakd mentioned this issue Jul 19, 2020
8 tasks
sjaakd pushed a commit to sjaakd/mapstruct that referenced this issue Jul 19, 2020
sjaakd pushed a commit to sjaakd/mapstruct that referenced this issue Jul 19, 2020
sjaakd pushed a commit to sjaakd/mapstruct that referenced this issue Jul 19, 2020
sjaakd pushed a commit to sjaakd/mapstruct that referenced this issue Jul 19, 2020
@filiphr filiphr closed this as completed Jul 19, 2020
@filiphr filiphr added this to the 1.4.0.Beta3 milestone Jul 19, 2020
@filiphr filiphr changed the title Improve ambigous method error description Improve ambiguous method error description Jul 19, 2020
sjaakd pushed a commit to sjaakd/mapstruct that referenced this issue Jan 4, 2021
sjaakd pushed a commit to sjaakd/mapstruct that referenced this issue Jan 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants