【中危】文件JSR223TestElement.java中第172行、49列,违反规则bugfinder-7.4:equals()方法比较类名而不是类对象,这或许不能确定它们是同一个类。
违反规则:[必要]bugfinder-7.4 规则描述: equals()方法比较类名而不是类对象,这或许不能确定它们是同一个类。 文件路径: apache-jmeter-5.5_src/apache-jmeter-5.5/src/core/src/main/java/org/apache/jmeter/util/JSR223TestElement.java 代码范围: 起于行 172 列 49 ; 止于行 172 列 55 引入人: feng.jiang jiangfengvs@123.com Commit信息: 51ba5ed7 24/05/09 15:56 更新时间: 25/08/28 14:54 诊断详情: http://192.168.68.161:9000/#/scanTaskDetail/projects/测试分组/test_project_1/scanTask/24?currentTab=workbench&tabName=使用了类名来比较类。&tabKey=855529 代码片段: 167 populateBindings(bindings); 168 File scriptFile = new File(getFilename()); 169 // Hack: bsh-2.0b5.jar BshScriptEngine implements Compilable but throws 170 // "java.lang.Error: unimplemented" 171 boolean supportsCompilable = scriptEngine instanceof Compilable 172 && !"bsh.engine.BshScriptEngine".equals(scriptEngine.getClass().getName()); // NOSONAR // $NON-NLS-1$ --- ^^^^^^^ 173 try { 174 if (!StringUtils.isEmpty(getFilename())) { 175 if (scriptFile.exists() && scriptFile.canRead()) { 176 if (supportsCompilable) {