IO-724 FileUtils#deleteDirectory(File) exception Javadoc inaccurate update#245
IO-724 FileUtils#deleteDirectory(File) exception Javadoc inaccurate update#245garydgregory merged 3 commits intoapache:masterfrom
Conversation
FileUtils.deleteDirectory javadoc is inaccurate for nonexistent directory
|
Thinng about this will be better when after we apply JSR305 If my memory be correct, there be a branch adding these annotations to suggest Nullable or NotNull. How's it going @garydgregory ? |
Remove NullPointerException from javadoc as future annotation may comes to place
The most important here is to remove the "IllegalArgumentException" if directory does not exist from the javadoc, which does not match the implementation condition: if (!directory.exists()) { return;} Regarding Nullable/NotNull, got it, removed this addition for now. |
Fixing Javadoc here is good. JSR305/8 is a different story, which we are not doing for now. |
|
@XenoAmess @garydgregory thank you, can you then please review and merge this PR ? |
I should be able to look at this later today, AFK ATM. |
@garydgregory thanks, will wait for your review and merge. |
FileUtils.deleteDirectory javadoc is inaccurate for nonexistent directory.
Change for returned exception javadoc, as the conditions at the method implementation do not match the javadoc.
Method implementation does not throws the IllegalArgumentException from the javadoc if directory does not exist:
if (!directory.exists()) {
return;
}
This one line code proves it:
FileUtils.deleteDirectory(new File("nonexistingdir"));