Skip to content

HttpMessageConverter read and write methods have restrictive type annotations [SPR-6848] #11514

@spring-projects-issues

Description

@spring-projects-issues

Alex Antonov opened SPR-6848 and commented

When trying to implement a HttpMessageConverter for Google Protocol Buffers I've run into a limitation by the write and read method signatures that require an exact type T.
With Protocol Buffers, as with many other types of marshaling systems, there is a base class, Message in this case, that all exact classes extend or implement.
canRead and canWrite methods do declare the relaxed and appropriate signature of <? extends T>, however in the read and write methods its being set to exactly T.

This prevents of calling the converter's write and read methods with passing an implementation of Message as an argument, since it does not conform to the generic restrictions set forth by the interfaces.


Affects: 3.0 GA

Issue Links:

Referenced from: commits 4ae1709

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions