Program: 17360
Project: 17360
Buggy source:
private Long mapCount(CQLStatementIterator statementIterator,CDefinition definition,Long limit) throws RhombusException {
  Long resultCount=0L;
  Map<String,Object> clientFilters=statementIterator.getClientFilters();
  if (clientFilters == null) {
    int statementNumber=0;
    while (statementIterator.hasNext()) {
      CQLStatement cql=statementIterator.next();
      ResultSet resultSet=cqlExecutor.executeSync(cql);
      resultCount+=resultSet.one().getLong(0);
      statementNumber++;
      if ((limit > 0 && resultCount >= limit)) {
        logger.debug("String_Node_Str");
        resultCount=limit;
        break;
      }
      if (statementNumber > reasonableStatementLimit) {
        throw new RhombusException("String_Node_Str" + reasonableStatementLimit + "String_Node_Str");
      }
      if (statementIterator.hasNext()) {
        statementIterator.nextShard();
      }
    }
  }
 else {
    CQLExecutorIterator cqlIterator=new CQLExecutorIterator(cqlExecutor,(BaseCQLStatementIterator)statementIterator);
    while (cqlIterator.hasNext()) {
      Row row=cqlIterator.next();
      if (row == null) {
        continue;
      }
      Map<String,Object> result=mapResult(row,definition);
      boolean resultMatchesFilters=this.resultMatchesFilters(result,clientFilters);
      if (resultMatchesFilters) {
        resultCount++;
      }
      if ((limit > 0 && resultCount >= limit)) {
        logger.debug("String_Node_Str");
        break;
      }
      if (cqlIterator.statementNumber > reasonableStatementLimit) {
        throw new RhombusException("String_Node_Str" + reasonableStatementLimit + "String_Node_Str");
      }
    }
  }
  return resultCount;
}

Fixed version (ground truth):
private Long mapCount(CQLStatementIterator statementIterator,CDefinition definition,Long limit) throws RhombusException {
  Long resultCount=0L;
  Map<String,Object> clientFilters=statementIterator.getClientFilters();
  if (clientFilters == null) {
    int statementNumber=0;
    while (statementIterator.hasNext()) {
      CQLStatement cql=statementIterator.next();
      ResultSet resultSet=cqlExecutor.executeSync(cql);
      resultCount+=resultSet.one().getLong(0);
      statementNumber++;
      if ((limit > 0 && resultCount >= limit)) {
        logger.debug("String_Node_Str");
        resultCount=limit;
        break;
      }
      if (statementNumber > reasonableStatementLimit) {
        throw new RhombusException("String_Node_Str" + reasonableStatementLimit + "String_Node_Str");
      }
      if (statementIterator.hasNext()) {
        statementIterator.nextShard();
      }
    }
  }
 else {
    CQLExecutorIterator cqlIterator=new CQLExecutorIterator(cqlExecutor,(BaseCQLStatementIterator)statementIterator);
    cqlIterator.setPageSize(limit);
    while (cqlIterator.hasNext()) {
      Row row=cqlIterator.next();
      if (row == null) {
        continue;
      }
      Map<String,Object> result=mapResult(row,definition);
      boolean resultMatchesFilters=this.resultMatchesFilters(result,clientFilters);
      if (resultMatchesFilters) {
        resultCount++;
      }
      if ((limit > 0 && resultCount >= limit)) {
        logger.debug("String_Node_Str");
        break;
      }
      if (cqlIterator.statementNumber > reasonableStatementLimit) {
        throw new RhombusException("String_Node_Str" + reasonableStatementLimit + "String_Node_Str");
      }
    }
  }
  return resultCount;
}