Skip to content

Fix #3839 target this source is reported as unmapped - #4122

Open
jjh75607 wants to merge 1 commit into
mapstruct:mainfrom
jjh75607:bugfix/3839-target-this-unmapped-source
Open

jjh75607 wants to merge 1 commit into
mapstruct:mainfrom
jjh75607:bugfix/3839-target-this-unmapped-source

Conversation

@jjh75607

@jjh75607 jjh75607 commented Sep 9, 2026

Copy link
Copy Markdown

Fixes #3839

A source consumed only by @Mapping( target = "." ) is still reported as unmapped, because handleDefinedMappings continues past the unprocessedSourceProperties.remove( source ) block when the shallowest target name is null.

Rather than move that block, this clears the source in applyTargetThisMapping, and only when the mapping contributed a property: a target this whose source shares no name with the target maps nothing, and reporting its source is the only signal of that. There are fixtures for the documented example and for a single target this, plus one for the unused case, which asserts the diagnostics it already produces.

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.

Nested @Mapping is ignored for unmapped source report

1 participant