nus-yam/ex-repair huggingface dataset:
Program: 106418
Project: 106418
Buggy source:
@Override public Network design(NetworkOffering offering,DeploymentPlan plan,Network userSpecified,Account owner){
  PhysicalNetworkVO physnet=_physicalNetworkDao.findById(plan.getPhysicalNetworkId());
  if (physnet == null || physnet.getIsolationMethods() == null || !physnet.getIsolationMethods().contains("String_Node_Str")) {
    s_logger.debug("String_Node_Str");
    return null;
  }
  List<NiciraNvpDeviceVO> devices=_niciraNvpDao.listByPhysicalNetwork(physnet.getId());
  if (devices.isEmpty()) {
    s_logger.error("String_Node_Str" + physnet.getName());
    return null;
  }
  s_logger.debug("String_Node_Str" + devices.get(0).getUuid() + "String_Node_Str"+ physnet.getId());
  s_logger.debug("String_Node_Str");
  NetworkVO networkObject=(NetworkVO)super.design(offering,plan,userSpecified,owner);
  if (networkObject == null) {
    return null;
  }
  networkObject.setBroadcastDomainType(BroadcastDomainType.Lswitch);
  return networkObject;
}

Fixed version (ground truth):
@Override public Network design(NetworkOffering offering,DeploymentPlan plan,Network userSpecified,Account owner){
  PhysicalNetworkVO physnet=_physicalNetworkDao.findById(plan.getPhysicalNetworkId());
  DataCenter dc=_dcDao.findById(plan.getDataCenterId());
  if (!canHandle(offering,dc.getNetworkType(),physnet)) {
    s_logger.debug("String_Node_Str");
    return null;
  }
  List<NiciraNvpDeviceVO> devices=_niciraNvpDao.listByPhysicalNetwork(physnet.getId());
  if (devices.isEmpty()) {
    s_logger.error("String_Node_Str" + physnet.getName());
    return null;
  }
  s_logger.debug("String_Node_Str" + devices.get(0).getUuid() + "String_Node_Str"+ physnet.getId());
  s_logger.debug("String_Node_Str");
  NetworkVO networkObject=(NetworkVO)super.design(offering,plan,userSpecified,owner);
  if (networkObject == null) {
    return null;
  }
  networkObject.setBroadcastDomainType(BroadcastDomainType.Lswitch);
  return networkObject;
}
Program: 106421
Project: 106421
Buggy source:
protected Site2SiteVpnConnectionDaoImpl(){
  AllFieldsSearch=createSearchBuilder();
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getCustomerGatewayId(),SearchCriteria.Op.EQ);
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getVpnGatewayId(),SearchCriteria.Op.EQ);
  AllFieldsSearch.done();
  VpcSearch=createSearchBuilder();
  VpnGatewaySearch=_vpnGatewayDao.createSearchBuilder();
  VpnGatewaySearch.and("String_Node_Str",VpnGatewaySearch.entity().getVpcId(),SearchCriteria.Op.EQ);
  VpcSearch.join("String_Node_Str",VpnGatewaySearch,VpnGatewaySearch.entity().getId(),VpcSearch.entity().getVpnGatewayId(),JoinType.INNER);
  VpcSearch.done();
}

Fixed version (ground truth):
public Site2SiteVpnConnectionDaoImpl(){
}
Program: 106422
Project: 106422
Buggy source:
protected SnapshotDaoImpl(){
  VolumeIdSearch=createSearchBuilder();
  VolumeIdSearch.and("String_Node_Str",VolumeIdSearch.entity().getVolumeId(),SearchCriteria.Op.EQ);
  VolumeIdSearch.done();
  HostIdSearch=createSearchBuilder();
  HostIdSearch.and("String_Node_Str",HostIdSearch.entity().getSecHostId(),SearchCriteria.Op.EQ);
  HostIdSearch.and("String_Node_Str",HostIdSearch.entity().getStatus(),SearchCriteria.Op.EQ);
  HostIdSearch.done();
  VolumeIdTypeSearch=createSearchBuilder();
  VolumeIdTypeSearch.and("String_Node_Str",VolumeIdTypeSearch.entity().getVolumeId(),SearchCriteria.Op.EQ);
  VolumeIdTypeSearch.and("String_Node_Str",VolumeIdTypeSearch.entity().getsnapshotType(),SearchCriteria.Op.EQ);
  VolumeIdTypeSearch.done();
  VolumeIdVersionSearch=createSearchBuilder();
  VolumeIdVersionSearch.and("String_Node_Str",VolumeIdVersionSearch.entity().getVolumeId(),SearchCriteria.Op.EQ);
  VolumeIdVersionSearch.and("String_Node_Str",VolumeIdVersionSearch.entity().getVersion(),SearchCriteria.Op.EQ);
  VolumeIdVersionSearch.done();
  ParentIdSearch=createSearchBuilder();
  ParentIdSearch.and("String_Node_Str",ParentIdSearch.entity().getPrevSnapshotId(),SearchCriteria.Op.EQ);
  ParentIdSearch.done();
  backupUuidSearch=createSearchBuilder();
  backupUuidSearch.and("String_Node_Str",backupUuidSearch.entity().getBackupSnapshotId(),SearchCriteria.Op.EQ);
  backupUuidSearch.done();
  AccountIdSearch=createSearchBuilder();
  AccountIdSearch.and("String_Node_Str",AccountIdSearch.entity().getAccountId(),SearchCriteria.Op.EQ);
  AccountIdSearch.done();
  StatusSearch=createSearchBuilder();
  StatusSearch.and("String_Node_Str",StatusSearch.entity().getVolumeId(),SearchCriteria.Op.EQ);
  StatusSearch.and("String_Node_Str",StatusSearch.entity().getStatus(),SearchCriteria.Op.IN);
  StatusSearch.done();
  CountSnapshotsByAccount=createSearchBuilder(Long.class);
  CountSnapshotsByAccount.select(null,Func.COUNT,null);
  CountSnapshotsByAccount.and("String_Node_Str",CountSnapshotsByAccount.entity().getAccountId(),SearchCriteria.Op.EQ);
  CountSnapshotsByAccount.and("String_Node_Str",CountSnapshotsByAccount.entity().getRemoved(),SearchCriteria.Op.NULL);
  CountSnapshotsByAccount.done();
  InstanceIdSearch=createSearchBuilder();
  InstanceIdSearch.and("String_Node_Str",InstanceIdSearch.entity().getStatus(),SearchCriteria.Op.IN);
  SearchBuilder<VMInstanceVO> instanceSearch=_instanceDao.createSearchBuilder();
  instanceSearch.and("String_Node_Str",instanceSearch.entity().getId(),SearchCriteria.Op.EQ);
  SearchBuilder<VolumeVO> volumeSearch=_volumeDao.createSearchBuilder();
  volumeSearch.and("String_Node_Str",volumeSearch.entity().getState(),SearchCriteria.Op.EQ);
  volumeSearch.join("String_Node_Str",instanceSearch,instanceSearch.entity().getId(),volumeSearch.entity().getInstanceId(),JoinType.INNER);
  InstanceIdSearch.join("String_Node_Str",volumeSearch,volumeSearch.entity().getId(),InstanceIdSearch.entity().getVolumeId(),JoinType.INNER);
  InstanceIdSearch.done();
}

Fixed version (ground truth):
public SnapshotDaoImpl(){
}
Program: 106423
Project: 106423
Buggy source:
public static Method resolveHandler(Class<?> handlerClz,String operationName){
synchronized (s_handlerCache) {
    Method handler=s_handlerCache.get(handlerClz);
    if (handler != null)     return handler;
    for (    Method method : handlerClz.getMethods()) {
      AsyncCallbackHandler annotation=method.getAnnotation(AsyncCallbackHandler.class);
      if (annotation != null) {
        if (annotation.operationName().equals(operationName)) {
          s_handlerCache.put(handlerClz,method);
          return method;
        }
      }
    }
  }
  return null;
}

Fixed version (ground truth):
public static Method resolveHandler(Class<?> handlerClz,String command){
synchronized (s_handlerCache) {
    Map<String,Method> handlerMap=getAndSetHandlerMap(handlerClz);
    Method handler=handlerMap.get(command);
    if (handler != null)     return handler;
    for (    Method method : handlerClz.getDeclaredMethods()) {
      AsyncCallbackHandler annotation=method.getAnnotation(AsyncCallbackHandler.class);
      if (annotation != null) {
        if (annotation.operationName().equals(command)) {
          handlerMap.put(command,method);
          method.setAccessible(true);
          return method;
        }
      }
    }
  }
  return null;
}
Program: 106424
Project: 106424
Buggy source:
public static Method resolveHandler(Class<?> handlerClz,String command){
synchronized (s_handlerCache) {
    Method handler=s_handlerCache.get(handlerClz);
    if (handler != null)     return handler;
    for (    Method method : handlerClz.getMethods()) {
      RpcCallbackHandler annotation=method.getAnnotation(RpcCallbackHandler.class);
      if (annotation != null) {
        if (annotation.command().equals(command)) {
          s_handlerCache.put(handlerClz,method);
          return method;
        }
      }
    }
  }
  return null;
}

Fixed version (ground truth):
public static Method resolveHandler(Class<?> handlerClz,String command){
synchronized (s_handlerCache) {
    Map<String,Method> handlerMap=getAndSetHandlerMap(handlerClz);
    Method handler=handlerMap.get(command);
    if (handler != null)     return handler;
    for (    Method method : handlerClz.getDeclaredMethods()) {
      RpcCallbackHandler annotation=method.getAnnotation(RpcCallbackHandler.class);
      if (annotation != null) {
        if (annotation.command().equals(command)) {
          method.setAccessible(true);
          handlerMap.put(command,method);
          return method;
        }
      }
    }
  }
  return null;
}
Program: 106425
Project: 106425
Buggy source:
private void handleCallRequestPdu(String sourceAddress,String targetAddress,RpcCallRequestPdu pdu){
  try {
    RpcServerCall call=new RpcServerCallImpl(this,sourceAddress,targetAddress,pdu);
    List<RpcServiceEndpoint> endpoints=new ArrayList<RpcServiceEndpoint>();
synchronized (_serviceEndpoints) {
      endpoints.addAll(_serviceEndpoints);
    }
    for (    RpcServiceEndpoint endpoint : endpoints) {
      if (RpcServiceDispatcher.dispatch(endpoint,call))       return;
    }
    RpcCallResponsePdu responsePdu=new RpcCallResponsePdu();
    responsePdu.setCommand(pdu.getCommand());
    responsePdu.setRequestStartTick(pdu.getRequestStartTick());
    responsePdu.setRequestTag(pdu.getRequestTag());
    responsePdu.setResult(RpcCallResponsePdu.RESULT_HANDLER_NOT_EXIST);
    sendRpcPdu(targetAddress,sourceAddress,_messageSerializer.serializeTo(RpcCallResponsePdu.class,responsePdu));
  }
 catch (  Throwable e) {
    RpcCallResponsePdu responsePdu=new RpcCallResponsePdu();
    responsePdu.setCommand(pdu.getCommand());
    responsePdu.setRequestStartTick(pdu.getRequestStartTick());
    responsePdu.setRequestTag(pdu.getRequestTag());
    responsePdu.setResult(RpcCallResponsePdu.RESULT_HANDLER_EXCEPTION);
    sendRpcPdu(targetAddress,sourceAddress,_messageSerializer.serializeTo(RpcCallResponsePdu.class,responsePdu));
  }
}

Fixed version (ground truth):
private void handleCallRequestPdu(String sourceAddress,String targetAddress,RpcCallRequestPdu pdu){
  try {
    RpcServerCall call=new RpcServerCallImpl(this,sourceAddress,targetAddress,pdu);
    List<RpcServiceEndpoint> endpoints=new ArrayList<RpcServiceEndpoint>();
synchronized (_serviceEndpoints) {
      endpoints.addAll(_serviceEndpoints);
    }
    for (    RpcServiceEndpoint endpoint : endpoints) {
      if (endpoint.onCallReceive(call))       return;
    }
    RpcCallResponsePdu responsePdu=new RpcCallResponsePdu();
    responsePdu.setCommand(pdu.getCommand());
    responsePdu.setRequestStartTick(pdu.getRequestStartTick());
    responsePdu.setRequestTag(pdu.getRequestTag());
    responsePdu.setResult(RpcCallResponsePdu.RESULT_HANDLER_NOT_EXIST);
    sendRpcPdu(targetAddress,sourceAddress,_messageSerializer.serializeTo(RpcCallResponsePdu.class,responsePdu));
  }
 catch (  Throwable e) {
    RpcCallResponsePdu responsePdu=new RpcCallResponsePdu();
    responsePdu.setCommand(pdu.getCommand());
    responsePdu.setRequestStartTick(pdu.getRequestStartTick());
    responsePdu.setRequestTag(pdu.getRequestTag());
    responsePdu.setResult(RpcCallResponsePdu.RESULT_HANDLER_EXCEPTION);
    sendRpcPdu(targetAddress,sourceAddress,_messageSerializer.serializeTo(RpcCallResponsePdu.class,responsePdu));
  }
}
Program: 106426
Project: 106426
Buggy source:
public static Method resolveHandler(Class<?> handlerClz,String command){
synchronized (s_handlerCache) {
    Method handler=s_handlerCache.get(handlerClz);
    if (handler != null)     return handler;
    for (    Method method : handlerClz.getMethods()) {
      RpcServiceHandler annotation=method.getAnnotation(RpcServiceHandler.class);
      if (annotation != null) {
        if (annotation.command().equals(command)) {
          s_handlerCache.put(handlerClz,method);
          return method;
        }
      }
    }
  }
  return null;
}

Fixed version (ground truth):
public static Method resolveHandler(Class<?> handlerClz,String command){
synchronized (s_handlerCache) {
    Map<String,Method> handlerMap=getAndSetHandlerMap(handlerClz);
    Method handler=handlerMap.get(command);
    if (handler != null)     return handler;
    for (    Method method : handlerClz.getDeclaredMethods()) {
      RpcServiceHandler annotation=method.getAnnotation(RpcServiceHandler.class);
      if (annotation != null) {
        if (annotation.command().equals(command)) {
          method.setAccessible(true);
          handlerMap.put(command,method);
          return method;
        }
      }
    }
  }
  return null;
}
Program: 106427
Project: 106427
Buggy source:
@RpcServiceHandler(command="String_Node_Str") void onStartCommand(RpcServerCall call){
  s_logger.info("String_Node_Str");
  SampleStoragePrepareCommand cmd=call.getCommandArgument();
  s_logger.info("String_Node_Str" + cmd.getStoragePool() + "String_Node_Str"+ cmd.getVolumeId());
  SampleStoragePrepareAnswer answer=new SampleStoragePrepareAnswer();
  call.completeCall(answer);
}

Fixed version (ground truth):
@RpcServiceHandler(command="String_Node_Str") void onStartCommand(RpcServerCall call){
  s_logger.info("String_Node_Str");
  SampleStoragePrepareCommand cmd=call.getCommandArgument();
  s_logger.info("String_Node_Str" + cmd.getStoragePool() + "String_Node_Str"+ cmd.getVolumeId());
  SampleStoragePrepareAnswer answer=new SampleStoragePrepareAnswer();
  answer.setResult("String_Node_Str");
  call.completeCall(answer);
}
Program: 106428
Project: 106428
Buggy source:
@Override public int hashCode(){
  final int prime=31;
  int result=1;
  result=prime * result + (int)(id ^ (id >>> 32));
  return result;
}

Fixed version (ground truth):
@Override public int hashCode(){
  final int prime=31;
  int result=1;
  result=prime * result + (int)(getId() ^ (getId() >>> 32));
  return result;
}
Program: 106429
Project: 106429
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (obj == null)   return false;
  if (getClass() != obj.getClass())   return false;
  BaseViewVO other=(BaseViewVO)obj;
  if (id != other.id)   return false;
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (obj == null)   return false;
  if (getClass() != obj.getClass())   return false;
  BaseViewVO other=(BaseViewVO)obj;
  if (getId() != other.getId())   return false;
  return true;
}
Program: 106430
Project: 106430
Buggy source:
public void setId(long id){
  this.id=id;
}

Fixed version (ground truth):
public abstract void setId(long id);
Program: 106431
Project: 106431
Buggy source:
public long getId(){
  return id;
}

Fixed version (ground truth):
public abstract long getId();
Program: 106432
Project: 106432
Buggy source:
public String getAccountUuid(){
  return accountUuid;
}

Fixed version (ground truth):
@Override public String getAccountUuid(){
  return accountUuid;
}
Program: 106433
Project: 106433
Buggy source:
public String getAccountName(){
  return accountName;
}

Fixed version (ground truth):
@Override public String getAccountName(){
  return accountName;
}
Program: 106434
Project: 106434
Buggy source:
public long getDomainId(){
  return domainId;
}

Fixed version (ground truth):
@Override public long getDomainId(){
  return domainId;
}
Program: 106435
Project: 106435
Buggy source:
public String getDomainName(){
  return domainName;
}

Fixed version (ground truth):
@Override public String getDomainName(){
  return domainName;
}
Program: 106436
Project: 106436
Buggy source:
public short getAccountType(){
  return accountType;
}

Fixed version (ground truth):
@Override public short getAccountType(){
  return accountType;
}
Program: 106437
Project: 106437
Buggy source:
public String getProjectName(){
  return projectName;
}

Fixed version (ground truth):
@Override public String getProjectName(){
  return projectName;
}
Program: 106438
Project: 106438
Buggy source:
public String getDomainPath(){
  return domainPath;
}

Fixed version (ground truth):
@Override public String getDomainPath(){
  return domainPath;
}
Program: 106439
Project: 106439
Buggy source:
public String getProjectUuid(){
  return projectUuid;
}

Fixed version (ground truth):
@Override public String getProjectUuid(){
  return projectUuid;
}
Program: 106440
Project: 106440
Buggy source:
public long getAccountId(){
  return accountId;
}

Fixed version (ground truth):
@Override public long getAccountId(){
  return accountId;
}
Program: 106441
Project: 106441
Buggy source:
public long getId(){
  return id;
}

Fixed version (ground truth):
@Override public long getId(){
  return id;
}
Program: 106442
Project: 106442
Buggy source:
public void setId(long id){
  this.id=id;
}

Fixed version (ground truth):
@Override public void setId(long id){
  this.id=id;
}
Program: 106445
Project: 106445
Buggy source:
public NatRule createLogicalRouterNatRule(String logicalRouterUuid,NatRule natRule) throws NiciraNvpApiException {
  String uri="String_Node_Str" + logicalRouterUuid + "String_Node_Str";
  if (natRule instanceof SourceNatRule) {
    return executeCreateObject(natRule,new TypeToken<SourceNatRule>(){
    }
.getType(),uri,Collections.<String,String>emptyMap());
  }
 else   if (natRule instanceof DestinationNatRule) {
    return executeCreateObject(natRule,new TypeToken<DestinationNatRule>(){
    }
.getType(),uri,Collections.<String,String>emptyMap());
  }
  throw new NiciraNvpApiException("String_Node_Str");
}

Fixed version (ground truth):
public NatRule createLogicalRouterNatRule(String logicalRouterUuid,NatRule natRule) throws NiciraNvpApiException {
  String uri="String_Node_Str" + logicalRouterUuid + "String_Node_Str";
  return executeCreateObject(natRule,new TypeToken<NatRule>(){
  }
.getType(),uri,Collections.<String,String>emptyMap());
}
Program: 106447
Project: 106447
Buggy source:
@Override public VpcOfferingResponse createVpcOfferingResponse(VpcOffering offering){
}

Fixed version (ground truth):
@Override public VpcOfferingResponse createVpcOfferingResponse(VpcOffering offering){
  VpcOfferingResponse response=new VpcOfferingResponse();
  response.setId(offering.getId());
  response.setName(offering.getName());
  response.setDisplayText(offering.getDisplayText());
  response.setIsDefault(offering.isDefault());
  response.setState(offering.getState().name());
  Map<Service,Set<Provider>> serviceProviderMap=ApiDBUtils.listVpcOffServices(offering.getId());
  List<ServiceResponse> serviceResponses=new ArrayList<ServiceResponse>();
  for (  Service service : serviceProviderMap.keySet()) {
    ServiceResponse svcRsp=new ServiceResponse();
    if (service == Service.Gateway) {
      continue;
    }
    svcRsp.setName(service.getName());
    List<ProviderResponse> providers=new ArrayList<ProviderResponse>();
    for (    Provider provider : serviceProviderMap.get(service)) {
      if (provider != null) {
        ProviderResponse providerRsp=new ProviderResponse();
        providerRsp.setName(provider.getName());
        providers.add(providerRsp);
      }
    }
    svcRsp.setProviders(providers);
    serviceResponses.add(svcRsp);
  }
  response.setServices(serviceResponses);
  response.setObjectName("String_Node_Str");
  return response;
}
Program: 106449
Project: 106449
Buggy source:
public static ComponentLocator getLocator(String server){
  return ComponentContext.getCompanent(ComponentLocator.class);
}

Fixed version (ground truth):
public static ComponentLocator getLocator(String server,String configFileName,String log4jFilename){
  return ComponentContext.getCompanent(ComponentLocator.class);
}
Program: 106451
Project: 106451
Buggy source:
private StoragePool createSharedStoragePool(Connect conn,String uuid,String host,String path){
  String mountPoint=path;
  if (!_storageLayer.exists(mountPoint)) {
    s_logger.error(mountPath + "String_Node_Str");
    return null;
  }
  LibvirtStoragePoolDef spd=new LibvirtStoragePoolDef(poolType.DIR,uuid,uuid,host,path,path);
  StoragePool sp=null;
  try {
    s_logger.debug(spd.toString());
    sp=conn.storagePoolDefineXML(spd.toString(),0);
    sp.create(0);
    return sp;
  }
 catch (  LibvirtException e) {
    s_logger.debug(e.toString());
    if (sp != null) {
      try {
        sp.undefine();
        sp.free();
      }
 catch (      LibvirtException l) {
        s_logger.debug("String_Node_Str" + l.toString());
      }
    }
    return null;
  }
}

Fixed version (ground truth):
private StoragePool createSharedStoragePool(Connect conn,String uuid,String host,String path){
  String mountPoint=path;
  if (!_storageLayer.exists(mountPoint)) {
    s_logger.error(mountPoint + "String_Node_Str");
    return null;
  }
  LibvirtStoragePoolDef spd=new LibvirtStoragePoolDef(poolType.DIR,uuid,uuid,host,path,path);
  StoragePool sp=null;
  try {
    s_logger.debug(spd.toString());
    sp=conn.storagePoolDefineXML(spd.toString(),0);
    sp.create(0);
    return sp;
  }
 catch (  LibvirtException e) {
    s_logger.debug(e.toString());
    if (sp != null) {
      try {
        sp.undefine();
        sp.free();
      }
 catch (      LibvirtException l) {
        s_logger.debug("String_Node_Str" + l.toString());
      }
    }
    return null;
  }
}
Program: 106453
Project: 106453
Buggy source:
private String findDefaultDnsIp(long userVmId){
  NicVO defaultNic=_nicDao.findDefaultNicForVM(userVmId);
  if (!_networkMgr.isProviderSupportServiceInNetwork(defaultNic.getNetworkId(),Service.Dns,Provider.VirtualRouter)) {
    return null;
  }
  NetworkOfferingVO offering=_networkOfferingDao.findById(_networkDao.findById(defaultNic.getNetworkId()).getNetworkOfferingId());
  if (offering.getRedundantRouter()) {
    return findGatewayIp(userVmId);
  }
  NicVO domrDefaultNic=_nicDao.findByNetworkIdTypeAndGateway(defaultNic.getNetworkId(),VirtualMachine.Type.DomainRouter,defaultNic.getGateway());
  return domrDefaultNic.getIp4Address();
}

Fixed version (ground truth):
private String findDefaultDnsIp(long userVmId){
  NicVO defaultNic=_nicDao.findDefaultNicForVM(userVmId);
  if (!_networkMgr.isProviderSupportServiceInNetwork(defaultNic.getNetworkId(),Service.Dns,Provider.VirtualRouter)) {
    return null;
  }
  NetworkOfferingVO offering=_networkOfferingDao.findById(_networkDao.findById(defaultNic.getNetworkId()).getNetworkOfferingId());
  if (offering.getRedundantRouter()) {
    return findGatewayIp(userVmId);
  }
  DataCenter dc=_dcDao.findById(_networkMgr.getNetwork(defaultNic.getNetworkId()).getDataCenterId());
  boolean isZoneBasic=(dc.getNetworkType() == NetworkType.Basic);
  NicVO domrDefaultNic;
  if (isZoneBasic) {
    domrDefaultNic=_nicDao.findByNetworkIdTypeAndGateway(defaultNic.getNetworkId(),VirtualMachine.Type.DomainRouter,defaultNic.getGateway());
  }
 else {
    domrDefaultNic=_nicDao.findByNetworkIdAndType(defaultNic.getNetworkId(),VirtualMachine.Type.DomainRouter);
  }
  return domrDefaultNic.getIp4Address();
}
Program: 106454
Project: 106454
Buggy source:
private static String genDefaultEncryptorPassword(){
  try {
    SecureRandom random=SecureRandom.getInstance("String_Node_Str");
    byte[] randomBytes=new byte[16];
    random.nextBytes(randomBytes);
    return Base64.encode(randomBytes);
  }
 catch (  NoSuchAlgorithmException e) {
    s_logger.error("String_Node_Str",e);
    assert(false);
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
private static String genDefaultEncryptorPassword(){
  try {
    SecureRandom random=SecureRandom.getInstance("String_Node_Str");
    byte[] randomBytes=new byte[16];
    random.nextBytes(randomBytes);
    return Base64.encodeBase64String(randomBytes);
  }
 catch (  NoSuchAlgorithmException e) {
    s_logger.error("String_Node_Str",e);
    assert(false);
  }
  return "String_Node_Str";
}
Program: 106455
Project: 106455
Buggy source:
private <T>T executeRetrieveObject(Type returnObjectType,String uri,Map<String,String> parameters) throws NiciraNvpApiException {
  String url;
  try {
    url=new URL("String_Node_Str",_host,uri).toString();
  }
 catch (  MalformedURLException e) {
    s_logger.error("String_Node_Str",e);
    throw new NiciraNvpApiException("String_Node_Str",e);
  }
  GetMethod gm=new GetMethod(url);
  gm.setRequestHeader("String_Node_Str","String_Node_Str");
  if (parameters != null && !parameters.isEmpty()) {
    List<NameValuePair> nameValuePairs=new ArrayList<NameValuePair>(parameters.size());
    for (    Entry<String,String> e : parameters.entrySet()) {
      nameValuePairs.add(new NameValuePair(e.getKey(),e.getValue()));
    }
    gm.setQueryString(nameValuePairs.toArray(new NameValuePair[0]));
  }
  executeMethod(gm);
  if (gm.getStatusCode() != HttpStatus.SC_OK) {
    String errorMessage=responseToErrorMessage(gm);
    s_logger.error("String_Node_Str" + errorMessage);
    throw new NiciraNvpApiException("String_Node_Str" + errorMessage);
  }
  Gson gson=new Gson();
  T returnValue;
  try {
    returnValue=gson.fromJson(gm.getResponseBodyAsString(),returnObjectType);
  }
 catch (  IOException e) {
    s_logger.error("String_Node_Str",e);
    throw new NiciraNvpApiException(e);
  }
  return returnValue;
}

Fixed version (ground truth):
private <T>T executeRetrieveObject(Type returnObjectType,String uri,Map<String,String> parameters) throws NiciraNvpApiException {
  String url;
  try {
    url=new URL("String_Node_Str",_host,uri).toString();
  }
 catch (  MalformedURLException e) {
    s_logger.error("String_Node_Str",e);
    throw new NiciraNvpApiException("String_Node_Str",e);
  }
  GetMethod gm=new GetMethod(url);
  gm.setRequestHeader("String_Node_Str","String_Node_Str");
  if (parameters != null && !parameters.isEmpty()) {
    List<NameValuePair> nameValuePairs=new ArrayList<NameValuePair>(parameters.size());
    for (    Entry<String,String> e : parameters.entrySet()) {
      nameValuePairs.add(new NameValuePair(e.getKey(),e.getValue()));
    }
    gm.setQueryString(nameValuePairs.toArray(new NameValuePair[0]));
  }
  executeMethod(gm);
  if (gm.getStatusCode() != HttpStatus.SC_OK) {
    String errorMessage=responseToErrorMessage(gm);
    s_logger.error("String_Node_Str" + errorMessage);
    throw new NiciraNvpApiException("String_Node_Str" + errorMessage);
  }
  Gson gson=new Gson();
  T returnValue;
  try {
    returnValue=(T)gson.fromJson(gm.getResponseBodyAsString(),returnObjectType);
  }
 catch (  IOException e) {
    s_logger.error("String_Node_Str",e);
    throw new NiciraNvpApiException(e);
  }
  return returnValue;
}
Program: 106456
Project: 106456
Buggy source:
private <T>T executeCreateObject(T newObject,Type returnObjectType,String uri,Map<String,String> parameters) throws NiciraNvpApiException {
  String url;
  try {
    url=new URL("String_Node_Str",_host,uri).toString();
  }
 catch (  MalformedURLException e) {
    s_logger.error("String_Node_Str",e);
    throw new NiciraNvpApiException("String_Node_Str",e);
  }
  Gson gson=new Gson();
  PostMethod pm=new PostMethod(url);
  pm.setRequestHeader("String_Node_Str","String_Node_Str");
  try {
    pm.setRequestEntity(new StringRequestEntity(gson.toJson(newObject),"String_Node_Str",null));
  }
 catch (  UnsupportedEncodingException e) {
    throw new NiciraNvpApiException("String_Node_Str",e);
  }
  executeMethod(pm);
  if (pm.getStatusCode() != HttpStatus.SC_CREATED) {
    String errorMessage=responseToErrorMessage(pm);
    s_logger.error("String_Node_Str" + errorMessage);
    throw new NiciraNvpApiException("String_Node_Str" + errorMessage);
  }
  T result;
  try {
    result=gson.fromJson(pm.getResponseBodyAsString(),TypeToken.get(newObject.getClass()).getType());
  }
 catch (  IOException e) {
    throw new NiciraNvpApiException("String_Node_Str",e);
  }
  return result;
}

Fixed version (ground truth):
private <T>T executeCreateObject(T newObject,Type returnObjectType,String uri,Map<String,String> parameters) throws NiciraNvpApiException {
  String url;
  try {
    url=new URL("String_Node_Str",_host,uri).toString();
  }
 catch (  MalformedURLException e) {
    s_logger.error("String_Node_Str",e);
    throw new NiciraNvpApiException("String_Node_Str",e);
  }
  Gson gson=new Gson();
  PostMethod pm=new PostMethod(url);
  pm.setRequestHeader("String_Node_Str","String_Node_Str");
  try {
    pm.setRequestEntity(new StringRequestEntity(gson.toJson(newObject),"String_Node_Str",null));
  }
 catch (  UnsupportedEncodingException e) {
    throw new NiciraNvpApiException("String_Node_Str",e);
  }
  executeMethod(pm);
  if (pm.getStatusCode() != HttpStatus.SC_CREATED) {
    String errorMessage=responseToErrorMessage(pm);
    s_logger.error("String_Node_Str" + errorMessage);
    throw new NiciraNvpApiException("String_Node_Str" + errorMessage);
  }
  T result;
  try {
    result=(T)gson.fromJson(pm.getResponseBodyAsString(),TypeToken.get(newObject.getClass()).getType());
  }
 catch (  IOException e) {
    throw new NiciraNvpApiException("String_Node_Str",e);
  }
  return result;
}
Program: 106457
Project: 106457
Buggy source:
private String findDefaultDnsIp(long userVmId){
  NicVO defaultNic=_nicDao.findDefaultNicForVM(userVmId);
  if (!_networkMgr.isProviderSupportServiceInNetwork(defaultNic.getNetworkId(),Service.Dns,Provider.VirtualRouter)) {
    return null;
  }
  NetworkOfferingVO offering=_networkOfferingDao.findById(_networkDao.findById(defaultNic.getNetworkId()).getNetworkOfferingId());
  if (offering.getRedundantRouter()) {
    return findGatewayIp(userVmId);
  }
  NicVO domrDefaultNic=_nicDao.findByNetworkIdAndType(defaultNic.getNetworkId(),VirtualMachine.Type.DomainRouter);
  return domrDefaultNic.getIp4Address();
}

Fixed version (ground truth):
private String findDefaultDnsIp(long userVmId){
  NicVO defaultNic=_nicDao.findDefaultNicForVM(userVmId);
  if (!_networkMgr.isProviderSupportServiceInNetwork(defaultNic.getNetworkId(),Service.Dns,Provider.VirtualRouter)) {
    return null;
  }
  NetworkOfferingVO offering=_networkOfferingDao.findById(_networkDao.findById(defaultNic.getNetworkId()).getNetworkOfferingId());
  if (offering.getRedundantRouter()) {
    return findGatewayIp(userVmId);
  }
  NicVO domrDefaultNic=_nicDao.findByNetworkIdTypeAndGateway(defaultNic.getNetworkId(),VirtualMachine.Type.DomainRouter,defaultNic.getGateway());
  return domrDefaultNic.getIp4Address();
}
Program: 106459
Project: 106459
Buggy source:
private static String genDefaultEncryptorPassword(){
  try {
    SecureRandom random=SecureRandom.getInstance("String_Node_Str");
    byte[] randomBytes=new byte[16];
    random.nextBytes(randomBytes);
    return Base64.encode(randomBytes);
  }
 catch (  NoSuchAlgorithmException e) {
    s_logger.error("String_Node_Str",e);
    assert(false);
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
private static String genDefaultEncryptorPassword(){
  try {
    SecureRandom random=SecureRandom.getInstance("String_Node_Str");
    byte[] randomBytes=new byte[16];
    random.nextBytes(randomBytes);
    return Base64.encodeBase64String(randomBytes);
  }
 catch (  NoSuchAlgorithmException e) {
    s_logger.error("String_Node_Str",e);
    assert(false);
  }
  return "String_Node_Str";
}
Program: 106460
Project: 106460
Buggy source:
private <T>T executeRetrieveObject(Type returnObjectType,String uri,Map<String,String> parameters) throws NiciraNvpApiException {
  String url;
  try {
    url=new URL("String_Node_Str",_host,uri).toString();
  }
 catch (  MalformedURLException e) {
    s_logger.error("String_Node_Str",e);
    throw new NiciraNvpApiException("String_Node_Str",e);
  }
  GetMethod gm=new GetMethod(url);
  gm.setRequestHeader("String_Node_Str","String_Node_Str");
  if (parameters != null && !parameters.isEmpty()) {
    List<NameValuePair> nameValuePairs=new ArrayList<NameValuePair>(parameters.size());
    for (    Entry<String,String> e : parameters.entrySet()) {
      nameValuePairs.add(new NameValuePair(e.getKey(),e.getValue()));
    }
    gm.setQueryString(nameValuePairs.toArray(new NameValuePair[0]));
  }
  executeMethod(gm);
  if (gm.getStatusCode() != HttpStatus.SC_OK) {
    String errorMessage=responseToErrorMessage(gm);
    s_logger.error("String_Node_Str" + errorMessage);
    throw new NiciraNvpApiException("String_Node_Str" + errorMessage);
  }
  Gson gson=new Gson();
  T returnValue;
  try {
    returnValue=gson.fromJson(gm.getResponseBodyAsString(),returnObjectType);
  }
 catch (  IOException e) {
    s_logger.error("String_Node_Str",e);
    throw new NiciraNvpApiException(e);
  }
  return returnValue;
}

Fixed version (ground truth):
private <T>T executeRetrieveObject(Type returnObjectType,String uri,Map<String,String> parameters) throws NiciraNvpApiException {
  String url;
  try {
    url=new URL("String_Node_Str",_host,uri).toString();
  }
 catch (  MalformedURLException e) {
    s_logger.error("String_Node_Str",e);
    throw new NiciraNvpApiException("String_Node_Str",e);
  }
  GetMethod gm=new GetMethod(url);
  gm.setRequestHeader("String_Node_Str","String_Node_Str");
  if (parameters != null && !parameters.isEmpty()) {
    List<NameValuePair> nameValuePairs=new ArrayList<NameValuePair>(parameters.size());
    for (    Entry<String,String> e : parameters.entrySet()) {
      nameValuePairs.add(new NameValuePair(e.getKey(),e.getValue()));
    }
    gm.setQueryString(nameValuePairs.toArray(new NameValuePair[0]));
  }
  executeMethod(gm);
  if (gm.getStatusCode() != HttpStatus.SC_OK) {
    String errorMessage=responseToErrorMessage(gm);
    s_logger.error("String_Node_Str" + errorMessage);
    throw new NiciraNvpApiException("String_Node_Str" + errorMessage);
  }
  Gson gson=new Gson();
  T returnValue;
  try {
    returnValue=(T)gson.fromJson(gm.getResponseBodyAsString(),returnObjectType);
  }
 catch (  IOException e) {
    s_logger.error("String_Node_Str",e);
    throw new NiciraNvpApiException(e);
  }
  return returnValue;
}
Program: 106461
Project: 106461
Buggy source:
private <T>T executeCreateObject(T newObject,Type returnObjectType,String uri,Map<String,String> parameters) throws NiciraNvpApiException {
  String url;
  try {
    url=new URL("String_Node_Str",_host,uri).toString();
  }
 catch (  MalformedURLException e) {
    s_logger.error("String_Node_Str",e);
    throw new NiciraNvpApiException("String_Node_Str",e);
  }
  Gson gson=new Gson();
  PostMethod pm=new PostMethod(url);
  pm.setRequestHeader("String_Node_Str","String_Node_Str");
  try {
    pm.setRequestEntity(new StringRequestEntity(gson.toJson(newObject),"String_Node_Str",null));
  }
 catch (  UnsupportedEncodingException e) {
    throw new NiciraNvpApiException("String_Node_Str",e);
  }
  executeMethod(pm);
  if (pm.getStatusCode() != HttpStatus.SC_CREATED) {
    String errorMessage=responseToErrorMessage(pm);
    s_logger.error("String_Node_Str" + errorMessage);
    throw new NiciraNvpApiException("String_Node_Str" + errorMessage);
  }
  T result;
  try {
    result=gson.fromJson(pm.getResponseBodyAsString(),TypeToken.get(newObject.getClass()).getType());
  }
 catch (  IOException e) {
    throw new NiciraNvpApiException("String_Node_Str",e);
  }
  return result;
}

Fixed version (ground truth):
private <T>T executeCreateObject(T newObject,Type returnObjectType,String uri,Map<String,String> parameters) throws NiciraNvpApiException {
  String url;
  try {
    url=new URL("String_Node_Str",_host,uri).toString();
  }
 catch (  MalformedURLException e) {
    s_logger.error("String_Node_Str",e);
    throw new NiciraNvpApiException("String_Node_Str",e);
  }
  Gson gson=new Gson();
  PostMethod pm=new PostMethod(url);
  pm.setRequestHeader("String_Node_Str","String_Node_Str");
  try {
    pm.setRequestEntity(new StringRequestEntity(gson.toJson(newObject),"String_Node_Str",null));
  }
 catch (  UnsupportedEncodingException e) {
    throw new NiciraNvpApiException("String_Node_Str",e);
  }
  executeMethod(pm);
  if (pm.getStatusCode() != HttpStatus.SC_CREATED) {
    String errorMessage=responseToErrorMessage(pm);
    s_logger.error("String_Node_Str" + errorMessage);
    throw new NiciraNvpApiException("String_Node_Str" + errorMessage);
  }
  T result;
  try {
    result=(T)gson.fromJson(pm.getResponseBodyAsString(),TypeToken.get(newObject.getClass()).getType());
  }
 catch (  IOException e) {
    throw new NiciraNvpApiException("String_Node_Str",e);
  }
  return result;
}
Program: 106468
Project: 106468
Buggy source:
private List<NetworkVO> listDomainSpecificNetworksByDomainPath(SearchCriteria<NetworkVO> sc,Filter searchFilter,String path,boolean isRecursive){
  SearchCriteria<NetworkVO> accountSC=_networksDao.createSearchCriteria();
  accountSC.addAnd("String_Node_Str",SearchCriteria.Op.EQ,ACLType.Domain.toString());
  if (path != null) {
    if (isRecursive) {
      sc.setJoinParameters("String_Node_Str","String_Node_Str",path + "String_Node_Str");
    }
 else {
      sc.setJoinParameters("String_Node_Str","String_Node_Str",path);
    }
  }
  sc.addAnd("String_Node_Str",SearchCriteria.Op.SC,accountSC);
  return _networksDao.search(sc,searchFilter);
}

Fixed version (ground truth):
private List<NetworkVO> listDomainSpecificNetworksByDomainPath(SearchCriteria<NetworkVO> sc,Filter searchFilter,String path,boolean isRecursive){
  Set<Long> allowedDomains=new HashSet<Long>();
  if (path != null) {
    if (isRecursive) {
      allowedDomains=_domainMgr.getDomainChildrenIds(path);
    }
 else {
      Domain domain=_domainDao.findDomainByPath(path);
      allowedDomains.add(domain.getId());
    }
  }
  List<Long> networkIds=new ArrayList<Long>();
  List<NetworkDomainVO> maps=_networkDomainDao.listDomainNetworkMapByDomain(allowedDomains.toArray());
  for (  NetworkDomainVO map : maps) {
    networkIds.add(map.getNetworkId());
  }
  if (!networkIds.isEmpty()) {
    SearchCriteria<NetworkVO> domainSC=_networksDao.createSearchCriteria();
    domainSC.addAnd("String_Node_Str",SearchCriteria.Op.IN,networkIds.toArray());
    domainSC.addAnd("String_Node_Str",SearchCriteria.Op.EQ,ACLType.Domain.toString());
    sc.addAnd("String_Node_Str",SearchCriteria.Op.SC,domainSC);
    return _networksDao.search(sc,searchFilter);
  }
 else {
    return new ArrayList<NetworkVO>();
  }
}
Program: 106469
Project: 106469
Buggy source:
private List<NetworkVO> listDomainLevelNetworks(SearchCriteria<NetworkVO> sc,Filter searchFilter,long domainId){
  List<Long> networkIds=new ArrayList<Long>();
  Set<Long> allowedDomains=_domainMgr.getDomainParentIds(domainId);
  List<NetworkDomainVO> maps=_networkDomainDao.listDomainNetworkMapByDomain(allowedDomains.toArray());
  for (  NetworkDomainVO map : maps) {
    boolean subdomainAccess=(map.isSubdomainAccess() != null) ? map.isSubdomainAccess() : getAllowSubdomainAccessGlobal();
    if (map.getDomainId() == domainId || subdomainAccess) {
      networkIds.add(map.getNetworkId());
    }
  }
  if (!networkIds.isEmpty()) {
    SearchCriteria<NetworkVO> domainSC=_networksDao.createSearchCriteria();
    domainSC.addAnd("String_Node_Str",SearchCriteria.Op.IN,networkIds.toArray());
    domainSC.addAnd("String_Node_Str",SearchCriteria.Op.EQ,ACLType.Domain.toString());
    sc.addAnd("String_Node_Str",SearchCriteria.Op.SC,domainSC);
    return _networksDao.search(sc,searchFilter);
  }
 else {
    return new ArrayList<NetworkVO>();
  }
}

Fixed version (ground truth):
private List<NetworkVO> listDomainLevelNetworks(SearchCriteria<NetworkVO> sc,Filter searchFilter,long domainId,boolean parentDomainsOnly){
  List<Long> networkIds=new ArrayList<Long>();
  Set<Long> allowedDomains=_domainMgr.getDomainParentIds(domainId);
  List<NetworkDomainVO> maps=_networkDomainDao.listDomainNetworkMapByDomain(allowedDomains.toArray());
  for (  NetworkDomainVO map : maps) {
    if (map.getDomainId() == domainId && parentDomainsOnly) {
      continue;
    }
    boolean subdomainAccess=(map.isSubdomainAccess() != null) ? map.isSubdomainAccess() : getAllowSubdomainAccessGlobal();
    if (map.getDomainId() == domainId || subdomainAccess) {
      networkIds.add(map.getNetworkId());
    }
  }
  if (!networkIds.isEmpty()) {
    SearchCriteria<NetworkVO> domainSC=_networksDao.createSearchCriteria();
    domainSC.addAnd("String_Node_Str",SearchCriteria.Op.IN,networkIds.toArray());
    domainSC.addAnd("String_Node_Str",SearchCriteria.Op.EQ,ACLType.Domain.toString());
    sc.addAnd("String_Node_Str",SearchCriteria.Op.SC,domainSC);
    return _networksDao.search(sc,searchFilter);
  }
 else {
    return new ArrayList<NetworkVO>();
  }
}
Program: 106472
Project: 106472
Buggy source:
@Override protected String networkUsage(Connection conn,final String privateIpAddress,final String option,final String vif){
  String args="String_Node_Str" + privateIpAddress + "String_Node_Str";
  if (option.equals("String_Node_Str")) {
    args="String_Node_Str";
  }
 else   if (option.equals("String_Node_Str")) {
    args="String_Node_Str";
  }
 else   if (option.equals("String_Node_Str")) {
    args="String_Node_Str";
  }
 else   if (option.equals("String_Node_Str")) {
    args="String_Node_Str";
    args+=vif;
  }
 else   if (option.equals("String_Node_Str")) {
    args="String_Node_Str";
    args+=vif;
  }
  return callHostPlugin(conn,"String_Node_Str","String_Node_Str","String_Node_Str",args);
}

Fixed version (ground truth):
@Override protected String networkUsage(Connection conn,final String privateIpAddress,final String option,final String vif){
  String args="String_Node_Str" + privateIpAddress + "String_Node_Str";
  if (option.equals("String_Node_Str")) {
    args+="String_Node_Str";
  }
 else   if (option.equals("String_Node_Str")) {
    args+="String_Node_Str";
  }
 else   if (option.equals("String_Node_Str")) {
    args+="String_Node_Str";
  }
 else   if (option.equals("String_Node_Str")) {
    args+="String_Node_Str";
    args+=vif;
  }
 else   if (option.equals("String_Node_Str")) {
    args+="String_Node_Str";
    args+=vif;
  }
  return callHostPlugin(conn,"String_Node_Str","String_Node_Str","String_Node_Str",args);
}
Program: 106474
Project: 106474
Buggy source:
public void detachServicePolicy(String policyMap,String portProfile) throws CloudRuntimeException {
  String command=VsmCommand.getServicePolicy(policyMap,portProfile,false);
  if (command != null) {
    command=command.concat(SSH_NETCONF_TERMINATOR);
    send(command);
    parseOkReply(receive());
  }
 else {
    throw new CloudRuntimeException("String_Node_Str");
  }
}

Fixed version (ground truth):
public void detachServicePolicy(String policyMap,String portProfile) throws CloudRuntimeException {
  String command=VsmCommand.getServicePolicy(policyMap,portProfile,false);
  if (command != null) {
    command=command.concat(SSH_NETCONF_TERMINATOR);
    parseOkReply(sendAndReceive(command));
  }
 else {
    throw new CloudRuntimeException("String_Node_Str");
  }
}
Program: 106475
Project: 106475
Buggy source:
public void attachServicePolicy(String policyMap,String portProfile) throws CloudRuntimeException {
  String command=VsmCommand.getServicePolicy(policyMap,portProfile,true);
  if (command != null) {
    command=command.concat(SSH_NETCONF_TERMINATOR);
    send(command);
    parseOkReply(receive());
  }
 else {
    throw new CloudRuntimeException("String_Node_Str");
  }
}

Fixed version (ground truth):
public void attachServicePolicy(String policyMap,String portProfile) throws CloudRuntimeException {
  String command=VsmCommand.getServicePolicy(policyMap,portProfile,true);
  if (command != null) {
    command=command.concat(SSH_NETCONF_TERMINATOR);
    parseOkReply(sendAndReceive(command));
  }
 else {
    throw new CloudRuntimeException("String_Node_Str");
  }
}
Program: 106476
Project: 106476
Buggy source:
public void addPortProfile(String name,PortProfileType type,BindingType binding,SwitchPortMode mode,int vlanid) throws CloudRuntimeException {
  String command=VsmCommand.getAddPortProfile(name,type,binding,mode,vlanid);
  if (command != null) {
    command=command.concat(SSH_NETCONF_TERMINATOR);
    for (int i=0; i < s_retryCount; ++i) {
      send(command);
      VsmOkResponse response=new VsmOkResponse(receive().trim());
      if (!response.isResponseOk()) {
        if (i >= s_retryCount) {
          throw new CloudRuntimeException(response.toString());
        }
        try {
          Thread.sleep(1000);
        }
 catch (        final InterruptedException e) {
          s_logger.debug("String_Node_Str");
        }
      }
 else {
        break;
      }
    }
  }
 else {
    throw new CloudRuntimeException("String_Node_Str");
  }
}

Fixed version (ground truth):
public void addPortProfile(String name,PortProfileType type,BindingType binding,SwitchPortMode mode,int vlanid) throws CloudRuntimeException {
  String command=VsmCommand.getAddPortProfile(name,type,binding,mode,vlanid);
  if (command != null) {
    command=command.concat(SSH_NETCONF_TERMINATOR);
    parseOkReply(sendAndReceive(command));
  }
 else {
    throw new CloudRuntimeException("String_Node_Str");
  }
}
Program: 106477
Project: 106477
Buggy source:
public PortProfile getPortProfileByName(String name) throws CloudRuntimeException {
  String command=VsmCommand.getPortProfile(name);
  if (command != null) {
    command=command.concat(SSH_NETCONF_TERMINATOR);
    send(command);
    String received=receive();
    VsmPortProfileResponse response=new VsmPortProfileResponse(received.trim());
    if (!response.isResponseOk()) {
      throw new CloudRuntimeException("String_Node_Str");
    }
 else {
      return response.getPortProfile();
    }
  }
 else {
    throw new CloudRuntimeException("String_Node_Str");
  }
}

Fixed version (ground truth):
public PortProfile getPortProfileByName(String name) throws CloudRuntimeException {
  String command=VsmCommand.getPortProfile(name);
  if (command != null) {
    command=command.concat(SSH_NETCONF_TERMINATOR);
    String received=sendAndReceive(command);
    VsmPortProfileResponse response=new VsmPortProfileResponse(received.trim());
    if (!response.isResponseOk()) {
      throw new CloudRuntimeException(response.toString());
    }
 else {
      return response.getPortProfile();
    }
  }
 else {
    throw new CloudRuntimeException("String_Node_Str");
  }
}
Program: 106478
Project: 106478
Buggy source:
public PolicyMap getPolicyMapByName(String name) throws CloudRuntimeException {
  String command=VsmCommand.getPolicyMap(name);
  if (command != null) {
    command=command.concat(SSH_NETCONF_TERMINATOR);
    send(command);
    String received=receive();
    VsmPolicyMapResponse response=new VsmPolicyMapResponse(received.trim());
    if (!response.isResponseOk()) {
      throw new CloudRuntimeException("String_Node_Str");
    }
 else {
      return response.getPolicyMap();
    }
  }
 else {
    throw new CloudRuntimeException("String_Node_Str");
  }
}

Fixed version (ground truth):
public PolicyMap getPolicyMapByName(String name) throws CloudRuntimeException {
  String command=VsmCommand.getPolicyMap(name);
  if (command != null) {
    command=command.concat(SSH_NETCONF_TERMINATOR);
    String received=sendAndReceive(command);
    VsmPolicyMapResponse response=new VsmPolicyMapResponse(received.trim());
    if (!response.isResponseOk()) {
      throw new CloudRuntimeException(response.toString());
    }
 else {
      return response.getPolicyMap();
    }
  }
 else {
    throw new CloudRuntimeException("String_Node_Str");
  }
}
Program: 106479
Project: 106479
Buggy source:
public void deletePolicyMap(String name) throws CloudRuntimeException {
  String command=VsmCommand.getDeletePolicyMap(name);
  if (command != null) {
    command=command.concat(SSH_NETCONF_TERMINATOR);
    send(command);
    parseOkReply(receive());
  }
 else {
    throw new CloudRuntimeException("String_Node_Str");
  }
}

Fixed version (ground truth):
public void deletePolicyMap(String name) throws CloudRuntimeException {
  String command=VsmCommand.getDeletePolicyMap(name);
  if (command != null) {
    command=command.concat(SSH_NETCONF_TERMINATOR);
    parseOkReply(sendAndReceive(command));
  }
 else {
    throw new CloudRuntimeException("String_Node_Str");
  }
}
Program: 106480
Project: 106480
Buggy source:
public void addPolicyMap(String name,int averageRate,int maxRate,int burstRate) throws CloudRuntimeException {
  String command=VsmCommand.getAddPolicyMap(name,averageRate,maxRate,burstRate);
  if (command != null) {
    command=command.concat(SSH_NETCONF_TERMINATOR);
    send(command);
    parseOkReply(receive());
  }
 else {
    throw new CloudRuntimeException("String_Node_Str");
  }
}

Fixed version (ground truth):
public void addPolicyMap(String name,int averageRate,int maxRate,int burstRate) throws CloudRuntimeException {
  String command=VsmCommand.getAddPolicyMap(name,averageRate,maxRate,burstRate);
  if (command != null) {
    command=command.concat(SSH_NETCONF_TERMINATOR);
    parseOkReply(sendAndReceive(command));
  }
 else {
    throw new CloudRuntimeException("String_Node_Str");
  }
}