Skip to content

#243: Do not warn for unmapped source properties on maps#244

Merged
hduelme merged 4 commits into
mainfrom
243
May 15, 2026
Merged

#243: Do not warn for unmapped source properties on maps#244
hduelme merged 4 commits into
mainfrom
243

Conversation

@thunderhook
Copy link
Copy Markdown
Contributor

No description provided.

@hduelme
Copy link
Copy Markdown
Contributor

hduelme commented May 2, 2026

@thunderhook good catch. Your implementation works for a single source parameter of type Map<String, ?>, but Map<Integer, ?> still disables the warnings. Also, Map handling is missing Map-as-normal-source detection that MapStruct performs.

@thunderhook
Copy link
Copy Markdown
Contributor Author

Thanks @hduelme !

I've adapted the check and:

  • fixed it when it comes to more than one parameter (e.g. using @Context)
  • enabled the warning for any key type that is not a String
  • and supported nested checks (e.g. "mapName.key")

Would you have a look at it again? Thanks in advance!

Copy link
Copy Markdown
Contributor

@hduelme hduelme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thunderhook really nice improvement. I looked through your implementation. I left two small comments. Otherwise, approved from my side.

Comment thread src/main/java/org/mapstruct/intellij/util/MapstructUtil.java Outdated
Comment thread testData/bugs/_243/DisableSourcePropertyInspectionOnMap.java
@thunderhook
Copy link
Copy Markdown
Contributor Author

@thunderhook really nice improvement. I looked through your implementation. I left two small comments. Otherwise, approved from my side.

Thanks for the review! I've adapted the code.

@hduelme hduelme merged commit 40d6f59 into main May 15, 2026
10 of 12 checks passed
@hduelme hduelme deleted the 243 branch May 15, 2026 19:23
@hduelme
Copy link
Copy Markdown
Contributor

hduelme commented May 15, 2026

@thunderhook nice improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants