3
우리가를 제외하고, 아래의 코드에 중단 스캔 : 우리는 규칙을 바라 보았다sonarqube 6.3 오류 상징 - 실행 - 도달 제한-의-16000 수 --완료되지 단계를
org.sonar.java.se.ExplodedGraphWalker$MaximumStepsReachedException: reached limit of 16000 steps for method getServiceProviders#151 in class ServiceProviderService
S2259 및 S2583을 참조하여 null 포인터에 대한 알림을 유지하려고합니다.
이 문제는 "일반"모드와 디버그 (-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;
}