方法忽略异常的返回值:FindBugs [英] Method ignores exceptional return value : FindBugs
本文介绍了方法忽略异常的返回值:FindBugs的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
为什么以下代码的findbugs中出现标题错误.
Why the heading error in the findbugs for the following code.
boolean isCreated = folder.mkdirs();
if (!isCreated) {
throw new IOException("Folder already exists..!!!");
}
推荐答案
根据查找错误描述.
方法忽略特殊的返回值
方法返回一个未检查的值.返回值 应该检查,因为它可能表明异常或意外 函数执行.
Method returns a value that is not checked. The return value should be checked since it can indicate an unusual or unexpected function execution.
这篇关于方法忽略异常的返回值:FindBugs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文