Skip to content

#3786 Fix NPE situations and have the normal resulting message pop out.#3794

Merged
filiphr merged 7 commits intomapstruct:mainfrom
Zegveld:issue_3786
Jan 24, 2025
Merged

#3786 Fix NPE situations and have the normal resulting message pop out.#3794
filiphr merged 7 commits intomapstruct:mainfrom
Zegveld:issue_3786

Conversation

@Zegveld
Copy link
Contributor

@Zegveld Zegveld commented Dec 21, 2024

closes #3786

@hduelme
Copy link
Contributor

hduelme commented Dec 22, 2024

This fixes the NPE, but the error message seems wrong. byte[] has a accessible constructor. For example byte[] map(byte[] b) works. BUILDER_NO_BUILD_METHOD_FOUND ("No build method \"%s\" found in \"%s\" for \"%s\". Found methods: \"%s\".") would fit better I think.

@Zegveld
Copy link
Contributor Author

Zegveld commented Dec 22, 2024

This fixes the NPE, but the error message seems wrong. byte[] has a accessible constructor. For example byte[] map(byte[] b) works. BUILDER_NO_BUILD_METHOD_FOUND ("No build method \"%s\" found in \"%s\" for \"%s\". Found methods: \"%s\".") would fit better I think.

To be honest I was hoping for the message about mapping from non-iterable to iterable, because that one would fit better. Might spent some more time today to see if I can get that message to pop instead.

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 the quick fix @Zegveld. Why are the changes in Type needed? The MethodRetrievalProcessor is happening earlier and I don't think that the changes in Type would be needed. Can you please revert those changes?

@Zegveld
Copy link
Contributor Author

Zegveld commented Jan 23, 2025

Thanks for the quick fix @Zegveld. Why are the changes in Type needed? The MethodRetrievalProcessor is happening earlier and I don't think that the changes in Type would be needed. Can you please revert those changes?

Seems like those changes were left over from initially tackling the NPE's. After doing the checks correctly at the MethodRetrievalProcessor these can indeed be reverted. I've reverted the changes to the Type class.

@filiphr filiphr merged commit 3955124 into mapstruct:main Jan 24, 2025
6 checks passed
@filiphr
Copy link
Member

filiphr commented Jan 24, 2025

Thanks @Zegveld

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.

NPE when defining mapping to primitive array

3 participants

Comments