Program: 9601
Project: 9601
Buggy source:
public Query(Query query){
  Set<SPARQL_Term> selTerms=new HashSet<SPARQL_Term>();
  for (  SPARQL_Term term : query.getSelTerms()) {
    SPARQL_Term newTerm=new SPARQL_Term(term.getName());
    newTerm.setIsVariable(term.isVariable());
    newTerm.setAggregate(term.getAggregate());
    newTerm.setOrderBy(term.getOrderBy());
    selTerms.add(newTerm);
  }
  this.selTerms=selTerms;
  Set<SPARQL_Prefix> prefixes=new HashSet<SPARQL_Prefix>();
  for (  SPARQL_Prefix prefix : query.getPrefixes()) {
    SPARQL_Prefix newPrefix=new SPARQL_Prefix(prefix.getName(),prefix.getUrl());
    prefixes.add(newPrefix);
  }
  this.prefixes=prefixes;
  Set<SPARQL_Triple> conditions=new HashSet<SPARQL_Triple>();
  for (  SPARQL_Triple condition : query.getConditions()) {
    SPARQL_Term variable=new SPARQL_Term(condition.getVariable().getName());
    variable.setIsVariable(condition.getVariable().isVariable());
    variable.setIsURI(condition.getVariable().isURI);
    SPARQL_Property property=new SPARQL_Property(condition.getProperty().getName());
    property.setIsVariable(condition.getProperty().isVariable());
    property.setPrefix(condition.getProperty().getPrefix());
    SPARQL_Term value=new SPARQL_Term(condition.getValue().getName());
    if (condition.getValue() instanceof SPARQL_Term) {
      value.setIsURI(((SPARQL_Term)condition.getValue()).isURI);
    }
    value.setIsVariable(condition.getValue().isVariable());
    SPARQL_Triple newCondition=new SPARQL_Triple(variable,property,value);
    conditions.add(newCondition);
  }
  this.conditions=conditions;
  Set<SPARQL_Term> orderBy=new HashSet<SPARQL_Term>();
  for (  SPARQL_Term order : query.getOrderBy()) {
    SPARQL_Term newTerm=new SPARQL_Term(order.getName());
    newTerm.setIsVariable(order.isVariable());
    newTerm.setAggregate(order.getAggregate());
    newTerm.setOrderBy(order.getOrderBy());
    selTerms.add(newTerm);
  }
  Set<SPARQL_Filter> filters=new HashSet<SPARQL_Filter>();
  for (  SPARQL_Filter filter : query.getFilters()) {
    for (    SPARQL_Pair term : filter.getTerms()) {
    }
  }
  this.filter=filters;
  this.orderBy=orderBy;
  this.limit=query.getLimit();
  this.offset=query.getOffset();
}

Fixed version (ground truth):
public Query(Query query){
  Set<SPARQL_Term> selTerms=new HashSet<SPARQL_Term>();
  for (  SPARQL_Term term : query.getSelTerms()) {
    SPARQL_Term newTerm=new SPARQL_Term(term.getName());
    newTerm.setIsVariable(term.isVariable());
    newTerm.setIsURI(newTerm.isURI);
    newTerm.setAggregate(term.getAggregate());
    newTerm.setOrderBy(term.getOrderBy());
    selTerms.add(newTerm);
  }
  this.selTerms=selTerms;
  Set<SPARQL_Prefix> prefixes=new HashSet<SPARQL_Prefix>();
  for (  SPARQL_Prefix prefix : query.getPrefixes()) {
    SPARQL_Prefix newPrefix=new SPARQL_Prefix(prefix.getName(),prefix.getUrl());
    prefixes.add(newPrefix);
  }
  this.prefixes=prefixes;
  Set<SPARQL_Triple> conditions=new HashSet<SPARQL_Triple>();
  for (  SPARQL_Triple condition : query.getConditions()) {
    SPARQL_Term variable=new SPARQL_Term(condition.getVariable().getName());
    variable.setIsVariable(condition.getVariable().isVariable());
    variable.setIsURI(condition.getVariable().isURI);
    SPARQL_Property property=new SPARQL_Property(condition.getProperty().getName());
    property.setIsVariable(condition.getProperty().isVariable());
    property.setPrefix(condition.getProperty().getPrefix());
    SPARQL_Term value=new SPARQL_Term(condition.getValue().getName());
    if (condition.getValue() instanceof SPARQL_Term) {
      value.setIsURI(((SPARQL_Term)condition.getValue()).isURI);
    }
    value.setIsVariable(condition.getValue().isVariable());
    SPARQL_Triple newCondition=new SPARQL_Triple(variable,property,value);
    conditions.add(newCondition);
  }
  this.conditions=conditions;
  Set<SPARQL_Term> orderBy=new HashSet<SPARQL_Term>();
  for (  SPARQL_Term order : query.getOrderBy()) {
    SPARQL_Term newTerm=new SPARQL_Term(order.getName());
    newTerm.setIsVariable(order.isVariable());
    newTerm.setAggregate(order.getAggregate());
    newTerm.setOrderBy(order.getOrderBy());
    selTerms.add(newTerm);
  }
  Set<SPARQL_Filter> filters=new HashSet<SPARQL_Filter>();
  for (  SPARQL_Filter filter : query.getFilters()) {
    for (    SPARQL_Pair term : filter.getTerms()) {
    }
  }
  this.filter=filters;
  this.orderBy=orderBy;
  this.limit=query.getLimit();
  this.offset=query.getOffset();
}