Skip to content

Conversation

@filiphr
Copy link
Member

@filiphr filiphr commented Sep 26, 2022

In the MethodMatcher we need to do a special check when the target type is primitive. The reason for that is that a Long is assignable to a primitive double. However, doing that means that information can be lost and thus we should not pick such methods. When the target type is primitive, then a method will be matched if and only if boxed equivalent of the target type is assignable to the boxed equivalent of the candidate return type.

Fixes #2840
Fixes #2913
Fixes #2921

…not match widening methods

In the MethodMatcher we need to do a special check when the target type is primitive.
The reason for that is that a Long is assignable to a primitive double.
However, doing that means that information can be lost and thus we should not pick such methods.
When the target type is primitive, then a method will be matched if and only if boxed equivalent of the target type is assignable to the boxed equivalent of the candidate return type
Copy link
Contributor

@sjaakd sjaakd left a comment

Choose a reason for hiding this comment

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

LGTM Filip. Go ahead

Copy link
Contributor

@Zegveld Zegveld 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, did find a single typo. ;)

@filiphr filiphr merged commit 73e8fd6 into mapstruct:main Sep 27, 2022
@filiphr filiphr deleted the target-type-resolvement branch September 27, 2022 07:35
@filiphr
Copy link
Member Author

filiphr commented Sep 27, 2022

Thanks for the reviews

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

Labels

None yet

Projects

None yet

3 participants