Skip to content

Parsing of variables with generic types to a wrong type #327

@vat78

Description

@vat78

I've faced with an exception that surprised me.
This is an example of the worker:

    @JobWorker(type = "processTasks")
    public void processTasks(@Variable List<Long> batch) {
        var firstElement = batch.get(0);
    }

And it fails in runtime with java.lang.ClassCastException: class java.lang.Integer cannot be cast to class java.lang.Long

Input list comes as List<Integer> in runtime and can't be matched to firstElement with type Long

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions