Improve line location report for invalid qualifier for SubclassMapping#3204
Improve line location report for invalid qualifier for SubclassMapping#3204filiphr merged 1 commit intomapstruct:mainfrom
Conversation
filiphr
left a comment
There was a problem hiding this comment.
Thanks @EvaristeGalois11. The PR looks great, only one small cosmetic comment regarding the prefix Gem in fields and variables. We are usually not using it in other places, e.g. MappingOptions, BeanMappingOptions.
It seems that if more than one annotations of the same type as
AnnotationMirrorare present on the mapping method the compiler will fallback to emit the error on the method itself. Eclipse compiler seems to work fine regardless of the number of annotations. Is this an already known issue?
This is indeed a known issue. I think that newer Java compiler versions have fixed this. The eclipse compiler always worked fine. You don't need to remove anything from the code you can use the alternativeLine in the @Diagnostic. You can actually remove in one place and leave in the other, to make sure that we really do report in the right place in both cases. As an example with this similar problem is AnnotateWithTest#mapperWithIdenticalAnnotationRepeated
processor/src/main/java/org/mapstruct/ap/internal/model/source/SubclassMappingOptions.java
Outdated
Show resolved
Hide resolved
… SubclassMapping
feaf190 to
d989a9d
Compare
|
Thank you @filiphr for your feedback! I have updated the PR with what you said. I had to change the |
|
Thanks @EvaristeGalois11 |
Fix #3202
I had to remove one of the
@SubclassMappingannotations from the erroneous mappers because otherwise the tests would fail.It seems that if more than one annotations of the same type as
AnnotationMirrorare present on the mapping method the compiler will fallback to emit the error on the method itself. Eclipse compiler seems to work fine regardless of the number of annotations. Is this an already known issue?