nus-yam/ex-repair huggingface dataset:
Program: 107455
Project: 107455
Buggy source:
/** 
 * Creates a new volume in a pool in the specified zone
 * @param accountId
 * @param userId
 * @param name
 * @param dc
 * @param diskOffering
 * @param size
 * @return VolumeVO
 */
VolumeVO createVolume(long volumeId,HypervisorType hyperType);

Fixed version (ground truth):
/** 
 * Creates a new volume in a pool in the specified zone
 * @param accountId
 * @param userId
 * @param name
 * @param dc
 * @param diskOffering
 * @param size
 * @return VolumeVO
 */
public VolumeVO createVolume(VolumeVO volume,VMInstanceVO vm,VMTemplateVO template,DataCenterVO dc,HostPodVO pod,Long clusterId,ServiceOfferingVO offering,DiskOfferingVO diskOffering,List<StoragePoolVO> avoids,long size,HypervisorType hyperType);
Program: 107456
Project: 107456
Buggy source:
public void setState(State st){
  this.state=st;
}

Fixed version (ground truth):
public void setState(State state){
  this.state=state;
}
Program: 107465
Project: 107465
Buggy source:
@Override public String assignIpAddress(long accountId,long domainId,long vlanDbId,boolean sourceNat){
  Transaction txn=Transaction.currentTxn();
  try {
    txn.start();
    SearchCriteria<IPAddressVO> sc=VlanDbIdSearchUnallocated.create();
    sc.setParameters("String_Node_Str",vlanDbId);
    IPAddressVO ip=this.lock(sc,true);
    if (ip != null) {
      ip.setAccountId(accountId);
      ip.setAllocated(new Date());
      ip.setDomainId(domainId);
      ip.setSourceNat(sourceNat);
      if (!update(ip.getAddress(),ip)) {
        s_logger.debug("String_Node_Str");
        return null;
      }
      txn.commit();
      return ip.getAddress();
    }
 else {
      txn.rollback();
      s_logger.error("String_Node_Str" + vlanDbId);
    }
  }
 catch (  Exception e) {
    s_logger.warn("String_Node_Str",e);
  }
  return null;
}

Fixed version (ground truth):
@Override public String assignIpAddress(long accountId,long domainId,long vlanDbId,boolean sourceNat){
  Transaction txn=Transaction.currentTxn();
  try {
    txn.start();
    SearchCriteria<IPAddressVO> sc=VlanDbIdSearchUnallocated.create();
    sc.setParameters("String_Node_Str",vlanDbId);
    IPAddressVO ip=this.lock(sc,true);
    if (ip != null) {
      ip.setAccountId(accountId);
      ip.setAllocated(new Date());
      ip.setDomainId(domainId);
      ip.setSourceNat(sourceNat);
      if (!update(ip.getAddress(),ip)) {
        s_logger.debug("String_Node_Str");
        return null;
      }
      txn.commit();
      return ip.getAddress();
    }
 else {
      txn.rollback();
      s_logger.warn("String_Node_Str" + vlanDbId);
    }
  }
 catch (  Exception e) {
    s_logger.warn("String_Node_Str",e);
  }
  return null;
}
Program: 107468
Project: 107468
Buggy source:
public long getHostId(){
  return hostId;
}

Fixed version (ground truth):
public Long getHostId(){
  return hostId;
}
Program: 107469
Project: 107469
Buggy source:
public void setHostId(long hostId){
  this.hostId=hostId;
}

Fixed version (ground truth):
public void setHostId(Long hostId){
  this.hostId=hostId;
}
Program: 107471
Project: 107471
Buggy source:
public boolean execute(){
  Gson gson=GsonHelper.getBuilder().create();
  AsyncJobManager asyncMgr=getAsyncJobMgr();
  AsyncJobVO job=getJob();
  DeleteTemplateParam param=gson.fromJson(job.getCmdInfo(),DeleteTemplateParam.class);
  ManagementServer managementServer=asyncMgr.getExecutorContext().getManagementServer();
  try {
    boolean success=managementServer.deleteTemplate(param.getUserId(),param.getTemplateId(),param.getZoneId(),param.getEventId());
    if (success) {
      asyncMgr.completeAsyncJob(getJob().getId(),AsyncJobResult.STATUS_SUCCEEDED,0,null);
    }
 else {
      asyncMgr.completeAsyncJob(getJob().getId(),AsyncJobResult.STATUS_FAILED,BaseCmd.INTERNAL_ERROR,"String_Node_Str");
    }
  }
 catch (  Exception e) {
    s_logger.warn("String_Node_Str" + e.getMessage(),e);
    asyncMgr.completeAsyncJob(getJob().getId(),AsyncJobResult.STATUS_FAILED,BaseCmd.INTERNAL_ERROR,e.getMessage());
  }
  return true;
}

Fixed version (ground truth):
public boolean execute(){
  Gson gson=GsonHelper.getBuilder().create();
  AsyncJobManager asyncMgr=getAsyncJobMgr();
  AsyncJobVO job=getJob();
  DeleteTemplateParam param=gson.fromJson(job.getCmdInfo(),DeleteTemplateParam.class);
  ManagementServer managementServer=asyncMgr.getExecutorContext().getManagementServer();
  try {
    boolean success=managementServer.deleteTemplate(param.getUserId(),param.getTemplateId(),param.getZoneId(),param.getEventId());
    if (success) {
      asyncMgr.completeAsyncJob(getJob().getId(),AsyncJobResult.STATUS_SUCCEEDED,0,"String_Node_Str");
    }
 else {
      asyncMgr.completeAsyncJob(getJob().getId(),AsyncJobResult.STATUS_FAILED,BaseCmd.INTERNAL_ERROR,"String_Node_Str");
    }
  }
 catch (  Exception e) {
    s_logger.warn("String_Node_Str" + e.getMessage(),e);
    asyncMgr.completeAsyncJob(getJob().getId(),AsyncJobResult.STATUS_FAILED,BaseCmd.INTERNAL_ERROR,e.getMessage());
  }
  return true;
}
Program: 107472
Project: 107472
Buggy source:
protected Object[] getRRDData(int flag){
  String stats="String_Node_Str";
  try {
    if (flag == 1)     stats=getHostStatsRawXML();
    if (flag == 2)     stats=getVmStatsRawXML();
  }
 catch (  Exception e1) {
    s_logger.warn("String_Node_Str" + e1);
    return null;
  }
  if (stats == null)   return null;
  StringReader statsReader=new StringReader(stats);
  InputSource statsSource=new InputSource(statsReader);
  Document doc=null;
  try {
    doc=DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(statsSource);
  }
 catch (  Exception e) {
  }
  NodeList firstLevelChildren=doc.getChildNodes();
  NodeList secondLevelChildren=(firstLevelChildren.item(0)).getChildNodes();
  Node metaNode=secondLevelChildren.item(0);
  Node dataNode=secondLevelChildren.item(1);
  Integer numRows=0;
  Integer numColumns=0;
  Node legend=null;
  NodeList metaNodeChildren=metaNode.getChildNodes();
  for (int i=0; i < metaNodeChildren.getLength(); i++) {
    Node n=metaNodeChildren.item(i);
    if (n.getNodeName().equals("String_Node_Str")) {
      numRows=Integer.valueOf(getXMLNodeValue(n));
    }
 else     if (n.getNodeName().equals("String_Node_Str")) {
      numColumns=Integer.valueOf(getXMLNodeValue(n));
    }
 else     if (n.getNodeName().equals("String_Node_Str")) {
      legend=n;
    }
  }
  return new Object[]{numRows,numColumns,legend,dataNode};
}

Fixed version (ground truth):
protected Object[] getRRDData(int flag){
  String stats="String_Node_Str";
  try {
    if (flag == 1)     stats=getHostStatsRawXML();
    if (flag == 2)     stats=getVmStatsRawXML();
  }
 catch (  Exception e1) {
    s_logger.warn("String_Node_Str" + e1);
    return null;
  }
  if (stats == null)   return null;
  StringReader statsReader=new StringReader(stats);
  InputSource statsSource=new InputSource(statsReader);
  Document doc=null;
  try {
    doc=DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(statsSource);
  }
 catch (  Exception e) {
    s_logger.warn("String_Node_Str" + e);
    return null;
  }
  if (doc == null) {
    s_logger.warn("String_Node_Str");
    return null;
  }
  NodeList firstLevelChildren=doc.getChildNodes();
  NodeList secondLevelChildren=(firstLevelChildren.item(0)).getChildNodes();
  Node metaNode=secondLevelChildren.item(0);
  Node dataNode=secondLevelChildren.item(1);
  Integer numRows=0;
  Integer numColumns=0;
  Node legend=null;
  NodeList metaNodeChildren=metaNode.getChildNodes();
  for (int i=0; i < metaNodeChildren.getLength(); i++) {
    Node n=metaNodeChildren.item(i);
    if (n.getNodeName().equals("String_Node_Str")) {
      numRows=Integer.valueOf(getXMLNodeValue(n));
    }
 else     if (n.getNodeName().equals("String_Node_Str")) {
      numColumns=Integer.valueOf(getXMLNodeValue(n));
    }
 else     if (n.getNodeName().equals("String_Node_Str")) {
      legend=n;
    }
  }
  return new Object[]{numRows,numColumns,legend,dataNode};
}
Program: 107473
Project: 107473
Buggy source:
/** 
 * Create a disk offering
 * @param domainId the id of the domain in which the disk offering is valid
 * @param name the name of the disk offering
 * @param description a string description of the disk offering
 * @param numGibibytes the number of gibibytes in the disk offering (1 gibibyte = 1024 MB)
 * @param mirrored boolean value of whether or not the offering provides disk mirroring
 * @param tags Comma separated string to indicate special tags for the disk offering.
 * @return the created disk offering, null if failed to create
 */
DiskOfferingVO createDiskOffering(long userId,long domainId,String name,String description,int numGibibytes,String tags) throws InvalidParameterValueException ;

Fixed version (ground truth):
/** 
 * Create a disk offering
 * @param domainId the id of the domain in which the disk offering is valid
 * @param name the name of the disk offering
 * @param description a string description of the disk offering
 * @param numGibibytes the number of gibibytes in the disk offering (1 gibibyte = 1024 MB)
 * @param mirrored boolean value of whether or not the offering provides disk mirroring
 * @param tags Comma separated string to indicate special tags for the disk offering.
 * @return the created disk offering, null if failed to create
 * @throws InternalErrorException 
 */
DiskOfferingVO createDiskOffering(long userId,long domainId,String name,String description,int numGibibytes,String tags) throws InvalidParameterValueException, InternalErrorException ;
Program: 107475
Project: 107475
Buggy source:
@Override public List<Pair<String,Object>> execute(Map<String,Object> params){
  Long id=(Long)params.get(BaseCmd.Properties.ID.getName());
  Long userId=(Long)params.get(BaseCmd.Properties.USER_ID.getName());
  if (userId == null) {
    userId=Long.valueOf(User.UID_SYSTEM);
  }
  DiskOfferingVO disk=getManagementServer().findDiskOfferingById(id);
  if (disk == null) {
    throw new ServerApiException(BaseCmd.PARAM_ERROR,"String_Node_Str" + id);
  }
  if (disk.getName().equals("String_Node_Str") && disk.getDisplayText().equals("String_Node_Str")) {
    throw new ServerApiException(BaseCmd.INTERNAL_ERROR,"String_Node_Str");
  }
  boolean result=getManagementServer().deleteDiskOffering(userId,id);
  List<Pair<String,Object>> returnValues=new ArrayList<Pair<String,Object>>();
  returnValues.add(new Pair<String,Object>(BaseCmd.Properties.SUCCESS.getName(),Boolean.valueOf(result).toString()));
  return returnValues;
}

Fixed version (ground truth):
@Override public List<Pair<String,Object>> execute(Map<String,Object> params){
  Long id=(Long)params.get(BaseCmd.Properties.ID.getName());
  Long userId=(Long)params.get(BaseCmd.Properties.USER_ID.getName());
  if (userId == null) {
    userId=Long.valueOf(User.UID_SYSTEM);
  }
  DiskOfferingVO disk=getManagementServer().findDiskOfferingById(id);
  if (disk == null) {
    throw new ServerApiException(BaseCmd.PARAM_ERROR,"String_Node_Str" + id);
  }
  if (disk.getDiskSize() == 0) {
    throw new ServerApiException(BaseCmd.INTERNAL_ERROR,"String_Node_Str");
  }
  boolean result=getManagementServer().deleteDiskOffering(userId,id);
  List<Pair<String,Object>> returnValues=new ArrayList<Pair<String,Object>>();
  returnValues.add(new Pair<String,Object>(BaseCmd.Properties.SUCCESS.getName(),Boolean.valueOf(result).toString()));
  return returnValues;
}
Program: 107477
Project: 107477
Buggy source:
@Override public DiskOfferingVO createDiskOffering(long userId,long domainId,String name,String description,int numGibibytes,String tags) throws InvalidParameterValueException {
  if (numGibibytes != 0 && numGibibytes < 1) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
 else   if (numGibibytes > _maxVolumeSizeInTb) {
    throw new InvalidParameterValueException("String_Node_Str" + _maxVolumeSizeInTb + "String_Node_Str");
  }
  return _configMgr.createDiskOffering(userId,domainId,name,description,numGibibytes,tags);
}

Fixed version (ground truth):
@Override public DiskOfferingVO createDiskOffering(long userId,long domainId,String name,String description,int numGibibytes,String tags) throws InvalidParameterValueException, InternalErrorException {
  if (numGibibytes != 0 && numGibibytes < 1) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  if (numGibibytes > _maxVolumeSizeInGb) {
    throw new InvalidParameterValueException("String_Node_Str" + _maxVolumeSizeInGb + "String_Node_Str");
  }
  if (numGibibytes == 0) {
    List<DiskOfferingVO> existingOffering=_diskOfferingDao.findPrivateDiskOffering();
    if (existingOffering != null && existingOffering.size() > 0)     throw new InternalErrorException("String_Node_Str");
  }
  return _configMgr.createDiskOffering(userId,domainId,name,description,numGibibytes,tags);
}
Program: 107479
Project: 107479
Buggy source:
@Override public boolean validateCustomVolumeSizeRange(long size) throws InvalidParameterValueException {
  if (size < 0 || (size > 0 && size < 2097152)) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
 else   if (size > _maxVolumeSizeInTb) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean validateCustomVolumeSizeRange(long size) throws InvalidParameterValueException {
  if (size < 0 || (size > 0 && size < 2097152)) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
 else   if (size > (_maxVolumeSizeInGb * 1000000000)) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  return true;
}
Program: 107482
Project: 107482
Buggy source:
private String getLoginSuccessResponse(HttpSession session,String responseType){
  StringBuffer sb=new StringBuffer();
  int inactiveInterval=session.getMaxInactiveInterval();
  if (BaseCmd.RESPONSE_TYPE_JSON.equalsIgnoreCase(responseType)) {
    sb.append("String_Node_Str");
    Enumeration attrNames=session.getAttributeNames();
    if (attrNames != null) {
      sb.append("String_Node_Str" + inactiveInterval + "String_Node_Str");
      while (attrNames.hasMoreElements()) {
        String attrName=(String)attrNames.nextElement();
        Object attrObj=session.getAttribute(attrName);
        if (attrObj instanceof String) {
          sb.append("String_Node_Str" + attrName + "String_Node_Str"+ (String)attrObj+ "String_Node_Str");
        }
      }
    }
    sb.append("String_Node_Str");
  }
 else {
    sb.append("String_Node_Str");
    sb.append("String_Node_Str" + inactiveInterval + "String_Node_Str");
    Enumeration attrNames=session.getAttributeNames();
    if (attrNames != null) {
      while (attrNames.hasMoreElements()) {
        String attrName=(String)attrNames.nextElement();
        String attr=(String)session.getAttribute(attrName);
        sb.append("String_Node_Str" + attrName + "String_Node_Str"+ attr+ "String_Node_Str"+ attrName+ "String_Node_Str");
      }
    }
    sb.append("String_Node_Str");
  }
  return sb.toString();
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private String getLoginSuccessResponse(HttpSession session,String responseType){
  StringBuffer sb=new StringBuffer();
  int inactiveInterval=session.getMaxInactiveInterval();
  if (BaseCmd.RESPONSE_TYPE_JSON.equalsIgnoreCase(responseType)) {
    sb.append("String_Node_Str");
    Enumeration attrNames=session.getAttributeNames();
    if (attrNames != null) {
      sb.append("String_Node_Str" + inactiveInterval + "String_Node_Str");
      while (attrNames.hasMoreElements()) {
        String attrName=(String)attrNames.nextElement();
        Object attrObj=session.getAttribute(attrName);
        if (attrObj instanceof String) {
          sb.append("String_Node_Str" + attrName + "String_Node_Str"+ (String)attrObj+ "String_Node_Str");
        }
      }
    }
    sb.append("String_Node_Str");
  }
 else {
    sb.append("String_Node_Str");
    sb.append("String_Node_Str" + inactiveInterval + "String_Node_Str");
    Enumeration attrNames=session.getAttributeNames();
    if (attrNames != null) {
      while (attrNames.hasMoreElements()) {
        String attrName=(String)attrNames.nextElement();
        String attr=(String)session.getAttribute(attrName);
        sb.append("String_Node_Str" + attrName + "String_Node_Str"+ attr+ "String_Node_Str"+ attrName+ "String_Node_Str");
      }
    }
    sb.append("String_Node_Str");
  }
  return sb.toString();
}
Program: 107484
Project: 107484
Buggy source:
@Override public String getResponse(){
  VolumeVO volume=(VolumeVO)getResponseObject();
  VolumeResponse response=new VolumeResponse();
  response.setId(volume.getId());
  response.setName(param.getName());
  response.setVolumeType(volume.getVolumeType().toString());
  response.setSize(volume.getSize());
  response.setCreated(volume.getCreated());
  response.setState(volume.getStatus().toString());
  response.setAccountName(ggetManagementServer().findAccountById(volume.getAccountId()).getAccountName());
  response.setDomainId(volume.getDomainId());
  response.setDiskOfferingId(volume.getDiskOfferingId());
  if (volume.getDiskOfferingId() != null) {
    response.setDiskOfferingName(getManagementServer().findDiskOfferingById(volume.getDiskOfferingId()).getName());
    response.setDiskOfferingDisplayText(getManagementServer().findDiskOfferingById(volume.getDiskOfferingId()).getDisplayText());
  }
  response.setDomain(getManagementServer().findDomainIdById(volume.getDomainId()).getName());
  response.setStorageType("String_Node_Str");
  if (volume.getPoolId() != null)   response.setStorage(getManagementServer().findPoolById(volume.getPoolId()).getName());
  response.setZoneId(volume.getDataCenterId());
  response.setZoneName(getManagementServer().getDataCenterBy(volume.getDataCenterId()).getName());
  return SerializerHelper.toSerializedString(response);
}

Fixed version (ground truth):
@Override public String getResponse(){
  VolumeVO volume=(VolumeVO)getResponseObject();
  VolumeResponse response=new VolumeResponse();
  response.setId(volume.getId());
  response.setName(volume.getName());
  response.setVolumeType(volume.getVolumeType().toString());
  response.setSize(volume.getSize());
  response.setCreated(volume.getCreated());
  response.setState(volume.getStatus().toString());
  response.setAccountName(ggetManagementServer().findAccountById(volume.getAccountId()).getAccountName());
  response.setDomainId(volume.getDomainId());
  response.setDiskOfferingId(volume.getDiskOfferingId());
  if (volume.getDiskOfferingId() != null) {
    response.setDiskOfferingName(getManagementServer().findDiskOfferingById(volume.getDiskOfferingId()).getName());
    response.setDiskOfferingDisplayText(getManagementServer().findDiskOfferingById(volume.getDiskOfferingId()).getDisplayText());
  }
  response.setDomain(getManagementServer().findDomainIdById(volume.getDomainId()).getName());
  response.setStorageType("String_Node_Str");
  if (volume.getPoolId() != null)   response.setStorage(getManagementServer().findPoolById(volume.getPoolId()).getName());
  response.setZoneId(volume.getDataCenterId());
  response.setZoneName(getManagementServer().getDataCenterBy(volume.getDataCenterId()).getName());
  return SerializerHelper.toSerializedString(response);
}
Program: 107485
Project: 107485
Buggy source:
private ImageFormat getImageFormat(Long volumeId){
  ImageFormat format=null;
  VolumeVO volume=_volsDao.findById(volumeId);
  Long templateId=volume.getTemplateId();
  if (templateId != null) {
    VMTemplateVO template=_templateDao.findById(templateId);
    format=template.getFormat();
  }
  return format;
}

Fixed version (ground truth):
@Override public ImageFormat getImageFormat(Long volumeId){
  ImageFormat format=null;
  VolumeVO volume=_volsDao.findById(volumeId);
  Long templateId=volume.getTemplateId();
  if (templateId != null) {
    VMTemplateVO template=_templateDao.findById(templateId);
    format=template.getFormat();
  }
  return format;
}
Program: 107490
Project: 107490
Buggy source:
protected AgentAttache handleDirectConnect(ServerResource resource,StartupCommand[] startup,Map<String,String> details,boolean old){
  if (startup == null) {
    return null;
  }
  HostVO server=createHost(startup,resource,details,old);
  if (server == null) {
    return null;
  }
  long id=server.getId();
  AgentAttache attache=createAttache(id,server,resource);
  if (!resource.IsRemoteAgent())   notifyMonitorsOfConnection(attache,startup);
  return attache;
}

Fixed version (ground truth):
protected AgentAttache handleDirectConnect(ServerResource resource,StartupCommand[] startup,Map<String,String> details,boolean old){
  if (startup == null) {
    return null;
  }
  HostVO server=createHost(startup,resource,details,old);
  if (server == null) {
    return null;
  }
  long id=server.getId();
  AgentAttache attache=createAttache(id,server,resource);
  if (!resource.IsRemoteAgent())   notifyMonitorsOfConnection(attache,startup);
 else {
    _hostDao.updateStatus(server,Event.AgentConnected,_nodeId);
  }
  return attache;
}
Program: 107494
Project: 107494
Buggy source:
private List<interfaceDef> createRouterVMNetworks(StartRouterCommand cmd) throws InternalErrorException {
  List<interfaceDef> nics=new ArrayList<interfaceDef>();
  DomainRouter router=cmd.getRouter();
  String guestMac=router.getGuestMacAddress();
  String privateMac=router.getPrivateMacAddress();
  String pubMac=router.getPublicMacAddress();
  String brName;
  interfaceDef pubNic=new interfaceDef();
  interfaceDef privNic=new interfaceDef();
  interfaceDef vnetNic=new interfaceDef();
  if ("String_Node_Str".equalsIgnoreCase(router.getVnet())) {
    vnetNic.defBridgeNet(_privBridgeName,null,guestMac,interfaceDef.nicModel.VIRTIO);
  }
 else {
    String vnetId=getVnetId(router.getVnet());
    brName=setVnetBrName(vnetId);
    String vnetDev="String_Node_Str" + vnetId;
    createVnet(vnetId,_pifs.first());
    vnetNic.defBridgeNet(brName,vnetDev,guestMac,interfaceDef.nicModel.VIRTIO);
  }
  nics.add(vnetNic);
  privNic.defPrivateNet(_privNwName,null,privateMac,interfaceDef.nicModel.VIRTIO);
  nics.add(privNic);
  if ("String_Node_Str".equalsIgnoreCase(router.getVlanId())) {
    pubNic.defBridgeNet(_publicBridgeName,null,pubMac,interfaceDef.nicModel.VIRTIO);
  }
 else {
    String vnetId=getVnetId(router.getVlanId());
    brName=setVnetBrName(vnetId);
    String vnetDev="String_Node_Str" + vnetId;
    createVnet(vnetId,_pifs.second());
    pubNic.defBridgeNet(brName,vnetDev,pubMac,interfaceDef.nicModel.VIRTIO);
  }
  nics.add(pubNic);
  return nics;
}

Fixed version (ground truth):
private List<interfaceDef> createRouterVMNetworks(StartRouterCommand cmd) throws InternalErrorException {
  List<interfaceDef> nics=new ArrayList<interfaceDef>();
  DomainRouter router=cmd.getRouter();
  String guestMac=router.getGuestMacAddress();
  String privateMac=router.getPrivateMacAddress();
  String pubMac=router.getPublicMacAddress();
  String brName;
  interfaceDef pubNic=new interfaceDef();
  interfaceDef privNic=new interfaceDef();
  interfaceDef vnetNic=new interfaceDef();
  if ("String_Node_Str".equalsIgnoreCase(router.getVnet())) {
    vnetNic.defBridgeNet(_privBridgeName,null,guestMac,interfaceDef.nicModel.VIRTIO);
  }
 else {
    String vnetId=getVnetId(router.getVnet());
    brName=setVnetBrName(vnetId);
    String vnetDev="String_Node_Str" + vnetId;
    createVnet(vnetId,_pifs.first());
    vnetNic.defBridgeNet(brName,null,guestMac,interfaceDef.nicModel.VIRTIO);
  }
  nics.add(vnetNic);
  privNic.defPrivateNet(_privNwName,null,privateMac,interfaceDef.nicModel.VIRTIO);
  nics.add(privNic);
  if ("String_Node_Str".equalsIgnoreCase(router.getVlanId())) {
    pubNic.defBridgeNet(_publicBridgeName,null,pubMac,interfaceDef.nicModel.VIRTIO);
  }
 else {
    String vnetId=getVnetId(router.getVlanId());
    brName=setVnetBrName(vnetId);
    String vnetDev="String_Node_Str" + vnetId;
    createVnet(vnetId,_pifs.second());
    pubNic.defBridgeNet(brName,null,pubMac,interfaceDef.nicModel.VIRTIO);
  }
  nics.add(pubNic);
  return nics;
}
Program: 107499
Project: 107499
Buggy source:
@Override public void onReceiveBitrateChanged(Collection<Integer> ssrcs,long bitrate){
  VideoMediaStreamImpl.this.remoteBitrateEstimatorOnReceiveBitrateChanged(ssrcs,bitrate);
}

Fixed version (ground truth):
@Override public void onReceiveBitrateChanged(Collection<Long> ssrcs,long bitrate){
  VideoMediaStreamImpl.this.remoteBitrateEstimatorOnReceiveBitrateChanged(ssrcs,bitrate);
}
Program: 107500
Project: 107500
Buggy source:
/** 
 * Notifies this <tt>VideoMediaStreamImpl</tt> that  {@link #remoteBitrateEstimator} has computed a new bitrate estimate forthe incoming streams.
 * @param ssrcs
 * @param bitrate
 */
private void remoteBitrateEstimatorOnReceiveBitrateChanged(Collection<Integer> ssrcs,long bitrate){
}

Fixed version (ground truth):
/** 
 * Notifies this <tt>VideoMediaStreamImpl</tt> that  {@link #remoteBitrateEstimator} has computed a new bitrate estimate forthe incoming streams.
 * @param ssrcs
 * @param bitrate
 */
private void remoteBitrateEstimatorOnReceiveBitrateChanged(Collection<Long> ssrcs,long bitrate){
}
Program: 107501
Project: 107501
Buggy source:
/** 
 * Makes an <tt>RTCPREMBPacket</tt> that provides receiver feedback to the endpoint from which we receive.
 * @return an <tt>RTCPREMBPacket</tt> that provides receiver feedback to theendpoint from which we receive.
 */
private RTCPREMBPacket makeREMB(long senderSSRC){
  RemoteBitrateEstimator remoteBitrateEstimator=stream.getRemoteBitrateEstimator();
  Collection<Integer> ssrcs=remoteBitrateEstimator.getSsrcs();
  long[] dest=new long[ssrcs.size()];
  int i=0;
  for (  Integer ssrc : ssrcs)   dest[i++]=ssrc & 0xFFFFFFFFL;
  long bitrate=remoteBitrateEstimator.getLatestEstimate();
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + bitrate + "String_Node_Str"+ Arrays.toString(dest)+ "String_Node_Str"+ System.currentTimeMillis());
  }
  if (bitrate == -1) {
    return null;
  }
 else {
    return new RTCPREMBPacket(senderSSRC,0L,bitrate,dest);
  }
}

Fixed version (ground truth):
/** 
 * Makes an <tt>RTCPREMBPacket</tt> that provides receiver feedback to the endpoint from which we receive.
 * @return an <tt>RTCPREMBPacket</tt> that provides receiver feedback to theendpoint from which we receive.
 */
private RTCPREMBPacket makeREMB(long senderSSRC){
  RemoteBitrateEstimator remoteBitrateEstimator=stream.getRemoteBitrateEstimator();
  Collection<Long> ssrcs=remoteBitrateEstimator.getSsrcs();
  long[] dest=new long[ssrcs.size()];
  int i=0;
  for (  Long ssrc : ssrcs)   dest[i++]=ssrc;
  long bitrate=remoteBitrateEstimator.getLatestEstimate();
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + bitrate + "String_Node_Str"+ Arrays.toString(dest)+ "String_Node_Str"+ System.currentTimeMillis());
  }
  if (bitrate == -1) {
    return null;
  }
 else {
    return new RTCPREMBPacket(senderSSRC,0L,bitrate,dest);
  }
}
Program: 107502
Project: 107502
Buggy source:
public void setMinBitrate(int minBitrateBps){
  minConfiguredBitrateBps=minBitrateBps;
  currentBitrateBps=Math.max(minBitrateBps,currentBitrateBps);
}

Fixed version (ground truth):
public void setMinBitrate(long minBitrateBps){
  minConfiguredBitrateBps=minBitrateBps;
  currentBitrateBps=Math.max(minBitrateBps,currentBitrateBps);
}
Program: 107503
Project: 107503
Buggy source:
public void setEstimate(int bitrateBps,long nowMs){
  updated=true;
  bitrateIsInitialized=true;
  currentBitrateBps=changeBitrate(bitrateBps,bitrateBps,nowMs);
}

Fixed version (ground truth):
public void setEstimate(long bitrateBps,long nowMs){
  updated=true;
  bitrateIsInitialized=true;
  currentBitrateBps=changeBitrate(bitrateBps,bitrateBps,nowMs);
}
Program: 107504
Project: 107504
Buggy source:
@Override public void onReceiveBitrateChanged(Collection<Long> ssrcs,long bitrate){
  VideoMediaStreamImpl.this.remoteBitrateEstimatorOnReceiveBitrateChanged(ssrcs,bitrate);
}

Fixed version (ground truth):
@Override public void onReceiveBitrateChanged(Collection<Integer> ssrcs,long bitrate){
  VideoMediaStreamImpl.this.remoteBitrateEstimatorOnReceiveBitrateChanged(ssrcs,bitrate);
}
Program: 107505
Project: 107505
Buggy source:
/** 
 * Notifies this <tt>VideoMediaStreamImpl</tt> that  {@link #remoteBitrateEstimator} has computed a new bitrate estimate forthe incoming streams.
 * @param ssrcs
 * @param bitrate
 */
private void remoteBitrateEstimatorOnReceiveBitrateChanged(Collection<Long> ssrcs,long bitrate){
}

Fixed version (ground truth):
/** 
 * Notifies this <tt>VideoMediaStreamImpl</tt> that  {@link #remoteBitrateEstimator} has computed a new bitrate estimate forthe incoming streams.
 * @param ssrcs
 * @param bitrate
 */
private void remoteBitrateEstimatorOnReceiveBitrateChanged(Collection<Integer> ssrcs,long bitrate){
}
Program: 107506
Project: 107506
Buggy source:
/** 
 * Makes an <tt>RTCPREMBPacket</tt> that provides receiver feedback to the endpoint from which we receive.
 * @return an <tt>RTCPREMBPacket</tt> that provides receiver feedback to theendpoint from which we receive.
 */
private RTCPREMBPacket makeREMB(long senderSSRC){
  RemoteBitrateEstimator remoteBitrateEstimator=stream.getRemoteBitrateEstimator();
  Collection<Long> ssrcs=remoteBitrateEstimator.getSsrcs();
  long[] dest=new long[ssrcs.size()];
  int i=0;
  for (  Long ssrc : ssrcs)   dest[i++]=ssrc;
  long bitrate=remoteBitrateEstimator.getLatestEstimate();
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + bitrate + "String_Node_Str"+ Arrays.toString(dest)+ "String_Node_Str"+ System.currentTimeMillis());
  }
  if (bitrate == -1) {
    return null;
  }
 else {
    return new RTCPREMBPacket(senderSSRC,0L,bitrate,dest);
  }
}

Fixed version (ground truth):
/** 
 * Makes an <tt>RTCPREMBPacket</tt> that provides receiver feedback to the endpoint from which we receive.
 * @return an <tt>RTCPREMBPacket</tt> that provides receiver feedback to theendpoint from which we receive.
 */
private RTCPREMBPacket makeREMB(long senderSSRC){
  RemoteBitrateEstimator remoteBitrateEstimator=stream.getRemoteBitrateEstimator();
  Collection<Integer> ssrcs=remoteBitrateEstimator.getSsrcs();
  long[] dest=new long[ssrcs.size()];
  int i=0;
  for (  Integer ssrc : ssrcs)   dest[i++]=ssrc & 0xFFFFFFFFL;
  long bitrate=remoteBitrateEstimator.getLatestEstimate();
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + bitrate + "String_Node_Str"+ Arrays.toString(dest)+ "String_Node_Str"+ System.currentTimeMillis());
  }
  if (bitrate == -1) {
    return null;
  }
 else {
    return new RTCPREMBPacket(senderSSRC,0L,bitrate,dest);
  }
}
Program: 107507
Project: 107507
Buggy source:
public void setMinBitrate(long minBitrateBps){
  minConfiguredBitrateBps=minBitrateBps;
  currentBitrateBps=Math.max(minBitrateBps,currentBitrateBps);
}

Fixed version (ground truth):
public void setMinBitrate(int minBitrateBps){
  minConfiguredBitrateBps=minBitrateBps;
  currentBitrateBps=Math.max(minBitrateBps,currentBitrateBps);
}
Program: 107508
Project: 107508
Buggy source:
public void setEstimate(long bitrateBps,long nowMs){
  updated=true;
  bitrateIsInitialized=true;
  currentBitrateBps=changeBitrate(bitrateBps,bitrateBps,nowMs);
}

Fixed version (ground truth):
public void setEstimate(int bitrateBps,long nowMs){
  updated=true;
  bitrateIsInitialized=true;
  currentBitrateBps=changeBitrate(bitrateBps,bitrateBps,nowMs);
}
Program: 107509
Project: 107509
Buggy source:
@Override public void onReceiveBitrateChanged(Collection<Integer> ssrcs,long bitrate){
  VideoMediaStreamImpl.this.remoteBitrateEstimatorOnReceiveBitrateChanged(ssrcs,bitrate);
}

Fixed version (ground truth):
@Override public void onReceiveBitrateChanged(Collection<Long> ssrcs,long bitrate){
  VideoMediaStreamImpl.this.remoteBitrateEstimatorOnReceiveBitrateChanged(ssrcs,bitrate);
}
Program: 107510
Project: 107510
Buggy source:
/** 
 * Notifies this <tt>VideoMediaStreamImpl</tt> that  {@link #remoteBitrateEstimator} has computed a new bitrate estimate forthe incoming streams.
 * @param ssrcs
 * @param bitrate
 */
private void remoteBitrateEstimatorOnReceiveBitrateChanged(Collection<Integer> ssrcs,long bitrate){
}

Fixed version (ground truth):
/** 
 * Notifies this <tt>VideoMediaStreamImpl</tt> that  {@link #remoteBitrateEstimator} has computed a new bitrate estimate forthe incoming streams.
 * @param ssrcs
 * @param bitrate
 */
private void remoteBitrateEstimatorOnReceiveBitrateChanged(Collection<Long> ssrcs,long bitrate){
}
Program: 107511
Project: 107511
Buggy source:
/** 
 * Makes an <tt>RTCPREMBPacket</tt> that provides receiver feedback to the endpoint from which we receive.
 * @return an <tt>RTCPREMBPacket</tt> that provides receiver feedback to theendpoint from which we receive.
 */
private RTCPREMBPacket makeREMB(long senderSSRC){
  RemoteBitrateEstimator remoteBitrateEstimator=stream.getRemoteBitrateEstimator();
  Collection<Integer> ssrcs=remoteBitrateEstimator.getSsrcs();
  long[] dest=new long[ssrcs.size()];
  int i=0;
  for (  Integer ssrc : ssrcs)   dest[i++]=ssrc & 0xFFFFFFFFL;
  long bitrate=remoteBitrateEstimator.getLatestEstimate();
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + bitrate + "String_Node_Str"+ Arrays.toString(dest)+ "String_Node_Str"+ System.currentTimeMillis());
  }
  if (bitrate == -1) {
    return null;
  }
 else {
    return new RTCPREMBPacket(senderSSRC,0L,bitrate,dest);
  }
}

Fixed version (ground truth):
/** 
 * Makes an <tt>RTCPREMBPacket</tt> that provides receiver feedback to the endpoint from which we receive.
 * @return an <tt>RTCPREMBPacket</tt> that provides receiver feedback to theendpoint from which we receive.
 */
private RTCPREMBPacket makeREMB(long senderSSRC){
  RemoteBitrateEstimator remoteBitrateEstimator=stream.getRemoteBitrateEstimator();
  Collection<Long> ssrcs=remoteBitrateEstimator.getSsrcs();
  long[] dest=new long[ssrcs.size()];
  int i=0;
  for (  Long ssrc : ssrcs)   dest[i++]=ssrc;
  long bitrate=remoteBitrateEstimator.getLatestEstimate();
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + bitrate + "String_Node_Str"+ Arrays.toString(dest)+ "String_Node_Str"+ System.currentTimeMillis());
  }
  if (bitrate == -1) {
    return null;
  }
 else {
    return new RTCPREMBPacket(senderSSRC,0L,bitrate,dest);
  }
}
Program: 107512
Project: 107512
Buggy source:
public void setMinBitrate(int minBitrateBps){
  minConfiguredBitrateBps=minBitrateBps;
  currentBitrateBps=Math.max(minBitrateBps,currentBitrateBps);
}

Fixed version (ground truth):
public void setMinBitrate(long minBitrateBps){
  minConfiguredBitrateBps=minBitrateBps;
  currentBitrateBps=Math.max(minBitrateBps,currentBitrateBps);
}
Program: 107513
Project: 107513
Buggy source:
public void setEstimate(int bitrateBps,long nowMs){
  updated=true;
  bitrateIsInitialized=true;
  currentBitrateBps=changeBitrate(bitrateBps,bitrateBps,nowMs);
}

Fixed version (ground truth):
public void setEstimate(long bitrateBps,long nowMs){
  updated=true;
  bitrateIsInitialized=true;
  currentBitrateBps=changeBitrate(bitrateBps,bitrateBps,nowMs);
}
Program: 107514
Project: 107514
Buggy source:
/** 
 * Returns the number of packets described in the Packet Status Chunk contained in the buffer   {@code buf} at offset {@code off}. Note that this may not necessarily match with the number of packets that we want to read from the chunk. E.g. if a feedback packet describes 3 packets (indicated by the value "3" in the "packet status count" field), and it contains a Vector Status Chunk which can describe 7 packets (long symbols), then we want to read only 3 packets (but this method will return 7).
 * @param buf the buffer which contains the Packet Status Chunk
 * @param off the offset at which the Packet Status Chunk starts.
 * @return the number of packets described by the Packet Status Chunk.
 */
private static int getPacketCount(byte[] buf,int off){
  int chunkType=buf[off] & 0x80 >> 7;
  if (chunkType == CHUNK_TYPE_VECTOR) {
    int symbolType=buf[off] & 0x40 >> 6;
    return symbolType == SYMBOL_TYPE_SHORT ? 14 : 7;
  }
 else   if (chunkType == CHUNK_TYPE_RLE) {
    return ((buf[off] & 0x1f) << 8) | (buf[off + 1] & 0xff);
  }
  return -1;
}

Fixed version (ground truth):
/** 
 * Returns the number of packets described in the Packet Status Chunk contained in the buffer   {@code buf} at offset {@code off}. Note that this may not necessarily match with the number of packets that we want to read from the chunk. E.g. if a feedback packet describes 3 packets (indicated by the value "3" in the "packet status count" field), and it contains a Vector Status Chunk which can describe 7 packets (long symbols), then we want to read only 3 packets (but this method will return 7).
 * @param buf the buffer which contains the Packet Status Chunk
 * @param off the offset at which the Packet Status Chunk starts.
 * @return the number of packets described by the Packet Status Chunk.
 */
private static int getPacketCount(byte[] buf,int off){
  int chunkType=(buf[off] & 0x80) >> 7;
  if (chunkType == CHUNK_TYPE_VECTOR) {
    int symbolType=(buf[off] & 0x40) >> 6;
    return symbolType == SYMBOL_TYPE_SHORT ? 14 : 7;
  }
 else   if (chunkType == CHUNK_TYPE_RLE) {
    return ((buf[off] & 0x1f) << 8) | (buf[off + 1] & 0xff);
  }
  return -1;
}
Program: 107515
Project: 107515
Buggy source:
/** 
 * Reads the   {@code i}-th (zero-based) symbol from the Packet Status Chunk contained in   {@code buf} at offset {@code off}. Returns -1 if the index is found to be invalid (although the validity check is not performed for RLE chunks).
 * @param buf the buffer which contains the Packet Status Chunk.
 * @param off the offset in {@code buf} at which the Packet Status Chunkbegins.
 * @param i the zero-based index of the symbol to return.
 * @return the {@code i}-th symbol from the given Packet Status Chunk.
 */
private static int readSymbol(byte[] buf,int off,int i){
  int chunkType=buf[off] & 0x80 >> 7;
  if (chunkType == CHUNK_TYPE_VECTOR) {
    int symbolType=buf[off] & 0x40 >> 6;
switch (symbolType) {
case SYMBOL_TYPE_LONG:
      if (0 <= i && i <= 2) {
        return (buf[off] >> (4 - 2 * i)) & 0x03;
      }
 else       if (3 <= i && i <= 6) {
        return (buf[off + 1] >> (6 - 2 * (i - 3))) & 0x03;
      }
    return -1;
case SYMBOL_TYPE_SHORT:
  int shortSymbol;
if (0 <= i && i <= 5) {
  shortSymbol=(buf[off] >> (5 - i)) & 0x01;
}
 else if (6 <= i && i <= 13) {
  shortSymbol=(buf[off + 1] >> (13 - i)) & 0x01;
}
 else {
  return -1;
}
return shortToLong(shortSymbol);
default :
return -1;
}
}
 else if (chunkType == CHUNK_TYPE_RLE) {
return buf[off] >> 5 & 0x03;
}
return -1;
}

Fixed version (ground truth):
/** 
 * Reads the   {@code i}-th (zero-based) symbol from the Packet Status Chunk contained in   {@code buf} at offset {@code off}. Returns -1 if the index is found to be invalid (although the validity check is not performed for RLE chunks).
 * @param buf the buffer which contains the Packet Status Chunk.
 * @param off the offset in {@code buf} at which the Packet Status Chunkbegins.
 * @param i the zero-based index of the symbol to return.
 * @return the {@code i}-th symbol from the given Packet Status Chunk.
 */
private static int readSymbol(byte[] buf,int off,int i){
  int chunkType=(buf[off] & 0x80) >> 7;
  if (chunkType == CHUNK_TYPE_VECTOR) {
    int symbolType=(buf[off] & 0x40) >> 6;
switch (symbolType) {
case SYMBOL_TYPE_LONG:
      if (0 <= i && i <= 2) {
        return (buf[off] >> (4 - 2 * i)) & 0x03;
      }
 else       if (3 <= i && i <= 6) {
        return (buf[off + 1] >> (6 - 2 * (i - 3))) & 0x03;
      }
    return -1;
case SYMBOL_TYPE_SHORT:
  int shortSymbol;
if (0 <= i && i <= 5) {
  shortSymbol=(buf[off] >> (5 - i)) & 0x01;
}
 else if (6 <= i && i <= 13) {
  shortSymbol=(buf[off + 1] >> (13 - i)) & 0x01;
}
 else {
  return -1;
}
return shortToLong(shortSymbol);
default :
return -1;
}
}
 else if (chunkType == CHUNK_TYPE_RLE) {
return (buf[off] >> 5) & 0x03;
}
return -1;
}
Program: 107516
Project: 107516
Buggy source:
/** 
 * Ctor.
 * @param mediaStream the <tt>MediaStream</tt> that owns this instance.
 * @param pktLogging the {@code PacketLoggingService} to be used by the newinstance
 */
DebugTransformEngine(MediaStreamImpl mediaStream,PacketLoggingService pktLogging){
  this.mediaStream=mediaStream;
  _pktLogging=pktLogging;
}

Fixed version (ground truth):
/** 
 * Ctor.
 * @param mediaStream the <tt>MediaStream</tt> that owns this instance.
 * @param pktLogging the {@code PacketLoggingService} to be used by the newinstance
 */
private DebugTransformEngine(MediaStreamImpl mediaStream,PacketLoggingService pktLogging){
  this.mediaStream=mediaStream;
  _pktLogging=pktLogging;
}
Program: 107517
Project: 107517
Buggy source:
/** 
 * Drops the oldest packets from the cache until: 1. The cache contains at most   {@link #MAX_SIZE_PACKETS} packets, and2. The cache only contains packets at most  {@link #SIZE_MILLIS}milliseconds older than the newest packet in the cache.
 */
private synchronized void clean(){
  int size=cache.size();
  if (size <= 0)   return;
  long cleanBefore=System.currentTimeMillis() - SIZE_MILLIS;
  Iterator<Map.Entry<Integer,Container>> iter=cache.entrySet().iterator();
  int removedPackets=0;
  int removedBytes=0;
  while (iter.hasNext()) {
    Container container=iter.next().getValue();
    RawPacket pkt=container.pkt;
    if (size > MAX_SIZE_PACKETS) {
      size--;
    }
 else     if (container.timeAdded >= 0 && container.timeAdded < cleanBefore) {
      break;
    }
    iter.remove();
    removedBytes+=pkt.getLength();
    removedPackets++;
    returnContainer(container);
  }
synchronized (sizesSyncRoot) {
    sizeInBytes-=removedBytes;
    sizeInPackets-=removedPackets;
  }
}

Fixed version (ground truth):
/** 
 * Drops the oldest packets from the cache until: 1. The cache contains at most   {@link #MAX_SIZE_PACKETS} packets, and2. The cache only contains packets at most  {@link #SIZE_MILLIS}milliseconds older than the newest packet in the cache.
 */
private synchronized void clean(){
  int size=cache.size();
  if (size <= 0)   return;
  long cleanBefore=System.currentTimeMillis() - SIZE_MILLIS;
  Iterator<Map.Entry<Integer,Container>> iter=cache.entrySet().iterator();
  int removedPackets=0;
  int removedBytes=0;
  while (iter.hasNext()) {
    Container container=iter.next().getValue();
    RawPacket pkt=container.pkt;
    if (size > MAX_SIZE_PACKETS) {
      size--;
    }
 else     if (container.timeAdded >= 0 && container.timeAdded > cleanBefore) {
      break;
    }
    iter.remove();
    removedBytes+=pkt.getLength();
    removedPackets++;
    returnContainer(container);
  }
synchronized (sizesSyncRoot) {
    sizeInBytes-=removedBytes;
    sizeInPackets-=removedPackets;
  }
}
Program: 107521
Project: 107521
Buggy source:
/** 
 * Transform an RTCP   {@link RawPacket} for the purposes of simulcast.
 * @param pktIn the {@link RawPacket} to be transformed.
 * @return the transformed RTCP {@link RawPacket}, or null if the packet needs to be dropped.
 */
public RawPacket rtcpTransform(RawPacket pktIn){
  if (!RTCPPacketPredicate.INSTANCE.test(pktIn)) {
    return pktIn;
  }
  SimTransformation state=transformState;
  boolean removed=false;
  RTCPIterator it=new RTCPIterator(pktIn);
  while (it.hasNext()) {
    ByteArrayBuffer baf=it.next();
switch (RTCPHeaderUtils.getPacketType(baf)) {
case RTCPPacket.SDES:
      if (removed) {
        it.remove();
      }
    break;
case RTCPPacket.SR:
  if (RawPacket.getRTCPSSRC(baf) != state.currentSSRC) {
    removed=true;
    it.remove();
  }
 else {
    RTCPHeaderUtils.setSenderSSRC(baf,(int)targetSSRC);
    long srcTs=RTCPSenderInfoUtils.getTimestamp(baf);
    long dstTs=state.tsTranslation.apply(srcTs);
    if (srcTs != dstTs) {
      RTCPSenderInfoUtils.setTimestamp(baf,(int)dstTs);
    }
    RTCPSenderInfoUtils.setOctetCount(baf,(int)filterState.transmittedBytes);
    RTCPSenderInfoUtils.setPacketCount(baf,(int)filterState.transmittedPackets);
  }
}
}
return pktIn.getLength() > 0 ? pktIn : null;
}

Fixed version (ground truth):
/** 
 * Transform an RTCP   {@link RawPacket} for the purposes of simulcast.
 * @param pktIn the {@link RawPacket} to be transformed.
 * @return the transformed RTCP {@link RawPacket}, or null if the packet needs to be dropped.
 */
public RawPacket rtcpTransform(RawPacket pktIn){
  if (!RTCPPacketPredicate.INSTANCE.test(pktIn)) {
    return pktIn;
  }
  Context context=this.context;
  boolean removed=false;
  RTCPIterator it=new RTCPIterator(pktIn);
  while (it.hasNext()) {
    ByteArrayBuffer baf=it.next();
switch (RTCPHeaderUtils.getPacketType(baf)) {
case RTCPPacket.SDES:
      if (removed) {
        it.remove();
      }
    break;
case RTCPPacket.SR:
  if (RawPacket.getRTCPSSRC(baf) != context.currentSSRC) {
    removed=true;
    it.remove();
  }
 else {
    RTCPHeaderUtils.setSenderSSRC(baf,(int)targetSSRC);
    long srcTs=RTCPSenderInfoUtils.getTimestamp(baf);
    long dstTs=context.tsTranslation.apply(srcTs);
    if (srcTs != dstTs) {
      RTCPSenderInfoUtils.setTimestamp(baf,(int)dstTs);
    }
    RTCPSenderInfoUtils.setOctetCount(baf,(int)filterState.transmittedBytes);
    RTCPSenderInfoUtils.setPacketCount(baf,(int)filterState.transmittedPackets);
  }
}
}
return pktIn.getLength() > 0 ? pktIn : null;
}
Program: 107522
Project: 107522
Buggy source:
/** 
 * Update the target subjective quality index for this instance.
 * @param newTargetIdx new target subjective quality index.
 * @param newOptimalIdx
 */
public void update(int newTargetIdx,int newOptimalIdx){
  this.optimalIdx=newOptimalIdx;
  int oldTargetIdx=this.targetIdx;
  if (oldTargetIdx == newTargetIdx) {
    return;
  }
  if (logger.isInfoEnabled()) {
    MediaStreamTrackDesc sourceTrack=weakSource.get();
    if (sourceTrack != null) {
      RTPEncodingDesc[] sourceEncodings=sourceTrack.getRTPEncodings();
      if (!ArrayUtils.isNullOrEmpty(sourceEncodings)) {
        long ssrc=sourceEncodings[0].getPrimarySSRC();
        logger.info("String_Node_Str" + ssrc + "String_Node_Str"+ newTargetIdx+ "String_Node_Str"+ oldTargetIdx);
      }
    }
  }
  this.targetIdx=newTargetIdx;
  if (newTargetIdx < 0) {
    transformState=dropState;
  }
 else {
    MediaStreamTrackDesc sourceTrack=weakSource.get();
    if (sourceTrack == null) {
      return;
    }
    int currentTL0Idx=transformState.currentIdx;
    if (currentTL0Idx > -1) {
      currentTL0Idx=sourceTrack.getRTPEncodings()[currentTL0Idx].getBaseLayer().getIndex();
    }
    RTPEncodingDesc targetTL0=sourceTrack.getRTPEncodings()[newTargetIdx].getBaseLayer();
    if (currentTL0Idx != targetTL0.getIndex()) {
      ((RTPTranslatorImpl)sourceTrack.getMediaStreamTrackReceiver().getStream().getRTPTranslator()).getRtcpFeedbackMessageSender().sendFIR((int)targetTL0.getPrimarySSRC());
    }
  }
}

Fixed version (ground truth):
/** 
 * Update the target subjective quality index for this instance.
 * @param newTargetIdx new target subjective quality index.
 * @param newOptimalIdx
 */
public void update(int newTargetIdx,int newOptimalIdx){
  this.optimalIdx=newOptimalIdx;
  int oldTargetIdx=this.targetIdx;
  if (oldTargetIdx == newTargetIdx) {
    return;
  }
  if (logger.isInfoEnabled()) {
    MediaStreamTrackDesc sourceTrack=weakSource.get();
    if (sourceTrack != null) {
      RTPEncodingDesc[] sourceEncodings=sourceTrack.getRTPEncodings();
      if (!ArrayUtils.isNullOrEmpty(sourceEncodings)) {
        long ssrc=sourceEncodings[0].getPrimarySSRC();
        logger.info("String_Node_Str" + ssrc + "String_Node_Str"+ newTargetIdx+ "String_Node_Str"+ oldTargetIdx);
      }
    }
  }
  this.targetIdx=newTargetIdx;
  if (newTargetIdx < 0) {
    context=dropState;
  }
 else {
    MediaStreamTrackDesc sourceTrack=weakSource.get();
    if (sourceTrack == null) {
      return;
    }
    int currentTL0Idx=context.currentIdx;
    if (currentTL0Idx > -1) {
      currentTL0Idx=sourceTrack.getRTPEncodings()[currentTL0Idx].getBaseLayer().getIndex();
    }
    RTPEncodingDesc targetTL0=sourceTrack.getRTPEncodings()[newTargetIdx].getBaseLayer();
    if (currentTL0Idx != targetTL0.getIndex()) {
      ((RTPTranslatorImpl)sourceTrack.getMediaStreamTrackReceiver().getStream().getRTPTranslator()).getRtcpFeedbackMessageSender().sendFIR((int)targetTL0.getPrimarySSRC());
    }
  }
}