Program: 70880
Project: 70880
Buggy source:
/** 
 * Paser returned report ids.
 * @param activeIds
 * @return
 * @throws RemoteException
 */
protected ReportId[] parseReportId(ArrayList activeIds) throws RemoteException {
  if (activeIds == null || activeIds.size() <= 0) {
    return null;
  }
  java.util.Vector ids=new java.util.Vector();
  for (int i=0; i < activeIds.size(); i++) {
    String id=(String)activeIds.get(i);
    int firstComma=id.indexOf(',');
    if (id == null || firstComma == -1) {
      AxisFault fault=new AxisFault();
      fault.setFaultCode(new QName("String_Node_Str"));
      fault.setFaultString(BirtResources.getMessage(ResourceConstants.ACTION_EXCEPTION_INVALID_ID_FORMAT,new String[]{id}));
      throw fault;
    }
    int secondComma=id.indexOf(',',firstComma + 1);
    if (secondComma == -1) {
      secondComma=id.length();
    }
    String type=id.substring(firstComma + 1,secondComma);
    if (ReportIdType._Document.equalsIgnoreCase(type) || ReportIdType._Table.equalsIgnoreCase(type) || ReportIdType._Chart.equalsIgnoreCase(type)|| ReportIdType._Extended.equalsIgnoreCase(type)|| ReportIdType._Label.equalsIgnoreCase(type)|| ReportIdType._Group.equalsIgnoreCase(type)|| "String_Node_Str".equalsIgnoreCase(type)) {
      ReportId reportId=new ReportId();
      reportId.setId(id.substring(0,id.indexOf(',')));
      if (ReportIdType._Document.equalsIgnoreCase(type)) {
        reportId.setType(ReportIdType.Document);
      }
 else       if (ReportIdType._Table.equalsIgnoreCase(type)) {
        reportId.setType(ReportIdType.Table);
      }
 else       if (ReportIdType._Chart.equalsIgnoreCase(type) || ReportIdType._Extended.equalsIgnoreCase(type)) {
        reportId.setType(ReportIdType.Chart);
      }
 else       if (ReportIdType._Label.equalsIgnoreCase(type)) {
        reportId.setType(ReportIdType.Label);
      }
 else       if (ReportIdType._Group.equalsIgnoreCase(type)) {
        reportId.setType(ReportIdType.Group);
      }
 else       if ("String_Node_Str".equalsIgnoreCase(type)) {
        reportId.setType(ReportIdType.ColumnInfo);
      }
      try {
        reportId.setRptElementId(new Long(Long.parseLong(id.substring(secondComma + 1))));
      }
 catch (      Exception e) {
        reportId.setRptElementId(null);
      }
      ids.add(reportId);
    }
  }
  ReportId[] reportIds=new ReportId[ids.size()];
  for (int i=0; i < ids.size(); i++) {
    reportIds[i]=(ReportId)ids.get(i);
  }
  return reportIds;
}

Fixed version (ground truth):
/** 
 * Paser returned report ids.
 * @param activeIds
 * @return
 * @throws RemoteException
 */
protected ReportId[] parseReportId(ArrayList activeIds) throws RemoteException {
  if (activeIds == null || activeIds.size() <= 0) {
    return null;
  }
  java.util.Vector ids=new java.util.Vector();
  for (int i=0; i < activeIds.size(); i++) {
    String id=(String)activeIds.get(i);
    int firstComma=id.indexOf(',');
    if (id == null || firstComma == -1) {
      AxisFault fault=new AxisFault();
      fault.setFaultCode(new QName("String_Node_Str"));
      fault.setFaultString(BirtResources.getMessage(ResourceConstants.ACTION_EXCEPTION_INVALID_ID_FORMAT,new String[]{id}));
      throw fault;
    }
    int secondComma=id.indexOf(',',firstComma + 1);
    if (secondComma == -1) {
      secondComma=id.length();
    }
    String type=id.substring(firstComma + 1,secondComma);
    if (ReportIdType._Document.equalsIgnoreCase(type) || ReportIdType._Table.equalsIgnoreCase(type) || ReportIdType._Chart.equalsIgnoreCase(type)|| ReportIdType._Extended.equalsIgnoreCase(type)|| ReportIdType._Label.equalsIgnoreCase(type)|| ReportIdType._Group.equalsIgnoreCase(type)|| "String_Node_Str".equalsIgnoreCase(type)) {
      ReportId reportId=new ReportId();
      reportId.setId(id.substring(0,id.indexOf(',')));
      if (ReportIdType._Document.equalsIgnoreCase(type)) {
        reportId.setType(ReportIdType.Document);
      }
 else       if (ReportIdType._Table.equalsIgnoreCase(type)) {
        reportId.setType(ReportIdType.Table);
      }
 else       if (ReportIdType._Chart.equalsIgnoreCase(type) || ReportIdType._Extended.equalsIgnoreCase(type)) {
        reportId.setType(ReportIdType.Chart);
      }
 else       if (ReportIdType._Label.equalsIgnoreCase(type)) {
        reportId.setType(ReportIdType.Label);
      }
 else       if (ReportIdType._Group.equalsIgnoreCase(type)) {
        reportId.setType(ReportIdType.Group);
      }
 else       if ("String_Node_Str".equalsIgnoreCase(type)) {
        reportId.setType(ReportIdType.ColumnInfo);
      }
      try {
        reportId.setRptElementId(Long.valueOf(Long.parseLong(id.substring(secondComma + 1))));
      }
 catch (      Exception e) {
        reportId.setRptElementId(null);
      }
      ids.add(reportId);
    }
  }
  ReportId[] reportIds=new ReportId[ids.size()];
  for (int i=0; i < ids.size(); i++) {
    reportIds[i]=(ReportId)ids.get(i);
  }
  return reportIds;
}