Skip to content

HttpMessageConverter should accept Class<? extends T> on can read [SPR-6771] #11437

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

Closed
spring-projects-issues opened this issue Jan 25, 2010 · 1 comment
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Jan 25, 2010

Oliver Drotbohm opened SPR-6771 and commented

There's a small glitch similar to #11408 inside HttpMessageConverter. If you use it programatically you usually ask canRead(Class<? extends T> clazz, MediaType mediatype) before invoking read(Class<T> clazz, HttpInputMessage message). If you now have an implementation fixing generics to Object to be as general as possible you can call canRead with a Foo.class but then in turn not read with Foo.class as it is not compatible to Class<Object>.


Issue Links:

Referenced from: commits f2fdf9f

@spring-projects-issues
Copy link
Collaborator Author

Arjen Poutsma commented

I've changed the canRead/canWrite signatures to Class<?> instead of Class<? extends T>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants