HttpMessageConverter read and write methods have restrictive type annotations [SPR-6848] #11514
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
type: enhancement
A general enhancement
Milestone
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
The text was updated successfully, but these errors were encountered: