Skip to content

Conversation

@cppwfs
Copy link
Collaborator

@cppwfs cppwfs commented Sep 7, 2021

Makes sure that dependencies are passed in via parameters in bean declaraction vs. Autowiring

refer to spring-projects/spring-batch#3991
resolves #797

if (this.lineTokenizer != null) {
mapFlatFileItemReaderBuilder.lineTokenizer(this.lineTokenizer);
if (lineTokenizer != null) {
mapFlatFileItemReaderBuilder.lineTokenizer(lineTokenizer);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why add the if statements? We previously depended upon the builder to validate that the state was valid.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They were not required so , they can be null. So we need the null check.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again...the builder does that check. We don't do null checks on any of the other places we do this kind of thing (see here for example).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bye bye ifs

Makes sure that dependencies are passed in via parameters in bean declaraction vs. Autowiring

refer to spring-projects/spring-batch#3991
resolves spring-cloud#797

Updated based on code review
@cppwfs cppwfs merged commit 332e693 into spring-cloud:main Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Circular reference error when autowiring JobBuilderFactory in task applications

2 participants