Program: 9675
Project: 9675
Buggy source:
private void buildSPARQLQueryString(QueryTree<N> tree,List<QueryTreeChange> changes,StringBuilder triples,List<String> filters){
  Object subject=null;
  if (tree.getUserObject().equals("String_Node_Str")) {
    subject="String_Node_Str" + tree.getId();
  }
 else {
    subject="String_Node_Str" + tree.getUserObject() + "String_Node_Str";
  }
  Object predicate;
  Object object;
  if (!tree.isLeaf()) {
    for (    QueryTree<N> child : tree.getChildren()) {
      predicate=tree.getEdge(child);
      object=child.getUserObject();
      boolean objectIsResource=!object.equals("String_Node_Str");
      boolean addFilter=false;
      boolean removed=false;
      String uri=null;
      if (!objectIsResource) {
        object="String_Node_Str" + child.getId();
      }
 else       if (((String)object).startsWith("String_Node_Str")) {
        QueryTreeChange c=getChange(changes,child.getId());
        if (c != null) {
          if (c.getType() == ChangeType.REPLACE_LABEL) {
            uri=(String)object;
            child.setUserObject((N)"String_Node_Str");
            object="String_Node_Str" + child.getId();
            addFilter=true;
          }
 else {
            removed=true;
            triples.append("String_Node_Str").append(subject).append("String_Node_Str").append(predicate).append("String_Node_Str").append("String_Node_Str").append(child.getId()).append("String_Node_Str");
            filters.add("String_Node_Str" + child.getId() + "String_Node_Str");
            child.getParent().removeChild((QueryTreeImpl<N>)child);
          }
        }
 else {
          object="String_Node_Str" + object + "String_Node_Str";
        }
      }
      if (!removed) {
        triples.append(subject).append("String_Node_Str").append(predicate).append("String_Node_Str").append(object).append("String_Node_Str");
      }
      if (addFilter) {
        filters.add("String_Node_Str" + child.getId() + "String_Node_Str"+ uri+ "String_Node_Str");
      }
      if (!objectIsResource) {
        buildSPARQLQueryString(child,changes,triples,filters);
      }
    }
  }
}

Fixed version (ground truth):
private void buildSPARQLQueryString(QueryTree<N> tree,List<QueryTreeChange> changes,StringBuilder triples,List<String> filters){
  Object subject=null;
  if (tree.getUserObject().equals("String_Node_Str")) {
    subject="String_Node_Str" + tree.getId();
  }
 else {
    subject="String_Node_Str" + tree.getUserObject() + "String_Node_Str";
  }
  Object predicate;
  Object object;
  if (!tree.isLeaf()) {
    for (    QueryTree<N> child : tree.getChildren()) {
      predicate=tree.getEdge(child);
      object=child.getUserObject();
      boolean addFilter=false;
      boolean removed=false;
      String uri=null;
      QueryTreeChange c=getChange(changes,child.getId());
      if (c != null) {
        if (c.getType() == ChangeType.REPLACE_LABEL) {
          uri=(String)object;
          filters.add("String_Node_Str" + child.getId() + "String_Node_Str"+ uri+ "String_Node_Str");
          child.setUserObject((N)"String_Node_Str");
          object="String_Node_Str" + child.getId();
        }
 else {
          removed=true;
          triples.append("String_Node_Str").append(subject).append("String_Node_Str").append(predicate).append("String_Node_Str").append("String_Node_Str").append(child.getId()).append("String_Node_Str");
          filters.add("String_Node_Str" + child.getId() + "String_Node_Str");
          child.getParent().removeChild((QueryTreeImpl<N>)child);
        }
      }
      if (((String)object).startsWith("String_Node_Str")) {
        object="String_Node_Str" + object + "String_Node_Str";
      }
      boolean objectIsResource=!child.getUserObject().equals("String_Node_Str");
      if (!removed) {
        triples.append(subject).append("String_Node_Str").append(predicate).append("String_Node_Str").append(object).append("String_Node_Str");
      }
      if (!objectIsResource) {
        buildSPARQLQueryString(child,changes,triples,filters);
      }
    }
  }
}