-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Conversation
@@ -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"); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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:)
Thank you for the update! LGTM now 👍 Rebased and merged as 6334fbf. Thank you for your contribution! |
Issue spring-projects#4550 Signed-off-by: Fabrice Bibonne <fabrice.bibonne@gmail.com>
Assert.state(dir.isDirectory())
was missing.