Program: 86081
Project: 86081
Buggy source:
private void generateInstanceStream(PartUsageLink usageLink,double tx,double ty,double tz,double rx,double ry,double rz,List<Integer> filteredPath) throws JAXBException, IOException {
  PartMaster pm=usageLink.getComponent();
  PartRevision partR=pm.getLastRevision();
  PartIteration partI=partR.getLastIteration();
  String partIterationId=new StringBuilder().append(pm.getNumber()).append("String_Node_Str").append(partR.getVersion()).append("String_Node_Str").append(partI.getIteration()).toString();
  List<GeometryDTO> files=new ArrayList<GeometryDTO>();
  List<InstanceAttributeDTO> attributes=new ArrayList<InstanceAttributeDTO>();
  for (  Geometry geometry : partI.getGeometries()) {
    files.add(mapper.map(geometry,GeometryDTO.class));
  }
  for (  InstanceAttribute attr : partI.getInstanceAttributes().values()) {
    attributes.add(mapper.map(attr,InstanceAttributeDTO.class));
  }
  for (  CADInstance instance : usageLink.getCadInstances()) {
    double atx=tx + getRelativeTxAfterParentRotation(rx,ry,rz,instance.getTx(),instance.getTy(),instance.getTz());
    double aty=ty + getRelativeTyAfterParentRotation(rx,ry,rz,instance.getTx(),instance.getTy(),instance.getTz());
    double atz=tz + getRelativeTzAfterParentRotation(rx,ry,rz,instance.getTx(),instance.getTy(),instance.getTz());
    double arx=rx + instance.getRx();
    double ary=ry + instance.getRy();
    double arz=rz + instance.getRz();
    if (partI.getGeometries().size() > 0 && filteredPath.isEmpty()) {
      if (addComma)       this.entityStream.write(comma);
      this.marshaller.marshallToJSON(new InstanceDTO(partIterationId,atx,aty,atz,arx,ary,arz,files,attributes),entityStream);
      addComma=true;
    }
 else {
      for (      PartUsageLink component : partI.getComponents()) {
        if (filteredPath.isEmpty()) {
          generateInstanceStream(component,atx,aty,atz,arx,ary,arz,filteredPath);
        }
 else         if (component.getId() == filteredPath.get(0)) {
          ArrayList<Integer> copyWithoutCurrentId=new ArrayList<Integer>(filteredPath);
          copyWithoutCurrentId.remove(0);
          generateInstanceStream(component,atx,aty,atz,arx,ary,arz,copyWithoutCurrentId);
        }
      }
    }
  }
}

Fixed version (ground truth):
private void generateInstanceStream(PartUsageLink usageLink,double tx,double ty,double tz,double rx,double ry,double rz,List<Integer> filteredPath) throws JAXBException, IOException {
  PartMaster pm=usageLink.getComponent();
  PartRevision partR=pm.getLastRevision();
  PartIteration partI=partR.getLastIteration();
  String partIterationId=new StringBuilder().append(pm.getNumber()).append("String_Node_Str").append(partR.getVersion()).append("String_Node_Str").append(partI.getIteration()).toString();
  List<GeometryDTO> files=new ArrayList<GeometryDTO>();
  List<InstanceAttributeDTO> attributes=new ArrayList<InstanceAttributeDTO>();
  for (  Geometry geometry : partI.getGeometries()) {
    files.add(mapper.map(geometry,GeometryDTO.class));
  }
  for (  InstanceAttribute attr : partI.getInstanceAttributes().values()) {
    attributes.add(mapper.map(attr,InstanceAttributeDTO.class));
  }
  for (  CADInstance instance : usageLink.getCadInstances()) {
    double atx=tx + getRelativeTxAfterParentRotation(rx,ry,rz,instance.getTx(),instance.getTy(),instance.getTz());
    double aty=ty + getRelativeTyAfterParentRotation(rx,ry,rz,instance.getTx(),instance.getTy(),instance.getTz());
    double atz=tz + getRelativeTzAfterParentRotation(rx,ry,rz,instance.getTx(),instance.getTy(),instance.getTz());
    double arx=rx + instance.getRx();
    double ary=ry + instance.getRy();
    double arz=rz + instance.getRz();
    if (partI.getGeometries().size() > 0 && filteredPath.isEmpty()) {
      if (getAddComma())       getEntityStream().write(getComma());
      getMarshaller().marshallToJSON(new InstanceDTO(partIterationId,atx,aty,atz,arx,ary,arz,files,attributes),getEntityStream());
      setAddComma(true);
    }
 else {
      for (      PartUsageLink component : partI.getComponents()) {
        if (filteredPath.isEmpty()) {
          generateInstanceStream(component,atx,aty,atz,arx,ary,arz,filteredPath);
        }
 else         if (component.getId() == filteredPath.get(0)) {
          ArrayList<Integer> copyWithoutCurrentId=new ArrayList<Integer>(filteredPath);
          copyWithoutCurrentId.remove(0);
          generateInstanceStream(component,atx,aty,atz,arx,ary,arz,copyWithoutCurrentId);
        }
      }
    }
  }
}