Exception when receiving Long collection in MessageMapping [SPR-16252] #20799
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
status: backported
An issue that has been backported to maintenance branches
type: bug
A general bug
Milestone
Jhovanni opened SPR-16252 and commented
When you try to receive a collection of Long values, as parameter of a MessageMapping method (from spring messaging), you can print the collection. But if you try to access its values, there is an exception throw about not being able to cast Integer to Long.
Replicate it is easy:
@MessageMapping
("/channel")public void receiveLongs(List<Long> list) {
for (Long value : list) {
System.out.println("Line above throws java.lang.ClassCastException");
}
}
Exception throw is java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Long.
Code found in github repository is ready to be used and replicate the bug.
Affects: 4.3.12
Reference URL: https://github.com/Jhovanni/LongException
Issue Links:
Referenced from: commits 583201b, 6dbc828
Backported to: 4.3.14
The text was updated successfully, but these errors were encountered: