add inspection for @Mapping annotation#153
Conversation
thunderhook
left a comment
There was a problem hiding this comment.
Hi! Thanks alot for the additional inspections.
I stumbled across some mini formatting issues and a case where expression and defaultExpression are also invalid. This should also be handled correctly, so that the quick-fix doesn't produce an invalid code.
Thanks in advance! 💪
@filiphr any ideas about the errors in the pipeline/action?
src/main/resources/inspectionDescriptions/MoreThanOneDefaultSourceDefined.html
Outdated
Show resolved
Hide resolved
src/main/resources/inspectionDescriptions/MoreThanOneDefaultSourceDefined.html
Outdated
Show resolved
Hide resolved
src/main/resources/inspectionDescriptions/MoreThanOneSourceDefined.html
Outdated
Show resolved
Hide resolved
src/main/resources/inspectionDescriptions/MoreThanOneSourceDefined.html
Outdated
Show resolved
Hide resolved
src/main/resources/inspectionDescriptions/NoSourcePropertyDefined.html
Outdated
Show resolved
Hide resolved
src/main/resources/inspectionDescriptions/NoSourcePropertyDefined.html
Outdated
Show resolved
Hide resolved
|
As @thunderhook suggested, now move to default value is only available if the I also fixed the pipeline. JetBrains removed the mock-Jdk Files from their main branch. As a fix I switched to the 212.5712 branch, where the files still exist. I don't think this should be a permanent solution, but for now it works :) |
Interesting, only the Mock-JDK11 directory was removed with this commit - 1.4, 1.7, 1.8 and 1.9 are still there. Maybe that commit can help to find a solution. 🤞 But I have no idea why the The latest EAP failed however. Could you please take a look at that error? Thanks in advance! 💪 |
|
As discussed previously, I added an inspection for default properties used with I also limited the More than one default source property defined, to only apply if the |
|
I opened separate issues about the EAP build and the I just played around with the branch and stumbled accross this. The following code shows @Mapping(target = "testName", constant = "My name")
Target map(Source source);Would you please be so kind and add a test for that and fix it? Thank you! |
There was a problem hiding this comment.
Still need to get used to this review tool in GitHub 😅 need to add a comment here, see:
#153 (comment)
I tried a few more mappers from the mapstruct-examples project and apart from the one problem, I couldn't find anything else. 💪
When this is fixed, we can merge.
@thunderhook I added an test where the inspection should not show any error. Although I fixed the bug. Thanks for your feedback |
Good catch. I will try to fix this too. |
|
@thunderhook I was able to fix ignoreByDefault for no source property defined |
|
@thunderhook I tested all of your cases myself and looks like I fixed it. Could you confirm? |
|
Thanks alot for the contribution (and your patience with the review ping-pong 😄) |
I added three inspections for
@Mappingannotation.For the second inspection I added two possible fixes.
For the third inspection I added one possible fix. Remove one default source property.