GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [#3837] Add warning/error for redundant ignoreUnmappedSourceProperties entries by codeswithritesh · Pull Request #3906 · mapstruct/mapstruct

Conversation

@codeswithritesh

@codeswithritesh codeswithritesh commented Jul 27, 2025 •
edited by filiphr
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Enhancement: warn when mapped properties are listed in ignoreUnmappedSourceProperties (#3837)

  • Enhances @BeanMapping handling by reporting a warning when a property is both mapped and listed in ignoreUnmappedSourceProperties.
  • Respects effective unmappedSourcePolicy from @BeanMapping, @Mapper, or @MapperConfig.
  • Avoids reporting warning when policy is set to IGNORE.
  • Adds new unit tests for redundant, valid, mixed, and policy-specific behavior.
    Fixes Report properties in ignoreUnmappedSourceProperties that actually do get mapped #3837

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
codeswithritesh added 2 commits July 27, 2025 19:39
@codeswithritesh
Adds compiler warning when properties listed in ignoreUnmappedSourceP…
6158fe3
…roperties are actually mapped.

Respects unmappedSourcePolicy and includes tests for redundant and valid ignore cases.
@codeswithritesh
added detail exclusion path in fullFeatureTest for ignoreUnmappedSour…
4ec06a7
…ceProperties warning's UserMappers
@codeswithritesh codeswithritesh mentioned this pull request Jul 27, 2025
Report properties in ignoreUnmappedSourceProperties that actually do get mapped #3837
Closed
@gnuemacscoin

gnuemacscoin commented Jul 31, 2025

Copy link
Copy Markdown

Looks good, though the message grammar is a little off. I would rephrase it as "Source %s is mapped despite being listed in ignoreUnknownSourceProperties." or "Source %s is being mapped despite appearing in ignoreUnknownSourceProperties.".

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@codeswithritesh
#3837: fix: improve grammar in ignoreUnmappedSourceProperties validat…
eec6e03
…ion message. Updated the validation message to use clearer and more grammatically correct phrasing, e.g., "Source property 'email' is mapped despite being listed in ignoreUnmappedSourceProperties."
@codeswithritesh

codeswithritesh commented Aug 1, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

Thanks for the suggestion, gnuemacscoin! I have updated the validation messages as recommended.

Below are example warning/error messages generated by MapStruct using the format:
"Source %s mapped despite being listed in ignoreUnmappedSourceProperties."

• For a single source property:
"Source property 'email' is mapped despite being listed in ignoreUnmappedSourceProperties."

• For multiple source properties:
"Source properties 'email', 'username' are mapped despite being listed in ignoreUnmappedSourceProperties."

Let me know if you'd prefer a different phrasing.

@filiphr When you have a moment, could you please take a look at this PR? Your feedback would be appreciated.

gnuemacscoin reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

filiphr
filiphr requested changes Aug 4, 2025
View reviewed changes

@filiphr filiphr left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

The approach looks OK @codeswithritesh. I've left one comment that should be addressed before merging this, we should not need changes in the fullFeaturesTest/pom.xml. We should instead use Erroneous in the name of the mappers, that are producing compile errors, in our tests

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread integrationtest/src/test/resources/fullFeatureTest/pom.xml Resolved

Uh oh!

There was an error while loading. Please reload this page.

@codeswithritesh
#3837: moved erroneous mappers on erroneous subpackage
b2d96a5
@codeswithritesh

codeswithritesh commented Aug 5, 2025

Copy link
Copy Markdown
Contributor Author

Thank you, @filiphr!
Glad to hear the changes look good, and great to see the CI checks have passed.
Let me know if there’s anything else you'd like me to update. Otherwise, I’ll wait for you to proceed with the merge — looking forward to it! 🙂

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@codeswithritesh
codeswithritesh requested a review from filiphr August 8, 2025 14:15
filiphr
filiphr approved these changes Aug 24, 2025
View reviewed changes
@filiphr
filiphr merged commit fe43563 into mapstruct:main Aug 24, 2025
@filiphr

filiphr commented Aug 24, 2025

Copy link
Copy Markdown
Member

Thanks @codeswithritesh, I've merged this

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@codeswithritesh

codeswithritesh commented Aug 24, 2025

Copy link
Copy Markdown
Contributor Author

Thank you @filiphr

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

Reviewers

@filiphr filiphr filiphr approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Report properties in ignoreUnmappedSourceProperties that actually do get mapped

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@codeswithritesh @gnuemacscoin @filiphr
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.