Program: 121995
Project: 121995
Buggy source:
public List<String> checkNeededRoutines(List<String> possibleRoutines,String additionalString){
  List<String> routinesToAdd=new ArrayList<String>();
  XmlMapData xmlMapData=(XmlMapData)getExternalEmfData();
  for (  String routine : possibleRoutines) {
    List<OutputXmlTree> listOutput=xmlMapData.getOutputTrees();
    for (    OutputXmlTree outTable : listOutput) {
      List<OutputTreeNode> listOutEntry=(List<OutputTreeNode>)outTable.getNodes();
      if (listOutEntry != null && !listOutEntry.isEmpty()) {
        for (        OutputTreeNode outEntry : listOutEntry) {
          String expression=outEntry.getExpression();
          if (expression != null && !routinesToAdd.contains(routine) && expression.contains(routine + additionalString)) {
            routinesToAdd.add(routine);
          }
        }
      }
      String filter=outTable.getExpressionFilter();
      if (filter != null && !routinesToAdd.contains(routine) && filter.contains(routine + additionalString)) {
        routinesToAdd.add(routine);
      }
    }
    List<InputXmlTree> listInput=(List<InputXmlTree>)xmlMapData.getInputTrees();
    for (    InputXmlTree inputTable : listInput) {
      List<TreeNode> listInEntry=(List<TreeNode>)inputTable.getNodes();
      if (listInEntry != null && !listInEntry.isEmpty()) {
        for (        TreeNode inEntry : listInEntry) {
          String expression=inEntry.getExpression();
          if (expression != null && !routinesToAdd.contains(routine) && expression.contains(routine + additionalString)) {
            routinesToAdd.add(routine);
          }
        }
      }
      String filter=inputTable.getExpressionFilter();
      if (filter != null && !routinesToAdd.contains(routine) && filter.contains(routine + additionalString)) {
        routinesToAdd.add(routine);
      }
    }
    List<VarTable> listVar=(List<VarTable>)xmlMapData.getVarTables();
    for (    VarTable varTable : listVar) {
      List<VarNode> listVarEntry=(List<VarNode>)varTable.getNodes();
      if (listVarEntry != null && !listVarEntry.isEmpty()) {
        for (        VarNode varEntry : listVarEntry) {
          String expression=varEntry.getExpression();
          if (expression != null && !routinesToAdd.contains(routine) && expression.contains(routine + additionalString)) {
            routinesToAdd.add(routine);
          }
        }
      }
    }
  }
  return routinesToAdd;
}

Fixed version (ground truth):
@Override public List<String> checkNeededRoutines(List<String> possibleRoutines,String additionalString){
  List<String> routinesToAdd=new ArrayList<String>();
  XmlMapData xmlMapData=(XmlMapData)getExternalEmfData();
  for (  String routine : possibleRoutines) {
    List<OutputXmlTree> listOutput=xmlMapData.getOutputTrees();
    for (    OutputXmlTree outTable : listOutput) {
      List<OutputTreeNode> listOutEntry=outTable.getNodes();
      if (listOutEntry != null && !listOutEntry.isEmpty()) {
        for (        OutputTreeNode outEntry : listOutEntry) {
          String expression=outEntry.getExpression();
          if (expression != null && !routinesToAdd.contains(routine) && expression.contains(routine + additionalString)) {
            routinesToAdd.add(routine);
          }
        }
      }
      String filter=outTable.getExpressionFilter();
      if (filter != null && !routinesToAdd.contains(routine) && filter.contains(routine + additionalString)) {
        routinesToAdd.add(routine);
      }
    }
    List<InputXmlTree> listInput=xmlMapData.getInputTrees();
    for (    InputXmlTree inputTable : listInput) {
      List<TreeNode> listInEntry=inputTable.getNodes();
      if (listInEntry != null && !listInEntry.isEmpty()) {
        for (        TreeNode inEntry : listInEntry) {
          String expression=inEntry.getExpression();
          if (expression != null && !routinesToAdd.contains(routine) && expression.contains(routine + additionalString)) {
            routinesToAdd.add(routine);
          }
        }
      }
      String filter=inputTable.getExpressionFilter();
      if (filter != null && !routinesToAdd.contains(routine) && filter.contains(routine + additionalString)) {
        routinesToAdd.add(routine);
      }
    }
    List<VarTable> listVar=xmlMapData.getVarTables();
    for (    VarTable varTable : listVar) {
      List<VarNode> listVarEntry=varTable.getNodes();
      if (listVarEntry != null && !listVarEntry.isEmpty()) {
        for (        VarNode varEntry : listVarEntry) {
          String expression=varEntry.getExpression();
          if (expression != null && !routinesToAdd.contains(routine) && expression.contains(routine + additionalString)) {
            routinesToAdd.add(routine);
          }
        }
      }
    }
  }
  return routinesToAdd;
}