Program: 57525
Project: 57525
Buggy source:
public ArrayList<PerspectiveInitializationData> parseGrouping(IDType targetIDType){
  swtGuiManager.setProgressBarText("String_Node_Str" + targetIDType);
  float progressBarFactor=100f / numberOfLinesInFile;
  IDSpecification idSpecification=groupingSpecifications.getRowIDSpecification();
  IDType sourceIDType=IDType.getIDType(idSpecification.getIdType());
  if (!sourceIDType.getIDCategory().equals(targetIDType.getIDCategory()))   throw new IllegalArgumentException("String_Node_Str" + sourceIDType + "String_Node_Str"+ targetIDType);
  IDMappingManager idMappingManager=IDMappingManagerRegistry.get().getIDMappingManager(sourceIDType.getIDCategory());
  if (groupingSpecifications.getDataSourcePath() == null) {
    Logger.log(new Status(Status.INFO,this.toString(),"String_Node_Str"));
    return null;
  }
  BufferedReader reader;
  try {
    String[] headerCells=null;
    if (groupingSpecifications.isContainsColumnIDs()) {
      reader=GeneralManager.get().getResourceLoader().getResource(groupingSpecifications.getDataSourcePath());
      String headerLine="String_Node_Str";
      int rowOfColumnIDs=(groupingSpecifications.getRowOfColumnIDs() != null) ? groupingSpecifications.getRowOfColumnIDs() : groupingSpecifications.getNumberOfHeaderLines() - 1;
      for (int countToHeader=0; countToHeader <= rowOfColumnIDs; countToHeader++) {
        headerLine=reader.readLine();
      }
      headerCells=headerLine.split(groupingSpecifications.getDelimiter(),-1);
      reader.close();
    }
    reader=GeneralManager.get().getResourceLoader().getResource(groupingSpecifications.getDataSourcePath());
    for (int headerLineCounter=0; headerLineCounter < groupingSpecifications.getNumberOfHeaderLines(); headerLineCounter++) {
      reader.readLine();
    }
    ArrayList<Integer> columnsToRead=groupingSpecifications.getColumns();
    String firstDataLine=null;
    if (columnsToRead == null || headerCells == null) {
      firstDataLine=reader.readLine();
      String[] data=firstDataLine.split(groupingSpecifications.getDelimiter());
      if (columnsToRead == null) {
        columnsToRead=new ArrayList<Integer>(data.length);
        for (int columnCount=1; columnCount < data.length; columnCount++) {
          columnsToRead.add(columnCount);
        }
      }
      if (headerCells == null) {
        headerCells=new String[data.length];
        for (int columnCount=0; columnCount < data.length; columnCount++) {
          headerCells[columnCount]=DEFAULT_GROUP_NAME;
        }
      }
    }
    ArrayList<ArrayList<Pair<String,ArrayList<Integer>>>> listOfGroupLists=new ArrayList<ArrayList<Pair<String,ArrayList<Integer>>>>(columnsToRead.size());
    ArrayList<String> listOfGroupNames=new ArrayList<String>(columnsToRead.size());
    ArrayList<Pair<String,ArrayList<Integer>>> currentGroupList;
    for (    Integer columnNumber : columnsToRead) {
      currentGroupList=new ArrayList<Pair<String,ArrayList<Integer>>>();
      listOfGroupLists.add(currentGroupList);
      listOfGroupNames.add(headerCells[columnNumber]);
    }
    int lineCounter=0;
    while (true) {
      String line=null;
      if (firstDataLine == null) {
        line=reader.readLine();
      }
 else {
        line=firstDataLine;
        firstDataLine=null;
      }
      if (line == null)       break;
      String[] columns=line.split(groupingSpecifications.getDelimiter());
      String originalID=columns[groupingSpecifications.getColumnOfRowIds()];
      originalID=convertID(originalID,idSpecification.getIdTypeParsingRules());
      Integer mappedID=idMappingManager.getID(sourceIDType,targetIDType,originalID);
      if (mappedID == null) {
        Logger.log(new Status(Status.WARNING,this.toString(),"String_Node_Str" + originalID));
        continue;
      }
      int groupListCounter=0;
      for (      Integer columnID : columnsToRead) {
        currentGroupList=listOfGroupLists.get(groupListCounter);
        ArrayList<Integer> group=null;
        for (        Pair<String,ArrayList<Integer>> groupPair : currentGroupList) {
          if (groupPair.getFirst().equals(columns[columnID]))           group=groupPair.getSecond();
        }
        if (group == null) {
          group=new ArrayList<Integer>();
          currentGroupList.add(new Pair<String,ArrayList<Integer>>(columns[columnID],group));
        }
        group.add(mappedID);
        groupListCounter++;
      }
      lineCounter++;
      if (lineCounter % 100 == 0) {
        swtGuiManager.setProgressBarPercentage((int)(progressBarFactor * lineCounter));
      }
    }
    reader.close();
    ArrayList<PerspectiveInitializationData> perspectiveInitializationDatas=new ArrayList<PerspectiveInitializationData>();
    for (int groupListCount=0; groupListCount < listOfGroupLists.size(); groupListCount++) {
      ArrayList<Pair<String,ArrayList<Integer>>> groupList=listOfGroupLists.get(groupListCount);
      ArrayList<Integer> sortedIDs=new ArrayList<Integer>();
      ArrayList<Integer> clusterSizes=new ArrayList<Integer>(groupList.size());
      ArrayList<Integer> sampleElements=new ArrayList<Integer>(groupList.size());
      ArrayList<String> clusterNames=new ArrayList<String>(groupList.size());
      int sampleIndex=0;
      for (      Pair<String,ArrayList<Integer>> groupPair : groupList) {
        ArrayList<Integer> group=groupPair.getSecond();
        sortedIDs.addAll(group);
        clusterSizes.add(group.size());
        clusterNames.add(groupPair.getFirst());
        sampleElements.add(sampleIndex);
        sampleIndex+=group.size();
      }
      PerspectiveInitializationData data=new PerspectiveInitializationData();
      data.setData(sortedIDs,clusterSizes,sampleElements,clusterNames);
      String groupLabel=listOfGroupNames.get(groupListCount);
      if (groupLabel.equals(DEFAULT_GROUP_NAME)) {
        if (groupingSpecifications.getGroupingName() != null) {
          groupLabel=clusterSizes.size() + "String_Node_Str" + groupingSpecifications.getGroupingName();
        }
 else {
          groupLabel=clusterSizes.size() + "String_Node_Str";
        }
      }
      data.setLabel(groupLabel);
      perspectiveInitializationDatas.add(data);
    }
    return perspectiveInitializationDatas;
  }
 catch (  IOException ioException) {
    throw new IllegalStateException("String_Node_Str" + groupingSpecifications.getDataSourcePath());
  }
}

Fixed version (ground truth):
public ArrayList<PerspectiveInitializationData> parseGrouping(IDType targetIDType){
  swtGuiManager.setProgressBarText("String_Node_Str" + targetIDType);
  float progressBarFactor=100f / numberOfLinesInFile;
  IDSpecification idSpecification=groupingSpecifications.getRowIDSpecification();
  IDType sourceIDType=IDType.getIDType(idSpecification.getIdType());
  if (!sourceIDType.getIDCategory().equals(targetIDType.getIDCategory()))   throw new IllegalArgumentException("String_Node_Str" + sourceIDType + "String_Node_Str"+ targetIDType);
  IDMappingManager idMappingManager=IDMappingManagerRegistry.get().getIDMappingManager(sourceIDType.getIDCategory());
  if (groupingSpecifications.getDataSourcePath() == null) {
    Logger.log(new Status(Status.INFO,this.toString(),"String_Node_Str"));
    return null;
  }
  BufferedReader reader;
  try {
    String[] headerCells=null;
    if (groupingSpecifications.isContainsColumnIDs()) {
      reader=GeneralManager.get().getResourceLoader().getResource(groupingSpecifications.getDataSourcePath());
      String headerLine="String_Node_Str";
      int rowOfColumnIDs=(groupingSpecifications.getRowOfColumnIDs() != null) ? groupingSpecifications.getRowOfColumnIDs() : groupingSpecifications.getNumberOfHeaderLines() - 1;
      for (int countToHeader=0; countToHeader <= rowOfColumnIDs; countToHeader++) {
        headerLine=reader.readLine();
      }
      headerCells=headerLine.split(groupingSpecifications.getDelimiter(),-1);
      reader.close();
    }
    reader=GeneralManager.get().getResourceLoader().getResource(groupingSpecifications.getDataSourcePath());
    for (int headerLineCounter=0; headerLineCounter < groupingSpecifications.getNumberOfHeaderLines(); headerLineCounter++) {
      reader.readLine();
    }
    ArrayList<Integer> columnsToRead=groupingSpecifications.getColumns();
    String firstDataLine=null;
    if (columnsToRead == null || headerCells == null) {
      firstDataLine=reader.readLine();
      String[] data=firstDataLine.split(groupingSpecifications.getDelimiter());
      if (columnsToRead == null) {
        columnsToRead=new ArrayList<Integer>(data.length);
        for (int columnCount=1; columnCount < data.length; columnCount++) {
          columnsToRead.add(columnCount);
        }
      }
      if (headerCells == null) {
        headerCells=new String[data.length];
        for (int columnCount=0; columnCount < data.length; columnCount++) {
          headerCells[columnCount]=DEFAULT_GROUP_NAME;
        }
      }
    }
    ArrayList<ArrayList<Pair<String,ArrayList<Integer>>>> listOfGroupLists=new ArrayList<ArrayList<Pair<String,ArrayList<Integer>>>>(columnsToRead.size());
    ArrayList<String> listOfGroupNames=new ArrayList<String>(columnsToRead.size());
    ArrayList<Pair<String,ArrayList<Integer>>> currentGroupList;
    for (    Integer columnNumber : columnsToRead) {
      currentGroupList=new ArrayList<Pair<String,ArrayList<Integer>>>();
      listOfGroupLists.add(currentGroupList);
      listOfGroupNames.add(headerCells[columnNumber]);
    }
    int lineCounter=0;
    while (true) {
      String line=null;
      if (firstDataLine == null) {
        line=reader.readLine();
      }
 else {
        line=firstDataLine;
        firstDataLine=null;
      }
      if (line == null)       break;
      String[] columns=line.split(groupingSpecifications.getDelimiter());
      String originalID=columns[groupingSpecifications.getColumnOfRowIds()];
      originalID=convertID(originalID,sourceIDType.getIdTypeParsingRules());
      Integer mappedID=idMappingManager.getID(sourceIDType,targetIDType,originalID);
      if (mappedID == null) {
        Logger.log(new Status(Status.WARNING,this.toString(),"String_Node_Str" + originalID));
        continue;
      }
      int groupListCounter=0;
      for (      Integer columnID : columnsToRead) {
        currentGroupList=listOfGroupLists.get(groupListCounter);
        ArrayList<Integer> group=null;
        for (        Pair<String,ArrayList<Integer>> groupPair : currentGroupList) {
          if (groupPair.getFirst().equals(columns[columnID]))           group=groupPair.getSecond();
        }
        if (group == null) {
          group=new ArrayList<Integer>();
          currentGroupList.add(new Pair<String,ArrayList<Integer>>(columns[columnID],group));
        }
        group.add(mappedID);
        groupListCounter++;
      }
      lineCounter++;
      if (lineCounter % 100 == 0) {
        swtGuiManager.setProgressBarPercentage((int)(progressBarFactor * lineCounter));
      }
    }
    reader.close();
    ArrayList<PerspectiveInitializationData> perspectiveInitializationDatas=new ArrayList<PerspectiveInitializationData>();
    for (int groupListCount=0; groupListCount < listOfGroupLists.size(); groupListCount++) {
      ArrayList<Pair<String,ArrayList<Integer>>> groupList=listOfGroupLists.get(groupListCount);
      ArrayList<Integer> sortedIDs=new ArrayList<Integer>();
      ArrayList<Integer> clusterSizes=new ArrayList<Integer>(groupList.size());
      ArrayList<Integer> sampleElements=new ArrayList<Integer>(groupList.size());
      ArrayList<String> clusterNames=new ArrayList<String>(groupList.size());
      int sampleIndex=0;
      for (      Pair<String,ArrayList<Integer>> groupPair : groupList) {
        ArrayList<Integer> group=groupPair.getSecond();
        sortedIDs.addAll(group);
        clusterSizes.add(group.size());
        clusterNames.add(groupPair.getFirst());
        sampleElements.add(sampleIndex);
        sampleIndex+=group.size();
      }
      PerspectiveInitializationData data=new PerspectiveInitializationData();
      data.setData(sortedIDs,clusterSizes,sampleElements,clusterNames);
      String groupLabel=listOfGroupNames.get(groupListCount);
      if (groupLabel.equals(DEFAULT_GROUP_NAME)) {
        if (groupingSpecifications.getGroupingName() != null) {
          groupLabel=clusterSizes.size() + "String_Node_Str" + groupingSpecifications.getGroupingName();
        }
 else {
          groupLabel=clusterSizes.size() + "String_Node_Str";
        }
      }
      data.setLabel(groupLabel);
      perspectiveInitializationDatas.add(data);
    }
    return perspectiveInitializationDatas;
  }
 catch (  IOException ioException) {
    throw new IllegalStateException("String_Node_Str" + groupingSpecifications.getDataSourcePath());
  }
}