Program: 133328
Project: 133328
Buggy source:
/** 
 * Loads the Ports table from the INI file and returns the information as a DataComponent of Entry. Each of the ports specified the table are set as an entry. The number of ports in the table specify the number of Components that need to be loaded by the loadComponent() method.
 * @param it Iterator over the lines of the INI file as an ArrayList
 * @return A TableComponent of Entries representing the contents in theports table of the INI file.
 */
private TableComponent loadPortsData(Iterator<String> it){
  TableComponent portsTable=new TableComponent();
  portsTable.setName("String_Node_Str");
  portsTable.setDescription("String_Node_Str" + "String_Node_Str");
  portsTable.setId(currID);
  currID++;
  ArrayList<IEntry> entries=new ArrayList<IEntry>();
  IEntry portNameTemplate=makeIPSEntry();
  IEntry implementationTemplate=makeIPSEntry();
  portNameTemplate.setName("String_Node_Str");
  implementationTemplate.setName("String_Node_Str");
  entries.add(portNameTemplate);
  entries.add(implementationTemplate);
  portsTable.setRowTemplate(entries);
  if (!it.hasNext()) {
    System.err.println("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
    return null;
  }
  line=it.next();
  while (it.hasNext() && !line.contains("String_Node_Str")) {
    line=it.next();
  }
  if (!it.hasNext()) {
    System.err.println("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
    return null;
  }
  ArrayList<String> portNames=new ArrayList<String>(Arrays.asList(line.split("String_Node_Str")[1].split("String_Node_Str")));
  while (portNames.size() > 0 && it.hasNext()) {
    if (line.contains("String_Node_Str") && line.contains("String_Node_Str")) {
      if (line.contains("String_Node_Str")) {
        line=line.split("String_Node_Str",2)[0];
      }
      int rowID=portsTable.addRow();
      ArrayList<IEntry> row=portsTable.getRow(rowID);
      String portName=line.replaceAll("String_Node_Str","String_Node_Str");
      if (portNames.contains(portName)) {
        row.get(0).setValue(portName);
        line=it.next();
        if (line.contains("String_Node_Str")) {
          line=line.split("String_Node_Str",2)[0];
        }
        if (line.contains("String_Node_Str")) {
          String implementation=line.split("String_Node_Str",2)[1];
          row.get(1).setValue(implementation);
        }
 else {
          System.err.println("String_Node_Str" + "String_Node_Str");
          System.exit(1);
        }
        portNames.remove(portName);
      }
    }
    line=it.next();
  }
  if (!it.hasNext()) {
    System.err.println("String_Node_Str" + "String_Node_Str");
    return null;
  }
  return portsTable;
}

Fixed version (ground truth):
/** 
 * Loads the Ports table from the INI file and returns the information as a DataComponent of Entry. Each of the ports specified the table are set as an entry. The number of ports in the table specify the number of Components that need to be loaded by the loadComponent() method.
 * @param it Iterator over the lines of the INI file as an ArrayList
 * @return A TableComponent of Entries representing the contents in theports table of the INI file.
 */
private TableComponent loadPortsData(Iterator<String> it){
  TableComponent portsTable=new TableComponent();
  portsTable.setName("String_Node_Str");
  portsTable.setDescription("String_Node_Str" + "String_Node_Str");
  portsTable.setId(currID);
  currID++;
  ArrayList<IEntry> entries=new ArrayList<IEntry>();
  IEntry portNameTemplate=makeIPSEntry();
  IEntry implementationTemplate=makeIPSEntry();
  portNameTemplate.setName("String_Node_Str");
  implementationTemplate.setName("String_Node_Str");
  entries.add(portNameTemplate);
  entries.add(implementationTemplate);
  portsTable.setRowTemplate(entries);
  if (!it.hasNext()) {
    System.err.println("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
    return null;
  }
  line=it.next();
  while (it.hasNext() && !line.contains("String_Node_Str")) {
    line=it.next();
  }
  if (!it.hasNext()) {
    System.err.println("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
    return null;
  }
  ArrayList<String> portNames=new ArrayList<String>(Arrays.asList(line.split("String_Node_Str")[1].split("String_Node_Str")));
  while (portNames.size() > 0 && it.hasNext()) {
    if (line.contains("String_Node_Str") && line.contains("String_Node_Str")) {
      if (line.contains("String_Node_Str")) {
        line=line.split("String_Node_Str",2)[0];
        if (line.trim().length() == 0) {
          continue;
        }
      }
      int rowID=portsTable.addRow();
      ArrayList<IEntry> row=portsTable.getRow(rowID);
      String portName=line.replaceAll("String_Node_Str","String_Node_Str");
      if (portNames.contains(portName)) {
        row.get(0).setValue(portName);
        line=it.next();
        if (line.contains("String_Node_Str")) {
          line=line.split("String_Node_Str",2)[0];
        }
        if (line.contains("String_Node_Str")) {
          String implementation=line.split("String_Node_Str",2)[1];
          row.get(1).setValue(implementation);
        }
 else {
          System.err.println("String_Node_Str" + "String_Node_Str");
          System.exit(1);
        }
        portNames.remove(portName);
      }
    }
    line=it.next();
  }
  if (!it.hasNext()) {
    System.err.println("String_Node_Str" + "String_Node_Str");
    return null;
  }
  return portsTable;
}