Skip to content

Receive Long collection in MessageMapping #11227

Closed
@Jhovanni

Description

@Jhovanni

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

Spring boot version: 1.5.8.RELEASE

Probably the bug is not related to spring boot, but I wasn't able to find where to report it for spring framework project. Please if its required to move it just let me know and I will without any problem. I just need to know where to report it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: invalidAn issue that we don't feel is valid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions