加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Java > 正文

java – sonarqube 6.3错误无法完成 – 符号 – 执行 – 达到 –

发布时间:2020-12-15 02:18:55 所属栏目:Java 来源:网络整理
导读:我们有一个扫描在下面的代码中止,但例外: org.sonar.java.se.ExplodedGraphWalker$MaximumStepsReachedException: reached limit of 16000 steps for method getServiceProviders#151 in class ServiceProviderService 我们查看了规则S2259和S2583,并希望保
我们有一个扫描在下面的代码中止,但例外:

org.sonar.java.se.ExplodedGraphWalker$MaximumStepsReachedException: reached limit of 16000 steps for method getServiceProviders#151 in class ServiceProviderService

我们查看了规则S2259和S2583,并希望保留有关空指针的通知.

这种情况在“常规”和调试(-X)模式下都会发生,因此它不是问题1406.在我们的例子中,它似乎与try / catch有关. (参见下面的示例方法.)这可能是问题1295的复苏吗? https://jira.sonarsource.com/browse/SONARJAVA-1295如果是这样,有没有办法简单地从16,000增加堆栈,以便我们可以继续前进?

样本方法:

public static List<ServiceProvider> getServiceProviders() throws DAOException {
    Connection con = null;
    PreparedStatement stmt = null;
    ResultSet rs = null;
    List<ServiceProvider> serviceProviderList = new ArrayList<>();

    try {
        con = DatabaseUtils.getConnection();
        if (con != null) {
            stmt = con.prepareStatement(sqlSelectServiceProviders);

            rs = stmt.executeQuery();
            while (rs.next()) {
                ServiceProvider serviceProvider = new ServiceProvider();
                serviceProvider.setId(rs.getLong(1));
                serviceProvider.setName(rs.getString(2));
                // etc.
                serviceProviderList.add(serviceProvider);
            }   
        } else {
            DAOException ourDAOException = new DAOException();
            ourDAOException.setMessageCode(Consts.ERROR_CANNOT_ESTABLISH_CONNECTIONS);
            throw ourDAOException;
        }   
    } catch (DAOException daoexcep) {
        throw daoexcep;

    } catch (Exception sqlex) {
        log.error(ErrorType.SYSTEM + ": " + Consts.ERROR_CANNOT_GET_SERVICE_PROVIDER + " - " + sqlex);
        log.error(sqlex);
        try {
            if (con != null) {
                con.rollback();
            }   
        } catch (SQLException ex) {
        }   
        DAOException ourDAOException = new DAOException(sqlex);
        ourDAOException.setMessageCode(Consts.ERROR_CANNOT_GET_SERVICE_PROVIDER);
        throw ourDAOException;
    } finally {
        if (con != null) {
            try {
                con.close();
            } catch (SQLException e) {
            }   
            con = null;
        }   
    }   
    return serviceProviderList;
}

解决方法

6.3及更高版本需要Oracle Java 8.我们的公共Java 7似乎是最可能的罪魁祸首.实际原因可能是其他原因,但升级修复了它.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读