Skip to content

[#1140] adds warning when the target has no target properties#3595

Merged
filiphr merged 11 commits intomapstruct:mainfrom
zyberzebra:#1140-add-warning-for-target-without-target-properties
May 11, 2025
Merged

[#1140] adds warning when the target has no target properties#3595
filiphr merged 11 commits intomapstruct:mainfrom
zyberzebra:#1140-add-warning-for-target-without-target-properties

Conversation

@zyberzebra
Copy link
Contributor

@zyberzebra zyberzebra commented May 6, 2024

Fixes: #1140
TODO:

  • should no accessible properties also lead to the warning?
    • I guess so
  • remove reportErrorForUnmappedTargetPropertiesIfRequired, I guess?
    • realized unmappedTarget is a different case.
  • Any other possibilities or edge cases to test?

@zyberzebra zyberzebra marked this pull request as draft May 6, 2024 19:16
- warning that no actual target properties are targeted/written to should be given when compiling
@zyberzebra zyberzebra marked this pull request as ready for review May 7, 2024 16:45
Copy link
Member

@filiphr filiphr left a comment

Choose a reason for hiding this comment

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

Thanks for your work on this @zyberzebra. I've left some comments.

@zyberzebra
Copy link
Contributor Author

@filiphr I'm not 100% what the correct workflow is. Should I request reviews when I'm ready or not?

@filiphr
Copy link
Member

filiphr commented May 27, 2024

The workflow is me trying to get time and going through all the emails and updated PRs 😀. I usually go through PRs that have been updated as well

@zyberzebra
Copy link
Contributor Author

The workflow is me trying to get time and going through all the emails and updated PRs 😀. I usually go through PRs that have been updated as well

Thanks for the clarification ! I just scrolled through some other pull request here and saw that some request reviews and because it's my first time working open source I was unsure. ;)
At work I just ping my mates 😁

@zyberzebra zyberzebra requested a review from filiphr August 25, 2024 09:29
@zyberzebra
Copy link
Contributor Author

@filiphr Sorry for the ping. Just thought I give you a ping, because my PRs are probably way down on the pile now.

With more time passing, it gets harder for me to remember what we fixed. Which is not a problem, put it might take longer to for me to respond if you come around for a review. :)

Copy link
Member

@filiphr filiphr left a comment

Choose a reason for hiding this comment

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

Sorry for the waiting @zyberzebra. I've done another pass here. Have a look at my comments

- remove method name
- assert that line is reported on warning
@zyberzebra zyberzebra requested a review from filiphr September 6, 2024 20:17
Copy link
Member

@filiphr filiphr left a comment

Choose a reason for hiding this comment

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

Good work @zyberzebra. I've done some small polishing and added a test case for the comment I left.

Have a look at it and let me know what you think

zyberzebra and others added 2 commits September 14, 2024 17:51
- the check needs to be after constructor parameters were evaluated
- otherwise we would produce incorrect warning if the constructor is used for setting target properties
@filiphr filiphr merged commit 602e290 into mapstruct:main May 11, 2025
6 checks passed
@zyberzebra zyberzebra deleted the #1140-add-warning-for-target-without-target-properties branch November 20, 2025 22:59
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.

Warning when the target has no target properties

2 participants