Program: 9521
Project: 9521
Buggy source:
/** 
 * Creates Queries
 * @param t
 * @return
 */
public static ArrayList<QueryPair> returnSetOfQueries(Template t,String type){
  ArrayList<QueryPair> queryList=new ArrayList<QueryPair>();
  String condition="String_Node_Str";
  for (  ArrayList<String> conditionList : t.getCondition()) {
    for (    String s : conditionList)     condition+=s + "String_Node_Str";
    condition+="String_Node_Str";
  }
  ArrayList<ArrayList<Hypothesis>> givenHypothesenList=new ArrayList<ArrayList<Hypothesis>>();
  if (type.contains("String_Node_Str")) {
    givenHypothesenList=t.getHypothesenLevensthein();
  }
 else {
    givenHypothesenList=t.getHypothesen();
  }
  for (  ArrayList<Hypothesis> hypothesenList : givenHypothesenList) {
    String condition_new=condition;
    double global_rank=0;
    boolean addQuery=true;
    for (    Hypothesis h : hypothesenList) {
      condition_new=condition_new.replace(h.getVariable(),"String_Node_Str" + h.getUri() + "String_Node_Str");
      if (!h.getUri().contains("String_Node_Str")) {
        addQuery=false;
      }
      condition_new=condition_new.replace("String_Node_Str","String_Node_Str");
      global_rank=global_rank + h.getRank();
    }
    String query="String_Node_Str" + t.getQueryType() + "String_Node_Str"+ t.getSelectTerm()+ "String_Node_Str"+ condition_new+ "String_Node_Str"+ t.getFilter()+ "String_Node_Str"+ t.getOrderBy()+ "String_Node_Str"+ t.getHaving()+ "String_Node_Str"+ t.getLimit();
    QueryPair qp=new QueryPair(query,global_rank);
    if (addQuery)     queryList.add(qp);
  }
  return queryList;
}

Fixed version (ground truth):
/** 
 * Creates Queries
 * @param t
 * @return
 */
public static ArrayList<QueryPair> returnSetOfQueries(Template t,String type){
  ArrayList<QueryPair> queryList=new ArrayList<QueryPair>();
  String condition="String_Node_Str";
  for (  ArrayList<String> conditionList : t.getCondition()) {
    for (    String s : conditionList)     condition+=s + "String_Node_Str";
    condition+="String_Node_Str";
  }
  ArrayList<ArrayList<Hypothesis>> givenHypothesenList=new ArrayList<ArrayList<Hypothesis>>();
  if (type.contains("String_Node_Str")) {
    givenHypothesenList=t.getHypothesenLevensthein();
  }
 else   if (type.contains("String_Node_Str")) {
    givenHypothesenList=t.getHypothesenWordnet();
  }
 else {
    if (!type.contains("String_Node_Str"))     System.err.println("String_Node_Str" + type + "String_Node_Str");
    givenHypothesenList=t.getHypothesen();
  }
  for (  ArrayList<Hypothesis> hypothesenList : givenHypothesenList) {
    String condition_new=condition;
    double global_rank=0;
    boolean addQuery=true;
    for (    Hypothesis h : hypothesenList) {
      condition_new=condition_new.replace(h.getVariable(),"String_Node_Str" + h.getUri() + "String_Node_Str");
      if (!h.getUri().contains("String_Node_Str")) {
        addQuery=false;
      }
      condition_new=condition_new.replace("String_Node_Str","String_Node_Str");
      condition_new=condition_new.replace("String_Node_Str","String_Node_Str");
      global_rank=global_rank + h.getRank();
    }
    String query="String_Node_Str" + t.getQueryType() + "String_Node_Str"+ t.getSelectTerm()+ "String_Node_Str"+ condition_new+ "String_Node_Str"+ t.getFilter()+ "String_Node_Str"+ t.getOrderBy()+ "String_Node_Str"+ t.getHaving()+ "String_Node_Str"+ t.getLimit();
    QueryPair qp=new QueryPair(query,global_rank);
    if (addQuery)     queryList.add(qp);
  }
  return queryList;
}