Skip to content

Consider making JobParameters#getParameters() immutable #3980

Closed
@marschall

Description

@marschall

JobParameters#getParameters() currently returns a mutable defensive copy of the job parameters, even though the Javadoc says

@return an unmodifiable map containing all parameters.

This means that anybody who just wants read-only access to the job parameters, eg. only to iterate over them, eg. SimpleJobRepository#createJobExecution has to incur the cost of a defensive copy of a LinkedHashMap. Copying a LinkedHashMap is unfortunately quite expensive in term of memory allocation.

It looks like to copy was made modifiable with BATCH-671 / #2905 / e68a413

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions