2017-04-03 320 views
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,並希望保留有關空指針的通知。

這種情況發生在「常規」和調試(-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; 
} 

回答

0

6.3和更高版本要求甲骨文的Java 8.我們的公共Java 7似乎是最有可能的罪魁禍首。實際的原因可能是別的,但升級修復了它。