Skip to content

Incorrect handling of default parameter type in JsonJobParametersConverter #4299

Closed
@miki1029

Description

@miki1029

Bug description
I am reporting a bug in the JsonJobParametersConverter class in the spring batch framework.

According to the source code comments, the type parameter in the extended notation of job parameters is optional. However, the decode method in the JsonJobParametersConverter class throws a NullPointerException if the type parameter is not provided. This behavior goes against the documentation, as the default value of the type parameter should be String.

I would appreciate it if this issue could be addressed in a future release of spring batch.

Thank you for your attention to this matter.

Environment

  • Spring Batch version : 5.0.0
  • Java version : 17

Steps to reproduce

  1. Use the JsonJobParametersConverter in a Spring Batch application.
  2. Provide a value for the job parameter using the Extended notation without specifying a type.
  3. Run the application and observe the NullPointerException that is thrown in the decode method.

Expected behavior
According to the documentation, the type variable is optional and should default to String if it is not provided. The application should run without encountering any errors.

Minimal Complete Reproducible example

param1='{"value":"value1"}'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions