Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JobParameter must not accept null values #3913

Closed
fmbenhassine opened this issue May 18, 2021 · 3 comments
Closed

JobParameter must not accept null values #3913

fmbenhassine opened this issue May 18, 2021 · 3 comments

Comments

@fmbenhassine
Copy link
Contributor

fmbenhassine commented May 18, 2021

As of v4.3, it is possible to create a JobParameter with a null value. Unless I'm missing something, I see no valid use case for that. Moreover, this might cause issues like #834 and makes the code defensive for no added value. Like other domain objects where passed parameters are validated at creation time, job parameter values should be validated at construction time to be non null.

This is breaking change, so I will schedule it for v5.

@fmbenhassine fmbenhassine added this to the 5.0.0 milestone May 18, 2021
fmbenhassine added a commit to fmbenhassine/spring-batch that referenced this issue May 18, 2021
This is a WIP. Tests should be updated accordingly.

Issue spring-projects#3913
@fmbenhassine fmbenhassine modified the milestones: 5.0.0, 5.0.0-M1 Sep 9, 2021
@GirirajSinghRathore
Copy link

GirirajSinghRathore commented Apr 20, 2024

just upgraded to SpringBatch 5 and I got error like

"value must not be null"

it does not tell which field is set to null ,

could we not add checks in .toParamerters constructor and throw some meaningful message

@fmbenhassine
Copy link
Contributor Author

@GirirajSinghRathore Can you please open a separate issue with an example? I agree the error message should at least mention the parameter name

@GirirajSinghRathore
Copy link

Created the issue
@fmbenhassine
issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants