Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/370.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 加强-冗余空检查_Java_Spring Boot_Java 8_Null_Fortify - Fatal编程技术网

Java 加强-冗余空检查

Java 加强-冗余空检查,java,spring-boot,java-8,null,fortify,Java,Spring Boot,Java 8,Null,Fortify,Fortify在下面的代码段中给出了冗余的空检查问题       for (Result result : results)) { if (result != null // Fortify-- Compared with null : result && result.getA() != null        && result.get

Fortify在下面的代码段中给出了冗余的空检查问题

          for (Result result : results)) {
             if (result != null     // Fortify-- Compared with null : result
                  && result.getA() != null            
                   && result.getA().equalsIgnoreCase("foo")) {   //Fortify-- Dereferenced : result           
                  }              
               }               

有时,像这样的代码分析警告确实存在误报,或者,用@SuppressWarnings(“null”)修饰方法会关闭它。