gpt4 book ai didi

java - 方法忽略异常返回值: FindBugs

转载 作者:行者123 更新时间:2023-12-02 05:50:03 31 4
gpt4 key购买 nike

为什么以下代码的 findbugs 中出现标题错误。

 boolean isCreated =  folder.mkdirs();

if (!isCreated) {
throw new IOException("Folder already exists..!!!");
}

最佳答案

根据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.

关于java - 方法忽略异常返回值: FindBugs,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23631922/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com