gpt4 book ai didi

java - sonarqube 6.3 错误 could-not-complete-symbolic-execution-reached-limit-of-16000 steps

转载 作者:搜寻专家 更新时间:2023-11-01 03:47:21 32 4
gpt4 key购买 nike

我们有一个扫描在下面的代码上中止,除了:

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。我们的公共(public) Java 7 似乎是最有可能的罪魁祸首。实际原因可能是其他原因,但升级修复了它。

关于java - sonarqube 6.3 错误 could-not-complete-symbolic-execution-reached-limit-of-16000 steps,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43189650/

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