问题
Why the heading error in the findbugs for the following code.
boolean isCreated = folder.mkdirs();
if (!isCreated) {
throw new IOException("Folder already exists..!!!");
}
回答1:
According to Finds Bug Description.
Method ignores exceptional return value
Method returns a value that is not checked. The return value should be checked since it can indicate an unusual or unexpected function execution.
回答2:
Probably because you're not checking for the SecurityException that mkdirs can throw.
来源:https://stackoverflow.com/questions/23631922/method-ignores-exceptional-return-value-findbugs