Program: 73428
Project: 73428
Buggy source:
/** 
 * Compute the down-set of an element in this concept graph. This is implemented by deferring to the downSet functions of the component graphs and then enumerating all the product results.
 * @param e An Object representing a ProductLatticeConcept in thisconcept graph.
 * @return An array of ProductLatticeConcepts of the down-set ofthe given argument concept.
 * @exception IllegalArgumentException If the passed object is not a ProductLatticeConcept or does not belong to this CPO.
 */
public ProductLatticeConcept[] downSet(Object e){
  _validateInputArguments(e,e);
  ProductLatticeConcept productConcept=(ProductLatticeConcept)e;
  List<List<Concept>> downSets=new ArrayList<List<Concept>>();
  for (  Concept c : productConcept.getConceptTuple()) {
    ConceptGraph cg=c.getOntology().getConceptGraph();
    List<Concept> downSet=Arrays.asList(cg.downSet(c));
    downSets.add(downSet);
  }
  List<List<Concept>> productLatticeConcepts=new ArrayList<List<Concept>>();
  productLatticeConcepts.add(new ArrayList<Concept>());
  for (  List<Concept> concepts : downSets) {
    List<List<Concept>> oldLayer=productLatticeConcepts;
    productLatticeConcepts=new ArrayList<List<Concept>>();
    for (    Concept c : concepts) {
      for (      List<Concept> intermediateResult : oldLayer) {
        List<Concept> newLayer=new ArrayList<Concept>(intermediateResult);
        newLayer.add(c);
        productLatticeConcepts.add(newLayer);
      }
    }
  }
  List<ProductLatticeConcept> result=new ArrayList<ProductLatticeConcept>();
  for (  List<Concept> pc : productLatticeConcepts) {
    try {
      result.add(_productOntology.getProductLatticeConceptFromTuple(pc));
    }
 catch (    IllegalActionException ex) {
      throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str" + "String_Node_Str" + e + "String_Node_Str"+ this,ex);
    }
  }
  return result.toArray(new ProductLatticeConcept[0]);
}

Fixed version (ground truth):
/** 
 * Compute the down-set of an element in this concept graph. This is implemented by deferring to the downSet functions of the component graphs and then enumerating all the product results.
 * @param e An Object representing a ProductLatticeConcept in thisconcept graph.
 * @return An array of ProductLatticeConcepts of the down-set ofthe given argument concept.
 * @exception IllegalArgumentException If the passed object is not a ProductLatticeConcept or does not belong to this CPO.
 */
public ProductLatticeConcept[] downSet(Object e){
  _validateInputArguments(e,e);
  ProductLatticeConcept productConcept=(ProductLatticeConcept)e;
  List<List<Concept>> downSets=new ArrayList<List<Concept>>();
  for (  Concept c : productConcept.getConceptTuple()) {
    ConceptGraph cg=c.getOntology().getConceptGraph();
    List<Concept> downSet=Arrays.asList(cg.downSet(c));
    downSets.add(downSet);
  }
  List<List<Concept>> productLatticeConcepts=new ArrayList<List<Concept>>();
  productLatticeConcepts.add(new ArrayList<Concept>());
  for (  List<Concept> concepts : downSets) {
    List<List<Concept>> oldLayer=productLatticeConcepts;
    productLatticeConcepts=new ArrayList<List<Concept>>();
    for (    Concept c : concepts) {
      for (      List<Concept> intermediateResult : oldLayer) {
        List<Concept> newLayer=new ArrayList<Concept>(intermediateResult);
        newLayer.add(c);
        productLatticeConcepts.add(newLayer);
      }
    }
  }
  List<ProductLatticeConcept> result=new ArrayList<ProductLatticeConcept>();
  for (  List<Concept> pc : productLatticeConcepts) {
    try {
      result.add(_productOntology.getProductLatticeConceptFromTuple(pc));
    }
 catch (    IllegalActionException ex) {
      throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str" + "String_Node_Str" + e + "String_Node_Str"+ this,ex);
    }
  }
  return result.toArray(new ProductLatticeConcept[result.size()]);
}