Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow for resource methods to return <? extends XYZ> #5331

Merged
merged 1 commit into from
Jun 20, 2023

Conversation

jansupol
Copy link
Contributor

No description provided.

Signed-off-by: jansupol <jan.supol@oracle.com>
@jansupol jansupol linked an issue May 12, 2023 that may be closed by this pull request
@mkarg
Copy link
Member

mkarg commented May 12, 2023

Thank you for fixing this! 👍

Copy link
Member

@mkarg mkarg left a comment

Choose a reason for hiding this comment

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

Thanks! :-)

@mkarg
Copy link
Member

mkarg commented May 17, 2023

You are awesome, guys! Really begging to get this feature ASAP! :-)

@mkarg
Copy link
Member

mkarg commented May 24, 2023

What is the schedule for getting this change into a release?

@senivam
Copy link
Contributor

senivam commented May 24, 2023

for the 2.40 the release is planned for the 2nd week of June (5-10 of June). If nothing changes...

@mkarg
Copy link
Member

mkarg commented May 24, 2023

Thank you Maxim, for the outlook, but actually I need to know the schedule for 3.x. I assume that would happen shortly after?

@senivam
Copy link
Contributor

senivam commented May 25, 2023

usually yes, but it depends on the number of changes to be released.

@mkarg
Copy link
Member

mkarg commented Jun 1, 2023

In Jersey 2.x, when an InterceptorWriter was replacing a Collection's content (e. g. from Collection<Apple> to Collection<Banana>) solely setting the entity by context.setEntity(myCollection) (hence, no context.setGenericType() was used), then the type of the objects inside of the collection was correctly detected to be Banana, not Apple anymore. Since Jersey 3.x, Jersey forwards the old type, so Apple is still expected, leading to Yasson being unable to cast Banana to Apple.

Will this PR also resolve that problem, too, or is the WriterInterceptor required to also context.setGenericType()?

@jansupol jansupol merged commit c42a6a2 into eclipse-ee4j:master Jun 20, 2023
@jansupol jansupol deleted the return.extends branch June 20, 2023 06:22
@senivam senivam added this to the 2.40 milestone Jun 20, 2023
@ar30067
Copy link

ar30067 commented Dec 5, 2023

in class ResourceMethodValidator.java Line 134
final Type responseType = invocable.getResponseType(); if (!isConcreteType(responseType)) { Errors.warning(invocable.getHandlingMethod(), LocalizationMessages.**TYPE_OF_METHOD_NOT_RESOLVABLE_TO_CONCRETE_TYPE**(responseType, invocable.getHandlingMethod().toGenericString())); }
is this warning related to this issue ?

@jansupol
Copy link
Contributor Author

jansupol commented Dec 5, 2023

@ar30067 It may be in case your resource methods return <? extends XYZ> or may not if the cause is different.

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.

Jersey fails to respond with wildcard generics
5 participants