Program: 17374
Project: 17374
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);
    if (limit <= 0) {
      limit=CObjectCQLGenerator.MAX_CQL_STATEMENT_LIMIT;
    }
    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;
}

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()) {
      statementIterator.nextShard();
      CQLStatement cql=statementIterator.next();
      ResultSet resultSet=cqlExecutor.executeSync(cql);
      Long numResults=resultSet.one().getLong(0);
      resultCount+=numResults;
      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");
      }
    }
  }
 else {
    CQLExecutorIterator cqlIterator=new CQLExecutorIterator(cqlExecutor,(BaseCQLStatementIterator)statementIterator);
    if (limit <= 0) {
      limit=CObjectCQLGenerator.MAX_CQL_STATEMENT_LIMIT;
    }
    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;
}