Target property mapped more than once inspection#200
Conversation
|
Good one @hduelme. This looks good to me. Should we perhaps offer some quick fixes for it? Perhaps:
I can't think of another quick fox for this. |
|
Nice @hduelme!
For this scenario there might be a "remove I think the quick fix can be done in a separate issue. |
|
@filiphr , @thunderhook I added your suggested quick fixes. The replace (or change) target quick fix currently only selects the text to change. If you know a better way to handle this, let me know. Another idea for a quick fix is, to allow reusing properties automatically. For example, if the other annotation doesn't have a default source, we could offer a way to use our source as a default source. |
src/main/java/org/mapstruct/intellij/inspection/TargetPropertyMappedMoreThanOnceInspection.java
Outdated
Show resolved
Hide resolved
src/main/java/org/mapstruct/intellij/inspection/TargetPropertyMappedMoreThanOnceInspection.java
Outdated
Show resolved
Hide resolved
src/main/java/org/mapstruct/intellij/inspection/TargetPropertyMappedMoreThanOnceInspection.java
Show resolved
Hide resolved
6d73f14 to
05521ae
Compare
|
@filiphr I resolved the merge conflicts. |
|
Thanks @hduelme |
I added an inspection if a target property is explicitly (using

@Mapping) mapped more than once.The error is directly reported on the target field:
Same applies if used inside

@MappingsIf a own annotation containing

@Mappingor@Mappingsis used the error is reported on the annotation directly