Program: 74014
Project: 74014
Buggy source:
/** 
 * load map from query id to result set id from report document.
 */
private void loadResultSetMetaData() throws EngineException {
  try {
    HashMap query2ResultMetaData=report.getResultMetaData();
    IDocArchiveReader reader=reportDocReader.getArchive();
    HashMap queryCounts=new HashMap();
    ArrayList result=DteMetaInfoIOUtil.loadDteMetaInfo(reader);
    if (result != null) {
      Set dteMetaInfoSet=new HashSet();
      for (int i=0; i < result.size(); i++) {
        String[] rsetRelation=(String[])result.get(i);
        String dteMetaInfoString=getDteMetaInfoString(rsetRelation);
        if (dteMetaInfoSet.contains(dteMetaInfoString)) {
          continue;
        }
        dteMetaInfoSet.add(dteMetaInfoString);
        String queryId=rsetRelation[2];
        String rsetId=rsetRelation[3];
        IQueryDefinition query=getQuery(queryId);
        rsetId2queryIdMapping.put(rsetId,queryId);
        int count=-1;
        Integer countObj=(Integer)queryCounts.get(queryId);
        if (countObj != null) {
          count=countObj.intValue();
        }
        count++;
        String rsetName=getQueryName(queryId);
        if (count > 0) {
          rsetName=rsetName + "String_Node_Str" + count;
        }
        queryCounts.put(queryId,new Integer(count));
        rsetName2IdMapping.put(rsetName,rsetId);
        if (null != query2ResultMetaData) {
          ResultMetaData metaData=(ResultMetaData)query2ResultMetaData.get(query);
          if (metaData != null && metaData.getColumnCount() > 0) {
            IResultSetItem resultItem=new ResultSetItem(rsetName,metaData);
            resultMetaList.add(resultItem);
          }
        }
      }
    }
  }
 catch (  IOException ioe) {
    logger.log(Level.SEVERE,ioe.getMessage(),ioe);
  }
}

Fixed version (ground truth):
/** 
 * load map from query id to result set id from report document.
 */
private void loadResultSetMetaData(){
  try {
    HashMap query2ResultMetaData=report.getResultMetaData();
    IDocArchiveReader reader=reportDocReader.getArchive();
    HashMap queryCounts=new HashMap();
    ArrayList result=DteMetaInfoIOUtil.loadDteMetaInfo(reader);
    if (result != null) {
      Set dteMetaInfoSet=new HashSet();
      for (int i=0; i < result.size(); i++) {
        String[] rsetRelation=(String[])result.get(i);
        String dteMetaInfoString=getDteMetaInfoString(rsetRelation);
        if (dteMetaInfoSet.contains(dteMetaInfoString)) {
          continue;
        }
        dteMetaInfoSet.add(dteMetaInfoString);
        String queryId=rsetRelation[2];
        String rsetId=rsetRelation[3];
        IQueryDefinition query=getQuery(queryId);
        rsetId2queryIdMapping.put(rsetId,queryId);
        int count=-1;
        Integer countObj=(Integer)queryCounts.get(queryId);
        if (countObj != null) {
          count=countObj.intValue();
        }
        count++;
        String rsetName=getQueryName(queryId);
        if (count > 0) {
          rsetName=rsetName + "String_Node_Str" + count;
        }
        queryCounts.put(queryId,new Integer(count));
        rsetName2IdMapping.put(rsetName,rsetId);
        if (null != query2ResultMetaData) {
          ResultMetaData metaData=(ResultMetaData)query2ResultMetaData.get(query);
          if (metaData != null && metaData.getColumnCount() > 0) {
            IResultSetItem resultItem=new ResultSetItem(rsetName,metaData);
            resultMetaList.add(resultItem);
          }
        }
      }
    }
  }
 catch (  IOException ioe) {
    logger.log(Level.SEVERE,ioe.getMessage(),ioe);
  }
}