Skip to content

Conversation

@Zegveld
Copy link
Contributor

@Zegveld Zegveld commented Nov 25, 2021

There is a special case where the getCandidates method incorrectly returned true.

Fixes #2673

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.

Looks good to me. I've left some comments that should be addressed I think.

Do you by any chance know why this is happening for the javac compiler only? Is it a bug that we should perhaps report?

@Zegveld
Copy link
Contributor Author

Zegveld commented Dec 4, 2021

Looks good to me. I've left some comments that should be addressed I think.

Do you by any chance know why this is happening for the javac compiler only? Is it a bug that we should perhaps report?

fixed the commented bits. The reason it happens for the javac compiler is because it does what the API says. We called a method with a primitive type that should not be called with a primitive type. The eclipse compiler is less restrictive apparently.

excerpt from the API:

{@return the type corresponding to a type element and actual type arguments} Given the type element for Set and the type mirror for String, for example, this method may be used to get the parameterized type Set<String>.

....

IllegalArgumentException - if too many or too few type arguments are given, or if an inappropriate type argument or type element is provided

Logically a primitive cannot be a type argument, you will need to use the boxed version of it. (Integer instead of int)
So in this case we were calling it with an inappropriate type argument.

@filiphr filiphr merged commit ea45666 into mapstruct:master Dec 11, 2021
@Zegveld Zegveld deleted the feature/2673 branch July 31, 2022 07:56
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.

Optional "wrapping" pattern broken with 1.5.0.Beta

2 participants