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

标签 java findbugs

为什么以下代码的 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/

相关文章:

java - 提供依赖项和 JBOSS EAP 7

eclipse - FindBugs 未显示在项目属性中

java - 如何在 Sonarqube 中导入 findbugs/PMD

java - DozerConverter 提示其中一个类中的 equals 方法

java - SonarQube Findbugs "needs sources to be compiled"

java - 如何正确关闭 java 命令行程序

java - 如何使用 Spring Boot 在不同端口启动 Web 容器和 Netty 服务器?

java - 错误 E/BitmapFactory:无法解码流:java.io.FileNotFoundException::open failed:ENOENT(没有这样的文件或目录)

Java 递归 : pass by reference