Skip to content

Incorrect code example in documentation #4550

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

Closed
wants to merge 2 commits into from

Conversation

chldppwls12
Copy link
Contributor

  • Message in Assert.state(dir.isDirectory()) was missing.
  • Message has been changed to start with a capital letter, consistent with other parts.

@@ -122,7 +122,7 @@ public class FileDeletingTasklet implements Tasklet, InitializingBean {
public RepeatStatus execute(StepContribution contribution,
ChunkContext chunkContext) throws Exception {
File dir = directory.getFile();
Assert.state(dir.isDirectory());
Assert.state(dir.isDirectory(), "Directory does not exist");
Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch! The message is missing and the code example does not compile. However, the message here is inaccurate, it would be appropriate if the assertion was dir.exists(). It should rather be something like "The resource must be a directory". Do you agree?

Copy link
Contributor Author

@chldppwls12 chldppwls12 Mar 8, 2024

Choose a reason for hiding this comment

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

Yes. I updated the message. Thanks:)

@fmbenhassine fmbenhassine added the status: waiting-for-reporter Issues for which we are waiting for feedback from the reporter label Mar 7, 2024
@chldppwls12 chldppwls12 requested a review from fmbenhassine March 8, 2024 04:15
@fmbenhassine fmbenhassine changed the title Update tasklet.adoc to fix Example Tasklet Implementation Incorrect code example in documentation Mar 8, 2024
fmbenhassine pushed a commit that referenced this pull request Mar 8, 2024
@fmbenhassine
Copy link
Contributor

Thank you for the update! LGTM now 👍

Rebased and merged as 6334fbf. Thank you for your contribution!

@fmbenhassine fmbenhassine added pr-for: bug in: documentation and removed status: waiting-for-reporter Issues for which we are waiting for feedback from the reporter labels Mar 8, 2024
@fmbenhassine fmbenhassine added this to the 5.2.0 milestone Mar 8, 2024
fmbenhassine pushed a commit that referenced this pull request Mar 8, 2024
@fmbenhassine fmbenhassine added the for: backport-to-5.1.x Issues that will be back-ported to the 5.1.x line label Mar 8, 2024
fmbenhassine added a commit that referenced this pull request Mar 8, 2024
@fmbenhassine fmbenhassine added the for: backport-to-5.0.x Issues that will be back-ported to the 5.0.x line label Mar 8, 2024
@fmbenhassine fmbenhassine modified the milestones: 5.2.0, 5.2.0-M1 Sep 16, 2024
FBibonne pushed a commit to FBibonne/spring-batch that referenced this pull request Feb 2, 2025
Issue spring-projects#4550

Signed-off-by: Fabrice Bibonne <fabrice.bibonne@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: backport-to-5.0.x Issues that will be back-ported to the 5.0.x line for: backport-to-5.1.x Issues that will be back-ported to the 5.1.x line in: documentation pr-for: bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants