nus-yam/ex-repair huggingface dataset:
Program: 105917
Project: 105917
Buggy source:
@Override public PodEntity registerPod(String podUuid,String name,String owner,String zoneUuid,List<String> tags,Map<String,String> details){
  PodEntityImpl podEntity=new PodEntityImpl(podUuid,manager);
  podEntity.setOwner(owner);
  podEntity.setName(name);
  podEntity.persist();
  return podEntity;
}

Fixed version (ground truth):
@Override public PodEntity registerPod(final String podUuid,final String name,final String owner,final String zoneUuid,final List<String> tags,final Map<String,String> details){
  PodEntityImpl podEntity=new PodEntityImpl(podUuid,manager);
  podEntity.setOwner(owner);
  podEntity.setName(name);
  podEntity.persist();
  return podEntity;
}
Program: 105918
Project: 105918
Buggy source:
@Override public HostEntity registerHost(String hostUuid,String name,String owner,List<String> tags,Map<String,String> details){
  HostEntityImpl hostEntity=new HostEntityImpl(hostUuid,manager);
  hostEntity.setOwner(owner);
  hostEntity.setName(name);
  hostEntity.setDetails(details);
  hostEntity.persist();
  return hostEntity;
}

Fixed version (ground truth):
@Override public HostEntity registerHost(final String hostUuid,final String name,final String owner,final List<String> tags,final Map<String,String> details){
  HostEntityImpl hostEntity=new HostEntityImpl(hostUuid,manager);
  hostEntity.setOwner(owner);
  hostEntity.setName(name);
  hostEntity.setDetails(details);
  hostEntity.persist();
  return hostEntity;
}
Program: 105919
Project: 105919
Buggy source:
@Override public void deregisterPod(String uuid){
  PodEntityImpl podEntity=new PodEntityImpl(uuid,manager);
  podEntity.disable();
}

Fixed version (ground truth):
@Override public void deregisterPod(final String uuid){
  PodEntityImpl podEntity=new PodEntityImpl(uuid,manager);
  podEntity.disable();
}
Program: 105920
Project: 105920
Buggy source:
@Override public void deregisterZone(String uuid){
  ZoneEntityImpl zoneEntity=new ZoneEntityImpl(uuid,manager);
  zoneEntity.disable();
}

Fixed version (ground truth):
@Override public void deregisterZone(final String uuid){
  ZoneEntityImpl zoneEntity=new ZoneEntityImpl(uuid,manager);
  zoneEntity.disable();
}
Program: 105921
Project: 105921
Buggy source:
@Override public List<PodEntity> listPods(){
  List<PodEntity> pods=new ArrayList<PodEntity>();
  return null;
}

Fixed version (ground truth):
@Override public List<PodEntity> listPods(){
  return null;
}
Program: 105922
Project: 105922
Buggy source:
public NfsStoragePool(String poolUUID,String poolIp,String poolSourcePath,String mountDestPath,PoolType type){
  this._poolUUID=poolUUID;
  this._poolIp=poolIp;
  this._poolMountSourcePath=poolSourcePath;
  this._mountDestPath=mountDestPath;
  this._type=type;
}

Fixed version (ground truth):
public NfsStoragePool(String poolUUID,String poolIp,String poolSourcePath,String mountDestPath,PoolType type){
  _poolUUID=poolUUID;
  _poolIp=poolIp;
  _poolMountSourcePath=poolSourcePath;
  _mountDestPath=mountDestPath;
  _type=type;
}
Program: 105923
Project: 105923
Buggy source:
protected String getMountPoint(NfsStoragePool storagePool){
  StoragePool pool=null;
  String poolName=null;
  try {
    pool=LibvirtConnection.getConnection().storagePoolLookupByUUIDString(storagePool._poolUUID);
    if (pool != null) {
      StoragePoolInfo spi=pool.getInfo();
      if (spi.state != StoragePoolState.VIR_STORAGE_POOL_RUNNING) {
        pool.create(0);
      }
 else {
      }
    }
    poolName=pool.getName();
  }
 catch (  LibvirtException e) {
    s_logger.debug("String_Node_Str",e);
  }
 finally {
    try {
      if (pool != null) {
        pool.free();
      }
    }
 catch (    LibvirtException e) {
      s_logger.debug("String_Node_Str",e);
    }
  }
  return checkingMountPoint(storagePool,poolName);
}

Fixed version (ground truth):
protected String getMountPoint(NfsStoragePool storagePool){
  StoragePool pool=null;
  String poolName=null;
  try {
    pool=LibvirtConnection.getConnection().storagePoolLookupByUUIDString(storagePool._poolUUID);
    if (pool != null) {
      StoragePoolInfo spi=pool.getInfo();
      if (spi.state != StoragePoolState.VIR_STORAGE_POOL_RUNNING) {
        pool.create(0);
      }
 else {
      }
      poolName=pool.getName();
    }
  }
 catch (  LibvirtException e) {
    s_logger.debug("String_Node_Str",e);
  }
 finally {
    try {
      if (pool != null) {
        pool.free();
      }
    }
 catch (    LibvirtException e) {
      s_logger.debug("String_Node_Str",e);
    }
  }
  return checkingMountPoint(storagePool,poolName);
}
Program: 105924
Project: 105924
Buggy source:
String getUuid();

Fixed version (ground truth):
@Override String getUuid();
Program: 105925
Project: 105925
Buggy source:
long getId();

Fixed version (ground truth):
@Override long getId();
Program: 105926
Project: 105926
Buggy source:
String getUuid();

Fixed version (ground truth):
@Override String getUuid();
Program: 105927
Project: 105927
Buggy source:
long getId();

Fixed version (ground truth):
@Override long getId();
Program: 105928
Project: 105928
Buggy source:
@DB @Override public AclPolicy removeAclPermissionFromAclPolicy(long aclPolicyId,String entityType,String scope,Long scopeId,String action){
  AclPolicy policy=_aclPolicyDao.findById(aclPolicyId);
  if (policy == null) {
    throw new InvalidParameterValueException("String_Node_Str" + aclPolicyId + "String_Node_Str");
  }
  AclPolicyPermissionVO permit=_policyPermissionDao.findByPolicyAndEntity(aclPolicyId,entityType,scope,scopeId,action,null);
  if (permit != null) {
    _policyPermissionDao.remove(permit.getId());
  }
  return policy;
}

Fixed version (ground truth):
@DB @Override public AclPolicy removeAclPermissionFromAclPolicy(long aclPolicyId,String entityType,String scope,Long scopeId,String action){
  AclPolicy policy=_aclPolicyDao.findById(aclPolicyId);
  if (policy == null) {
    throw new InvalidParameterValueException("String_Node_Str" + aclPolicyId + "String_Node_Str");
  }
  AclPolicyPermissionVO permit=_policyPermissionDao.findByPolicyAndEntity(aclPolicyId,entityType,scope,scopeId,action,Permission.Allow);
  if (permit != null) {
    _policyPermissionDao.remove(permit.getId());
  }
  return policy;
}
Program: 105931
Project: 105931
Buggy source:
@DB() protected int addJoinAttributes(int count,PreparedStatement pstmt,Collection<JoinBuilder<SearchCriteria<?>>> joins) throws SQLException {
  for (  JoinBuilder<SearchCriteria<?>> join : joins) {
    for (    final Pair<Attribute,Object> value : join.getT().getValues()) {
      prepareAttribute(++count,pstmt,value.first(),value.second());
    }
  }
  for (  JoinBuilder<SearchCriteria<?>> join : joins) {
    if (join.getT().getJoins() != null) {
      count=addJoinAttributes(count,pstmt,join.getT().getJoins());
    }
  }
  if (s_logger.isTraceEnabled()) {
    s_logger.trace("String_Node_Str" + pstmt);
  }
  return count;
}

Fixed version (ground truth):
@DB() protected int addJoinAttributes(int count,PreparedStatement pstmt,Collection<JoinBuilder<SearchCriteria<?>>> joins) throws SQLException {
  for (  JoinBuilder<SearchCriteria<?>> join : joins) {
    for (    final Pair<Attribute,Object> value : join.getT().getValues()) {
      prepareAttribute(count++,pstmt,value.first(),value.second());
    }
  }
  for (  JoinBuilder<SearchCriteria<?>> join : joins) {
    if (join.getT().getJoins() != null) {
      count=addJoinAttributes(count,pstmt,join.getT().getJoins());
    }
  }
  if (s_logger.isTraceEnabled()) {
    s_logger.trace("String_Node_Str" + pstmt);
  }
  return count;
}
Program: 105932
Project: 105932
Buggy source:
private List<CommandExecLogVO> listActiveCommands(long dcId,Date cutTime){
  SearchCriteria<CommandExecLogVO> sc=ActiveCommandSearch.create();
  sc.setParameters("String_Node_Str",cutTime);
  sc.setJoinParameters("String_Node_Str","String_Node_Str",dcId);
  sc.setJoinParameters("String_Node_Str","String_Node_Str",Status.Up);
  return _cmdExecLogDao.search(sc,null);
}

Fixed version (ground truth):
private List<CommandExecLogVO> listActiveCommands(long dcId,Date cutTime){
  SearchCriteria<CommandExecLogVO> sc=activeCommandSearch.create();
  sc.setParameters("String_Node_Str",cutTime);
  sc.setJoinParameters("String_Node_Str","String_Node_Str",dcId);
  sc.setJoinParameters("String_Node_Str","String_Node_Str",Status.Up);
  return _cmdExecLogDao.search(sc,null);
}
Program: 105933
Project: 105933
Buggy source:
@Override public boolean configure(String name,Map<String,Object> params) throws ConfigurationException {
  super.configure(name,params);
  _capacityPerSSVM=NumbersUtil.parseInt(_configDao.getValue(Config.SecStorageSessionMax.key()),DEFAULT_SS_VM_CAPACITY);
  _standbyCapacity=NumbersUtil.parseInt(_configDao.getValue(Config.SecStorageCapacityStandby.key()),DEFAULT_STANDBY_CAPACITY);
  int nMaxExecutionMinutes=NumbersUtil.parseInt(_configDao.getValue(Config.SecStorageCmdExecutionTimeMax.key()),30);
  _maxExecutionTimeMs=nMaxExecutionMinutes * 60 * 1000;
  HostSearch=_hostDao.createSearchBuilder();
  HostSearch.and("String_Node_Str",HostSearch.entity().getDataCenterId(),Op.EQ);
  HostSearch.and("String_Node_Str",HostSearch.entity().getStatus(),Op.EQ);
  ActiveCommandSearch=_cmdExecLogDao.createSearchBuilder();
  ActiveCommandSearch.and("String_Node_Str",ActiveCommandSearch.entity().getCreated(),Op.GTEQ);
  ActiveCommandSearch.join("String_Node_Str",HostSearch,ActiveCommandSearch.entity().getInstanceId(),HostSearch.entity().getId(),JoinType.INNER);
  HostSearch.done();
  ActiveCommandSearch.done();
  return true;
}

Fixed version (ground truth):
@Override public boolean configure(String name,Map<String,Object> params) throws ConfigurationException {
  super.configure(name,params);
  _capacityPerSSVM=NumbersUtil.parseInt(_configDao.getValue(Config.SecStorageSessionMax.key()),DEFAULT_SS_VM_CAPACITY);
  _standbyCapacity=NumbersUtil.parseInt(_configDao.getValue(Config.SecStorageCapacityStandby.key()),DEFAULT_STANDBY_CAPACITY);
  int nMaxExecutionMinutes=NumbersUtil.parseInt(_configDao.getValue(Config.SecStorageCmdExecutionTimeMax.key()),30);
  _maxExecutionTimeMs=nMaxExecutionMinutes * 60 * 1000;
  hostSearch=_hostDao.createSearchBuilder();
  hostSearch.and("String_Node_Str",hostSearch.entity().getDataCenterId(),Op.EQ);
  hostSearch.and("String_Node_Str",hostSearch.entity().getStatus(),Op.EQ);
  activeCommandSearch=_cmdExecLogDao.createSearchBuilder();
  activeCommandSearch.and("String_Node_Str",activeCommandSearch.entity().getCreated(),Op.GTEQ);
  activeCommandSearch.join("String_Node_Str",hostSearch,activeCommandSearch.entity().getInstanceId(),hostSearch.entity().getId(),JoinType.INNER);
  hostSearch.done();
  activeCommandSearch.done();
  return true;
}
Program: 105934
Project: 105934
Buggy source:
@Override public boolean generateVMSetupCommand(Long ssAHostId){
  HostVO ssAHost=_hostDao.findById(ssAHostId);
  if (ssAHost.getType() != Host.Type.SecondaryStorageVM) {
    return false;
  }
  SecondaryStorageVmVO secStorageVm=_secStorageVmDao.findByInstanceName(ssAHost.getName());
  if (secStorageVm == null) {
    s_logger.warn("String_Node_Str" + ssAHost.getName() + "String_Node_Str");
    return false;
  }
  SecStorageVMSetupCommand setupCmd=new SecStorageVMSetupCommand();
  if (_allowedInternalSites != null) {
    List<String> allowedCidrs=new ArrayList<String>();
    String[] cidrs=_allowedInternalSites.split("String_Node_Str");
    for (    String cidr : cidrs) {
      if (NetUtils.isValidCIDR(cidr) || NetUtils.isValidIp(cidr) || !cidr.startsWith("String_Node_Str")) {
        allowedCidrs.add(cidr);
      }
    }
    List<? extends Nic> nics=_networkModel.getNicsForTraffic(secStorageVm.getId(),TrafficType.Management);
    setupCmd.setAllowedInternalSites(allowedCidrs.toArray(new String[allowedCidrs.size()]));
  }
  String copyPasswd=_configDao.getValue("String_Node_Str");
  setupCmd.setCopyPassword(copyPasswd);
  setupCmd.setCopyUserName(TemplateConstants.DEFAULT_HTTP_AUTH_USER);
  Answer answer=_agentMgr.easySend(ssAHostId,setupCmd);
  if (answer != null && answer.getResult()) {
    if (s_logger.isDebugEnabled()) {
      s_logger.debug("String_Node_Str" + secStorageVm.getHostName());
    }
    return true;
  }
 else {
    if (s_logger.isDebugEnabled()) {
      s_logger.debug("String_Node_Str" + secStorageVm.getHostName());
    }
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean generateVMSetupCommand(Long ssAHostId){
  HostVO ssAHost=_hostDao.findById(ssAHostId);
  if (ssAHost.getType() != Host.Type.SecondaryStorageVM) {
    return false;
  }
  SecondaryStorageVmVO secStorageVm=_secStorageVmDao.findByInstanceName(ssAHost.getName());
  if (secStorageVm == null) {
    s_logger.warn("String_Node_Str" + ssAHost.getName() + "String_Node_Str");
    return false;
  }
  SecStorageVMSetupCommand setupCmd=new SecStorageVMSetupCommand();
  if (_allowedInternalSites != null) {
    List<String> allowedCidrs=new ArrayList<String>();
    String[] cidrs=_allowedInternalSites.split("String_Node_Str");
    for (    String cidr : cidrs) {
      if (NetUtils.isValidCIDR(cidr) || NetUtils.isValidIp(cidr) || !cidr.startsWith("String_Node_Str")) {
        allowedCidrs.add(cidr);
      }
    }
    setupCmd.setAllowedInternalSites(allowedCidrs.toArray(new String[allowedCidrs.size()]));
  }
  String copyPasswd=_configDao.getValue("String_Node_Str");
  setupCmd.setCopyPassword(copyPasswd);
  setupCmd.setCopyUserName(TemplateConstants.DEFAULT_HTTP_AUTH_USER);
  Answer answer=_agentMgr.easySend(ssAHostId,setupCmd);
  if (answer != null && answer.getResult()) {
    if (s_logger.isDebugEnabled()) {
      s_logger.debug("String_Node_Str" + secStorageVm.getHostName());
    }
    return true;
  }
 else {
    if (s_logger.isDebugEnabled()) {
      s_logger.debug("String_Node_Str" + secStorageVm.getHostName());
    }
    return false;
  }
}
Program: 105939
Project: 105939
Buggy source:
private void checkAccountAndDomain(Long accountId,Long domainId){
  DomainVO domain=_domainDao.findById(domainId);
  if (domain == null) {
    throw new InvalidParameterValueException("String_Node_Str" + domainId + "String_Node_Str");
  }
  if (accountId != null) {
    AccountVO account=_accountDao.findById(accountId);
    if (account == null || domainId != account.getDomainId()) {
      throw new InvalidParameterValueException("String_Node_Str" + account.getAccountName());
    }
  }
}

Fixed version (ground truth):
private void checkAccountAndDomain(Long accountId,Long domainId){
  DomainVO domain=_domainDao.findById(domainId);
  if (domain == null) {
    throw new InvalidParameterValueException("String_Node_Str" + domainId + "String_Node_Str");
  }
  if (accountId != null) {
    AccountVO account=_accountDao.findById(accountId);
    if (account == null || domainId != account.getDomainId()) {
      throw new InvalidParameterValueException("String_Node_Str" + accountId);
    }
  }
}
Program: 105943
Project: 105943
Buggy source:
@Override public AclPolicyResponse createAclPolicyResponse(AclPolicy policy){
  AclPolicyResponse response=new AclPolicyResponse();
  response.setId(policy.getUuid());
  response.setName(policy.getName());
  response.setDescription(policy.getDescription());
  String domainPath=policy.getPath();
  if (domainPath != null) {
    DomainVO domain=_domainDao.findDomainByPath(domainPath);
    if (domain != null) {
      response.setDomainId(domain.getUuid());
      response.setDomainName(domain.getName());
    }
  }
  long accountId=policy.getAccountId();
  AccountVO owner=_accountDao.findById(accountId);
  if (owner != null) {
    response.setAccountName(owner.getAccountName());
  }
  List<AclPolicyPermission> permissions=_iamSrv.listPolicyPermissions(policy.getId());
  if (permissions != null && permissions.size() > 0) {
    for (    AclPolicyPermission permission : permissions) {
      AclPermissionResponse perm=new AclPermissionResponse();
      perm.setAction(permission.getAction());
      perm.setEntityType(AclEntityType.valueOf(permission.getEntityType()));
      perm.setScope(PermissionScope.valueOf(permission.getScope()));
      perm.setScopeId(permission.getScopeId());
      perm.setPermission(permission.getPermission());
      response.addPermission(perm);
    }
  }
  response.setObjectName("String_Node_Str");
  return response;
}

Fixed version (ground truth):
@Override public AclPolicyResponse createAclPolicyResponse(AclPolicy policy){
  AclPolicyResponse response=new AclPolicyResponse();
  response.setId(policy.getUuid());
  response.setName(policy.getName());
  response.setDescription(policy.getDescription());
  String domainPath=policy.getPath();
  if (domainPath != null) {
    DomainVO domain=_domainDao.findDomainByPath(domainPath);
    if (domain != null) {
      response.setDomainId(domain.getUuid());
      response.setDomainName(domain.getName());
    }
  }
  long accountId=policy.getAccountId();
  AccountVO owner=_accountDao.findById(accountId);
  if (owner != null) {
    response.setAccountName(owner.getAccountName());
  }
  List<AclPolicyPermission> permissions=_iamSrv.listPolicyPermissions(policy.getId());
  if (permissions != null && permissions.size() > 0) {
    for (    AclPolicyPermission permission : permissions) {
      AclPermissionResponse perm=new AclPermissionResponse();
      perm.setAction(permission.getAction());
      if (permission.getEntityType() != null) {
        perm.setEntityType(AclEntityType.valueOf(permission.getEntityType()));
      }
      if (permission.getScope() != null) {
        perm.setScope(PermissionScope.valueOf(permission.getScope()));
      }
      perm.setScopeId(permission.getScopeId());
      perm.setPermission(permission.getPermission());
      response.addPermission(perm);
    }
  }
  response.setObjectName("String_Node_Str");
  return response;
}
Program: 105944
Project: 105944
Buggy source:
public String[] getResults(){
  return results;
}

Fixed version (ground truth):
public String[] getResults(){
  if (results != null) {
    return Arrays.copyOf(results,results.length);
  }
  return null;
}
Program: 105947
Project: 105947
Buggy source:
@Override public ExecutionResult createFileInVR(String routerIp,String filePath,String fileName,String content){
  VmwareManager mgr=getServiceContext().getStockObject(VmwareManager.CONTEXT_STOCK_NAME);
  File keyFile=mgr.getSystemVMKeyFile();
  boolean result=true;
  try {
    SshHelper.scpTo(routerIp,3922,"String_Node_Str",keyFile,null,filePath,content.getBytes(),fileName,null);
  }
 catch (  Exception e) {
    s_logger.warn("String_Node_Str" + filePath + fileName+ "String_Node_Str"+ routerIp,e);
    return new ExecutionResult(false,e.getMessage());
  }
  return new ExecutionResult(true,null);
}

Fixed version (ground truth):
@Override public ExecutionResult createFileInVR(String routerIp,String filePath,String fileName,String content){
  VmwareManager mgr=getServiceContext().getStockObject(VmwareManager.CONTEXT_STOCK_NAME);
  File keyFile=mgr.getSystemVMKeyFile();
  try {
    SshHelper.scpTo(routerIp,3922,"String_Node_Str",keyFile,null,filePath,content.getBytes(),fileName,null);
  }
 catch (  Exception e) {
    s_logger.warn("String_Node_Str" + filePath + fileName+ "String_Node_Str"+ routerIp,e);
    return new ExecutionResult(false,e.getMessage());
  }
  return new ExecutionResult(true,null);
}
Program: 105950
Project: 105950
Buggy source:
@Override public String getName(){
  return providerName;
}

Fixed version (ground truth):
@Override public String getName(){
  return DataStoreProvider.DEFAULT_PRIMARY;
}
Program: 105951
Project: 105951
Buggy source:
@Override public DataStoreLifeCycle getDataStoreLifeCycle(){
  return this.lifecycle;
}

Fixed version (ground truth):
@Override public DataStoreLifeCycle getDataStoreLifeCycle(){
  return lifecycle;
}
Program: 105952
Project: 105952
Buggy source:
@Override public PrimaryDataStoreDriver getDataStoreDriver(){
  return this.driver;
}

Fixed version (ground truth):
@Override public PrimaryDataStoreDriver getDataStoreDriver(){
  return driver;
}
Program: 105953
Project: 105953
Buggy source:
@Override public HypervisorHostListener getHostListener(){
  return this.listener;
}

Fixed version (ground truth):
@Override public HypervisorHostListener getHostListener(){
  return listener;
}
Program: 105955
Project: 105955
Buggy source:
protected void processResponse(final Link link,final Response response){
  final AgentAttache attache=(AgentAttache)link.attachment();
  if (attache == null) {
    s_logger.warn("String_Node_Str" + response);
  }
  if (!attache.processAnswers(response.getSequence(),response)) {
    s_logger.info("String_Node_Str" + attache.getId() + "String_Node_Str"+ response.getSequence()+ "String_Node_Str"+ response);
  }
}

Fixed version (ground truth):
protected void processResponse(final Link link,final Response response){
  final AgentAttache attache=(AgentAttache)link.attachment();
  if (attache == null) {
    s_logger.warn("String_Node_Str" + response);
  }
 else   if (!attache.processAnswers(response.getSequence(),response)) {
    s_logger.info("String_Node_Str" + attache.getId() + "String_Node_Str"+ response.getSequence()+ "String_Node_Str"+ response);
  }
}
Program: 105956
Project: 105956
Buggy source:
private void createPolicyAndAddToDomainGroup(String policyName,String description,String entityType,Long entityId,String action,AccessType accessType,Long domainId,Boolean recursive){
  AclPolicy policy=_iamSrv.createAclPolicy(policyName,description,null);
  _iamSrv.addAclPermissionToAclPolicy(policy.getId(),entityType,PermissionScope.RESOURCE.toString(),entityId,action,accessType.toString(),Permission.Allow,recursive);
  List<Long> policyList=new ArrayList<Long>();
  policyList.add(new Long(policy.getId()));
  Domain domain=_domainDao.findById(domainId);
  if (domain != null) {
    List<AclGroup> domainGroups=listDomainGroup(domain);
    if (domainGroups != null) {
      for (      AclGroup group : domainGroups) {
        _iamSrv.attachAclPoliciesToGroup(policyList,group.getId());
      }
    }
  }
}

Fixed version (ground truth):
private void createPolicyAndAddToDomainGroup(String policyName,String description,String entityType,Long entityId,String action,AccessType accessType,Long domainId,Boolean recursive){
  Domain domain=_domainDao.findById(domainId);
  if (domain != null) {
    AclPolicy policy=_iamSrv.createAclPolicy(policyName,description,null,domain.getPath());
    _iamSrv.addAclPermissionToAclPolicy(policy.getId(),entityType,PermissionScope.RESOURCE.toString(),entityId,action,accessType.toString(),Permission.Allow,recursive);
    List<Long> policyList=new ArrayList<Long>();
    policyList.add(new Long(policy.getId()));
    List<AclGroup> domainGroups=listDomainGroup(domain);
    if (domainGroups != null) {
      for (      AclGroup group : domainGroups) {
        _iamSrv.attachAclPoliciesToGroup(policyList,group.getId());
      }
    }
  }
}
Program: 105957
Project: 105957
Buggy source:
@DB @Override @ActionEvent(eventType=EventTypes.EVENT_ACL_POLICY_CREATE,eventDescription="String_Node_Str",create=true) public AclPolicy createAclPolicy(Account caller,final String aclPolicyName,final String description,final Long parentPolicyId){
  return _iamSrv.createAclPolicy(aclPolicyName,description,parentPolicyId);
}

Fixed version (ground truth):
@DB @Override @ActionEvent(eventType=EventTypes.EVENT_ACL_POLICY_CREATE,eventDescription="String_Node_Str",create=true) public AclPolicy createAclPolicy(Account caller,final String aclPolicyName,final String description,final Long parentPolicyId){
  Long domainId=caller.getDomainId();
  Domain callerDomain=_domainDao.findById(domainId);
  if (callerDomain == null) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  return _iamSrv.createAclPolicy(aclPolicyName,description,parentPolicyId,callerDomain.getPath());
}
Program: 105958
Project: 105958
Buggy source:
AclPolicy createAclPolicy(String aclPolicyName,String description,Long parentPolicyId);

Fixed version (ground truth):
AclPolicy createAclPolicy(String aclPolicyName,String description,Long parentPolicyId,String path);
Program: 105959
Project: 105959
Buggy source:
@DB @Override public AclPolicy createAclPolicy(final String aclPolicyName,final String description,final Long parentPolicyId){
  AclPolicy ro=_aclPolicyDao.findByName(aclPolicyName);
  if (ro != null) {
    throw new InvalidParameterValueException("String_Node_Str" + aclPolicyName + "String_Node_Str");
  }
  AclPolicy role=Transaction.execute(new TransactionCallback<AclPolicy>(){
    @Override public AclPolicy doInTransaction(    TransactionStatus status){
      AclPolicyVO rvo=new AclPolicyVO(aclPolicyName,description);
      AclPolicy role=_aclPolicyDao.persist(rvo);
      if (parentPolicyId != null) {
        List<AclPolicyPermissionVO> perms=_policyPermissionDao.listByPolicy(parentPolicyId);
        if (perms != null) {
          for (          AclPolicyPermissionVO perm : perms) {
            perm.setAclPolicyId(role.getId());
            _policyPermissionDao.persist(perm);
          }
        }
      }
      return role;
    }
  }
);
  return role;
}

Fixed version (ground truth):
@DB @Override public AclPolicy createAclPolicy(final String aclPolicyName,final String description,final Long parentPolicyId,final String path){
  AclPolicy ro=_aclPolicyDao.findByName(aclPolicyName);
  if (ro != null) {
    throw new InvalidParameterValueException("String_Node_Str" + aclPolicyName + "String_Node_Str");
  }
  AclPolicy role=Transaction.execute(new TransactionCallback<AclPolicy>(){
    @Override public AclPolicy doInTransaction(    TransactionStatus status){
      AclPolicyVO rvo=new AclPolicyVO(aclPolicyName,description);
      rvo.setPath(path);
      AclPolicy role=_aclPolicyDao.persist(rvo);
      if (parentPolicyId != null) {
        List<AclPolicyPermissionVO> perms=_policyPermissionDao.listByPolicy(parentPolicyId);
        if (perms != null) {
          for (          AclPolicyPermissionVO perm : perms) {
            perm.setAclPolicyId(role.getId());
            _policyPermissionDao.persist(perm);
          }
        }
      }
      return role;
    }
  }
);
  return role;
}
Program: 105960
Project: 105960
Buggy source:
@Override public AclPolicy doInTransaction(TransactionStatus status){
  AclPolicyVO rvo=new AclPolicyVO(aclPolicyName,description);
  AclPolicy role=_aclPolicyDao.persist(rvo);
  if (parentPolicyId != null) {
    List<AclPolicyPermissionVO> perms=_policyPermissionDao.listByPolicy(parentPolicyId);
    if (perms != null) {
      for (      AclPolicyPermissionVO perm : perms) {
        perm.setAclPolicyId(role.getId());
        _policyPermissionDao.persist(perm);
      }
    }
  }
  return role;
}

Fixed version (ground truth):
@Override public AclPolicy doInTransaction(TransactionStatus status){
  AclPolicyVO rvo=new AclPolicyVO(aclPolicyName,description);
  rvo.setPath(path);
  AclPolicy role=_aclPolicyDao.persist(rvo);
  if (parentPolicyId != null) {
    List<AclPolicyPermissionVO> perms=_policyPermissionDao.listByPolicy(parentPolicyId);
    if (perms != null) {
      for (      AclPolicyPermissionVO perm : perms) {
        perm.setAclPolicyId(role.getId());
        _policyPermissionDao.persist(perm);
      }
    }
  }
  return role;
}
Program: 105961
Project: 105961
Buggy source:
@Test public void toReadableSize(){
  assertEquals("String_Node_Str",NumbersUtil.toReadableSize((1024l * 1024l * 1024l* 1024l)));
  assertEquals("String_Node_Str",NumbersUtil.toReadableSize(1024 * 1024 * 1024));
  assertEquals("String_Node_Str",NumbersUtil.toReadableSize(1024 * 1024));
  assertEquals("String_Node_Str",NumbersUtil.toReadableSize((1024)));
  assertEquals("String_Node_Str",NumbersUtil.toReadableSize((1023)));
}

Fixed version (ground truth):
@Test public void toReadableSize(){
  Locale.setDefault(Locale.US);
  assertEquals("String_Node_Str",NumbersUtil.toReadableSize((1024l * 1024l * 1024l* 1024l)));
  assertEquals("String_Node_Str",NumbersUtil.toReadableSize(1024 * 1024 * 1024));
  assertEquals("String_Node_Str",NumbersUtil.toReadableSize(1024 * 1024));
  assertEquals("String_Node_Str",NumbersUtil.toReadableSize((1024)));
  assertEquals("String_Node_Str",NumbersUtil.toReadableSize((1023)));
}
Program: 105962
Project: 105962
Buggy source:
private void addDomainWideResourceAccess(Map<String,Object> params){
  String entityType=(String)params.get(ApiConstants.ENTITY_TYPE);
  Long entityId=(Long)params.get(ApiConstants.ENTITY_ID);
  Long domainId=(Long)params.get(ApiConstants.DOMAIN_ID);
  Boolean isRecursive=(Boolean)params.get(ApiConstants.SUBDOMAIN_ACCESS);
  if (AclEntityType.Network.toString().equals(entityType)) {
    createPolicyAndAddToDomainGroup("String_Node_Str" + entityId,"String_Node_Str",entityType,entityId,"String_Node_Str",AccessType.UseEntry,domainId,isRecursive);
  }
 else   if (AclEntityType.AffinityGroup.toString().equals(entityType)) {
    createPolicyAndAddToDomainGroup("String_Node_Str" + entityId,"String_Node_Str",entityType,entityId,"String_Node_Str",AccessType.UseEntry,domainId,isRecursive);
  }
}

Fixed version (ground truth):
private void addDomainWideResourceAccess(Map<String,Object> params){
  AclEntityType entityType=(AclEntityType)params.get(ApiConstants.ENTITY_TYPE);
  Long entityId=(Long)params.get(ApiConstants.ENTITY_ID);
  Long domainId=(Long)params.get(ApiConstants.DOMAIN_ID);
  Boolean isRecursive=(Boolean)params.get(ApiConstants.SUBDOMAIN_ACCESS);
  if (entityType == AclEntityType.Network) {
    createPolicyAndAddToDomainGroup("String_Node_Str" + entityId,"String_Node_Str",entityType.toString(),entityId,"String_Node_Str",AccessType.UseEntry,domainId,isRecursive);
  }
 else   if (entityType == AclEntityType.AffinityGroup) {
    createPolicyAndAddToDomainGroup("String_Node_Str" + entityId,"String_Node_Str",entityType.toString(),entityId,"String_Node_Str",AccessType.UseEntry,domainId,isRecursive);
  }
}
Program: 105963
Project: 105963
Buggy source:
@Override public List<AclGroup> listParentAclGroups(long groupId){
  AclGroup group=_aclGroupDao.findById(groupId);
  if (group == null) {
    throw new InvalidParameterValueException("String_Node_Str" + groupId);
  }
  String path=group.getPath();
  List<String> pathList=new ArrayList<String>();
  String[] parts=path.split("String_Node_Str");
  for (  String part : parts) {
    int start=path.indexOf(part);
    if (start > 0) {
      String subPath=path.substring(0,start);
      pathList.add(subPath);
    }
  }
  SearchBuilder<AclGroupVO> sb=_aclGroupDao.createSearchBuilder();
  sb.and("String_Node_Str",sb.entity().getPath(),SearchCriteria.Op.IN);
  SearchCriteria<AclGroupVO> sc=sb.create();
  sc.setParameters("String_Node_Str",pathList.toArray());
  List<AclGroupVO> groups=_aclGroupDao.search(sc,null);
  return new ArrayList<AclGroup>(groups);
}

Fixed version (ground truth):
@Override public List<AclGroup> listParentAclGroups(long groupId){
  AclGroup group=_aclGroupDao.findById(groupId);
  if (group == null) {
    throw new InvalidParameterValueException("String_Node_Str" + groupId);
  }
  String path=group.getPath();
  List<String> pathList=new ArrayList<String>();
  String[] parts=path.split("String_Node_Str");
  for (  String part : parts) {
    int start=path.indexOf(part);
    if (start > 0) {
      String subPath=path.substring(0,start);
      pathList.add(subPath);
    }
  }
  if (pathList.isEmpty()) {
    return new ArrayList<AclGroup>();
  }
  SearchBuilder<AclGroupVO> sb=_aclGroupDao.createSearchBuilder();
  sb.and("String_Node_Str",sb.entity().getPath(),SearchCriteria.Op.IN);
  SearchCriteria<AclGroupVO> sc=sb.create();
  sc.setParameters("String_Node_Str",pathList.toArray());
  List<AclGroupVO> groups=_aclGroupDao.search(sc,null);
  return new ArrayList<AclGroup>(groups);
}
Program: 105964
Project: 105964
Buggy source:
public static ImageFormat getFormat(String format){
  for (  ImageFormat fm : formats) {
    if (fm.equals(format)) {
      return fm;
    }
  }
  return ImageFormatHelper.defaultFormat;
}

Fixed version (ground truth):
public static ImageFormat getFormat(String format){
  for (  ImageFormat fm : formats) {
    if (fm.toString().equals(format)) {
      return fm;
    }
  }
  return ImageFormatHelper.defaultFormat;
}
Program: 105965
Project: 105965
Buggy source:
public MonitoringServiceDaoImpl(){
  super();
  AllFieldsSearch=createSearchBuilder();
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().isDefaultService(),SearchCriteria.Op.EQ);
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getService(),SearchCriteria.Op.EQ);
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getProcessname(),SearchCriteria.Op.EQ);
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getServiceName(),SearchCriteria.Op.EQ);
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getServicePath(),SearchCriteria.Op.EQ);
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getPidFile(),SearchCriteria.Op.EQ);
  AllFieldsSearch.done();
}

Fixed version (ground truth):
public MonitoringServiceDaoImpl(){
  super();
  AllFieldsSearch=createSearchBuilder();
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().isDefaultService(),SearchCriteria.Op.EQ);
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getService(),SearchCriteria.Op.EQ);
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getProcessName(),SearchCriteria.Op.EQ);
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getServiceName(),SearchCriteria.Op.EQ);
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getServicePath(),SearchCriteria.Op.EQ);
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getServicePidFile(),SearchCriteria.Op.EQ);
  AllFieldsSearch.done();
}
Program: 105966
Project: 105966
Buggy source:
@Override public String getServicePath(){
  return this.servicePidFile;
}

Fixed version (ground truth):
@Override public String getServicePath(){
  return servicePidFile;
}
Program: 105967
Project: 105967
Buggy source:
@Override public String getServiceName(){
  return this.servicename;
}

Fixed version (ground truth):
@Override public String getServiceName(){
  return serviceName;
}
Program: 105968
Project: 105968
Buggy source:
@Override public String getService(){
  return this.service;
}

Fixed version (ground truth):
@Override public String getService(){
  return service;
}
Program: 105969
Project: 105969
Buggy source:
public String getDetail(String name){
  if (details == null) {
    throw new CloudRuntimeException("String_Node_Str");
  }
  return details.get(name);
}

Fixed version (ground truth):
public String getDetail(String name){
}
Program: 105970
Project: 105970
Buggy source:
@Override public void startAgentHttpHandlerInVM(StartupProxyCommand startupCmd){
  StartConsoleProxyAgentHttpHandlerCommand cmd=null;
  String storePassword=String.valueOf(_random.nextLong());
  byte[] ksBits=_ksMgr.getKeystoreBits(ConsoleProxyManager.CERTIFICATE_NAME,ConsoleProxyManager.CERTIFICATE_NAME,storePassword);
  assert(ksBits != null);
  if (ksBits == null) {
    String msg="String_Node_Str";
    s_logger.error(msg);
    throw new CloudRuntimeException(msg);
  }
  cmd=new StartConsoleProxyAgentHttpHandlerCommand(ksBits,storePassword);
  cmd.setEncryptorPassword(getEncryptorPassword());
  try {
    HostVO consoleProxyHost=findConsoleProxyHost(startupCmd);
    assert(consoleProxyHost != null);
    Answer answer=_agentMgr.send(consoleProxyHost.getId(),cmd);
    if (answer == null || !answer.getResult()) {
      s_logger.error("String_Node_Str");
    }
 else {
      s_logger.info("String_Node_Str");
    }
  }
 catch (  AgentUnavailableException e) {
    s_logger.error("String_Node_Str" + startupCmd.getProxyVmId(),e);
  }
catch (  OperationTimedoutException e) {
    s_logger.error("String_Node_Str" + startupCmd.getProxyVmId(),e);
  }
catch (  OutOfMemoryError e) {
    s_logger.error("String_Node_Str");
    System.exit(1);
  }
catch (  Exception e) {
    s_logger.error("String_Node_Str" + startupCmd.getProxyVmId(),e);
  }
}

Fixed version (ground truth):
@Override public void startAgentHttpHandlerInVM(StartupProxyCommand startupCmd){
  StartConsoleProxyAgentHttpHandlerCommand cmd=null;
  String storePassword=String.valueOf(_random.nextLong());
  byte[] ksBits=_ksMgr.getKeystoreBits(ConsoleProxyManager.CERTIFICATE_NAME,ConsoleProxyManager.CERTIFICATE_NAME,storePassword);
  assert(ksBits != null);
  if (ksBits == null) {
    s_logger.error("String_Node_Str");
  }
  cmd=new StartConsoleProxyAgentHttpHandlerCommand(ksBits,storePassword);
  cmd.setEncryptorPassword(getEncryptorPassword());
  try {
    HostVO consoleProxyHost=findConsoleProxyHost(startupCmd);
    assert(consoleProxyHost != null);
    Answer answer=_agentMgr.send(consoleProxyHost.getId(),cmd);
    if (answer == null || !answer.getResult()) {
      s_logger.error("String_Node_Str");
    }
 else {
      s_logger.info("String_Node_Str");
    }
  }
 catch (  AgentUnavailableException e) {
    s_logger.error("String_Node_Str" + startupCmd.getProxyVmId(),e);
  }
catch (  OperationTimedoutException e) {
    s_logger.error("String_Node_Str" + startupCmd.getProxyVmId(),e);
  }
catch (  OutOfMemoryError e) {
    s_logger.error("String_Node_Str");
    System.exit(1);
  }
catch (  Exception e) {
    s_logger.error("String_Node_Str" + startupCmd.getProxyVmId(),e);
  }
}
Program: 105971
Project: 105971
Buggy source:
@Override public String getUuid(){
  return uuid;
}

Fixed version (ground truth):
@Override public String getUuid(){
  return this.uuid;
}
Program: 105972
Project: 105972
Buggy source:
@Override public boolean equals(Object obj){
  if (obj instanceof DedicatedResourceVO) {
    return ((DedicatedResourceVO)obj).getId() == getId();
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (obj instanceof DedicatedResourceVO) {
    return ((DedicatedResourceVO)obj).getId() == this.getId();
  }
 else {
    return false;
  }
}
Program: 105973
Project: 105973
Buggy source:
public DedicatedResourceVO(long dedicatedResourceId){
  id=dedicatedResourceId;
}

Fixed version (ground truth):
public DedicatedResourceVO(long dedicatedResourceId){
  this.id=dedicatedResourceId;
}
Program: 105974
Project: 105974
Buggy source:
@Override public boolean isPortableIpTransferableFromNetwork(long ipAddrId,long networkId){
  Network network=_networksDao.findById(networkId);
  if (network == null) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  IPAddressVO ip=_ipAddressDao.findById(ipAddrId);
  if (ip == null) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  List<PublicIpAddress> ipList=new ArrayList<PublicIpAddress>();
  PublicIp publicIp=PublicIp.createFromAddrAndVlan(ip,_vlanDao.findById(ip.getVlanId()));
  ipList.add(publicIp);
  Map<PublicIpAddress,Set<Service>> ipToServices=_networkModel.getIpToServices(ipList,false,true);
  if (ipToServices != null && !ipToServices.isEmpty()) {
    Set<Service> ipServices=ipToServices.get(publicIp);
    if (ipServices != null && !ipServices.isEmpty()) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean isPortableIpTransferableFromNetwork(long ipAddrId,long networkId){
  Network network=_networksDao.findById(networkId);
  if (network == null) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  IPAddressVO ip=_ipAddressDao.findById(ipAddrId);
  if (ip == null) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  List<PublicIpAddress> ipList=new ArrayList<PublicIpAddress>();
  PublicIp publicIp=PublicIp.createFromAddrAndVlan(ip,_vlanDao.findById(ip.getVlanId()));
  ipList.add(publicIp);
  Map<PublicIpAddress,Set<Service>> ipToServices=_networkModel.getIpToServices(ipList,false,true);
  if (ipToServices != null & !ipToServices.isEmpty()) {
    Set<Service> ipServices=ipToServices.get(publicIp);
    if (ipServices != null && !ipServices.isEmpty()) {
      return false;
    }
  }
  return true;
}
Program: 105977
Project: 105977
Buggy source:
@Override @DB public boolean disassociatePublicIpAddress(long addrId,long userId,Account caller){
  boolean success=true;
  if (!cleanupIpResources(addrId,userId,caller)) {
    success=false;
    s_logger.warn("String_Node_Str" + addrId);
  }
  IPAddressVO ip=markIpAsUnavailable(addrId);
  if (ip == null) {
    String msg="String_Node_Str" + addrId + "String_Node_Str";
    s_logger.error(msg);
    return true;
  }
  if (s_logger.isDebugEnabled()) {
    s_logger.debug("String_Node_Str" + addrId + "String_Node_Str"+ ip.isSourceNat());
  }
  if (ip.getAssociatedWithNetworkId() != null) {
    Network network=_networksDao.findById(ip.getAssociatedWithNetworkId());
    try {
      if (!applyIpAssociations(network,true)) {
        s_logger.warn("String_Node_Str" + network);
        success=false;
      }
    }
 catch (    ResourceUnavailableException e) {
      throw new CloudRuntimeException("String_Node_Str",e);
    }
  }
 else {
    if (ip.getState() == IpAddress.State.Releasing) {
      _ipAddressDao.unassignIpAddress(ip.getId());
    }
  }
  if (success) {
    if (ip.isPortable()) {
      releasePortableIpAddress(addrId);
    }
    s_logger.debug("String_Node_Str" + addrId);
  }
  return success;
}

Fixed version (ground truth):
@Override @DB public boolean disassociatePublicIpAddress(long addrId,long userId,Account caller){
}
Program: 105979
Project: 105979
Buggy source:
@DB @Override public PublicIp assignDedicateIpAddress(Account owner,final Long guestNtwkId,final Long vpcId,final long dcId,final boolean isSourceNat) throws ConcurrentOperationException, InsufficientAddressCapacityException {
  if (owner == null) {
    s_logger.error("String_Node_Str");
    return null;
  }
  final long ownerId=owner.getId();
  PublicIp ip=null;
  try {
    ip=Transaction.execute(new TransactionCallbackWithException<PublicIp,InsufficientAddressCapacityException>(){
      @Override public PublicIp doInTransaction(      TransactionStatus status) throws InsufficientAddressCapacityException {
        Account owner=_accountDao.acquireInLockTable(ownerId);
        if (owner == null) {
          ConcurrentOperationException ex=new ConcurrentOperationException("String_Node_Str");
          throw ex;
        }
        if (s_logger.isDebugEnabled()) {
          s_logger.debug("String_Node_Str" + ownerId + "String_Node_Str");
        }
        PublicIp ip=fetchNewPublicIp(dcId,null,null,owner,VlanType.VirtualNetwork,guestNtwkId,isSourceNat,false,null,false,vpcId);
        IPAddressVO publicIp=ip.ip();
        markPublicIpAsAllocated(publicIp);
        _ipAddressDao.update(publicIp.getId(),publicIp);
        return ip;
      }
    }
);
    return ip;
  }
  finally {
    if (s_logger.isDebugEnabled()) {
      s_logger.debug("String_Node_Str" + ownerId);
    }
    _accountDao.releaseFromLockTable(ownerId);
    if (ip == null) {
      s_logger.error("String_Node_Str" + ownerId);
    }
  }
}

Fixed version (ground truth):
@DB @Override public PublicIp assignDedicateIpAddress(Account owner,final Long guestNtwkId,final Long vpcId,final long dcId,final boolean isSourceNat) throws ConcurrentOperationException, InsufficientAddressCapacityException {
  final long ownerId=owner.getId();
  PublicIp ip=null;
  try {
    ip=Transaction.execute(new TransactionCallbackWithException<PublicIp,InsufficientAddressCapacityException>(){
      @Override public PublicIp doInTransaction(      TransactionStatus status) throws InsufficientAddressCapacityException {
        Account owner=_accountDao.acquireInLockTable(ownerId);
        if (owner == null) {
          ConcurrentOperationException ex=new ConcurrentOperationException("String_Node_Str");
          throw ex;
        }
        if (s_logger.isDebugEnabled()) {
          s_logger.debug("String_Node_Str" + ownerId + "String_Node_Str");
        }
        PublicIp ip=fetchNewPublicIp(dcId,null,null,owner,VlanType.VirtualNetwork,guestNtwkId,isSourceNat,false,null,false,vpcId);
        IPAddressVO publicIp=ip.ip();
        markPublicIpAsAllocated(publicIp);
        _ipAddressDao.update(publicIp.getId(),publicIp);
        return ip;
      }
    }
);
    return ip;
  }
  finally {
    if (owner != null) {
      if (s_logger.isDebugEnabled()) {
        s_logger.debug("String_Node_Str" + ownerId);
      }
      _accountDao.releaseFromLockTable(ownerId);
    }
    if (ip == null) {
      s_logger.error("String_Node_Str" + ownerId);
    }
  }
}
Program: 105980
Project: 105980
Buggy source:
@Override public Map<Service,Set<Provider>> getNetworkOfferingServiceProvidersMap(long networkOfferingId){
  Map<Service,Set<Provider>> serviceProviderMap=new HashMap<Service,Set<Provider>>();
  List<NetworkOfferingServiceMapVO> map=_ntwkOfferingSrvcDao.listByNetworkOfferingId(networkOfferingId);
  for (  NetworkOfferingServiceMapVO instance : map) {
    Service service=Network.Service.getService(instance.getService());
    Set<Provider> providers;
    providers=serviceProviderMap.get(service);
    if (providers == null) {
      providers=new HashSet<Provider>();
    }
    providers.add(Provider.getProvider(instance.getProvider()));
    serviceProviderMap.put(service,providers);
  }
  return serviceProviderMap;
}

Fixed version (ground truth):
@Override public Map<Service,Set<Provider>> getNetworkOfferingServiceProvidersMap(long networkOfferingId){
  Map<Service,Set<Provider>> serviceProviderMap=new HashMap<Service,Set<Provider>>();
  List<NetworkOfferingServiceMapVO> map=_ntwkOfferingSrvcDao.listByNetworkOfferingId(networkOfferingId);
  for (  NetworkOfferingServiceMapVO instance : map) {
    String service=instance.getService();
    Set<Provider> providers;
    providers=serviceProviderMap.get(service);
    if (providers == null) {
      providers=new HashSet<Provider>();
    }
    providers.add(Provider.getProvider(instance.getProvider()));
    serviceProviderMap.put(Service.getService(service),providers);
  }
  return serviceProviderMap;
}