nus-yam/ex-repair huggingface dataset:
Program: 106372
Project: 106372
Buggy source:
/** 
 * We build the path to where the keystore holding the WS-Security X509 certificates are stored.
 */
@Override public void init(ServletConfig config) throws ServletException {
  initComponent();
  File propertiesFile=ConfigurationHelper.findConfigurationFile("String_Node_Str");
  Properties EC2Prop=null;
  if (null != propertiesFile) {
    logger.info("String_Node_Str" + propertiesFile.getAbsolutePath());
    EC2Prop=new Properties();
    try {
      EC2Prop.load(new FileInputStream(propertiesFile));
    }
 catch (    FileNotFoundException e) {
      logger.warn("String_Node_Str" + propertiesFile.getAbsolutePath(),e);
    }
catch (    IOException e) {
      logger.warn("String_Node_Str" + propertiesFile.getAbsolutePath(),e);
    }
    String keystore=EC2Prop.getProperty("String_Node_Str");
    keystorePassword=EC2Prop.getProperty("String_Node_Str");
    wsdlVersion=EC2Prop.getProperty("String_Node_Str","String_Node_Str");
    version=EC2Prop.getProperty("String_Node_Str","String_Node_Str");
    String installedPath=System.getenv("String_Node_Str");
    if (installedPath == null)     installedPath=System.getenv("String_Node_Str");
    if (installedPath == null)     installedPath=System.getProperty("String_Node_Str");
    String webappPath=config.getServletContext().getRealPath("String_Node_Str");
    pathToKeystore=new String(webappPath + "String_Node_Str" + File.separator+ "String_Node_Str"+ File.separator+ keystore);
  }
}

Fixed version (ground truth):
/** 
 * We build the path to where the keystore holding the WS-Security X509 certificates are stored.
 */
@Override public void init(ServletConfig config) throws ServletException {
  SpringBeanAutowiringSupport.processInjectionBasedOnServletContext(this,config.getServletContext());
  File propertiesFile=ConfigurationHelper.findConfigurationFile("String_Node_Str");
  Properties EC2Prop=null;
  if (null != propertiesFile) {
    logger.info("String_Node_Str" + propertiesFile.getAbsolutePath());
    EC2Prop=new Properties();
    try {
      EC2Prop.load(new FileInputStream(propertiesFile));
    }
 catch (    FileNotFoundException e) {
      logger.warn("String_Node_Str" + propertiesFile.getAbsolutePath(),e);
    }
catch (    IOException e) {
      logger.warn("String_Node_Str" + propertiesFile.getAbsolutePath(),e);
    }
    String keystore=EC2Prop.getProperty("String_Node_Str");
    keystorePassword=EC2Prop.getProperty("String_Node_Str");
    wsdlVersion=EC2Prop.getProperty("String_Node_Str","String_Node_Str");
    version=EC2Prop.getProperty("String_Node_Str","String_Node_Str");
    String installedPath=System.getenv("String_Node_Str");
    if (installedPath == null)     installedPath=System.getenv("String_Node_Str");
    if (installedPath == null)     installedPath=System.getProperty("String_Node_Str");
    String webappPath=config.getServletContext().getRealPath("String_Node_Str");
    pathToKeystore=new String(webappPath + "String_Node_Str" + File.separator+ "String_Node_Str"+ File.separator+ keystore);
  }
}
Program: 106373
Project: 106373
Buggy source:
@Override public void init(ServletConfig config) throws ServletException {
  try {
    ConfigurationHelper.preConfigureConfigPathFromServletContext(config.getServletContext());
    String value=csDao.getConfigValue(ENABLE_S3_API);
    if (value != null) {
      isS3APIEnabled=Boolean.valueOf(value);
    }
    logger.info("String_Node_Str" + value);
  }
 catch (  Exception e) {
    throw new ServletException("String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
@Override public void init(ServletConfig config) throws ServletException {
  try {
    SpringBeanAutowiringSupport.processInjectionBasedOnServletContext(this,config.getServletContext());
    ConfigurationHelper.preConfigureConfigPathFromServletContext(config.getServletContext());
    String value=csDao.getConfigValue(ENABLE_S3_API);
    if (value != null) {
      isS3APIEnabled=Boolean.valueOf(value);
    }
    logger.info("String_Node_Str" + value);
  }
 catch (  Exception e) {
    throw new ServletException("String_Node_Str" + e.getMessage());
  }
}
Program: 106374
Project: 106374
Buggy source:
protected ServiceProvider() throws IOException {
  Transaction txn=Transaction.open(Transaction.AWSAPI_DB);
  txn.close();
  engine=new S3Engine();
  EC2_engine=new EC2Engine();
  serviceMap.put(AmazonS3SkeletonInterface.class,new S3SerializableServiceImplementation(engine));
  serviceMap.put(AmazonEC2SkeletonInterface.class,new EC2SoapServiceImpl(EC2_engine));
}

Fixed version (ground truth):
protected ServiceProvider() throws IOException {
  Transaction txn=Transaction.open(Transaction.AWSAPI_DB);
  txn.close();
  serviceMap.put(AmazonS3SkeletonInterface.class,new S3SerializableServiceImplementation(engine));
  serviceMap.put(AmazonEC2SkeletonInterface.class,new EC2SoapServiceImpl(EC2_engine));
}
Program: 106375
Project: 106375
Buggy source:
public synchronized static ServiceProvider getInstance(){
  if (instance == null) {
    try {
      instance=new ServiceProvider();
      instance.initialize();
    }
 catch (    Throwable e) {
      logger.error("String_Node_Str" + e.getMessage(),e);
    }
 finally {
    }
  }
  return instance;
}

Fixed version (ground truth):
public synchronized static ServiceProvider getInstance(){
  return instance;
}
Program: 106376
Project: 106376
Buggy source:
public EC2Engine() throws IOException {
  loadConfigValues();
}

Fixed version (ground truth):
public EC2Engine() throws IOException {
}
Program: 106377
Project: 106377
Buggy source:
/** 
 * This method assumes that the bucket has been tested to make sure it exists before it is called.
 * @param context 
 * @return S3BucketPolicy
 * @throws SQLException , ClassNotFoundException, IllegalAccessException, InstantiationException, ParseException 
 */
public static S3BucketPolicy loadPolicy(S3PolicyContext context) throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException, ParseException {
  OrderedPair<S3BucketPolicy,Integer> result=ServiceProvider.getInstance().getBucketPolicy(context.getBucketName());
  S3BucketPolicy policy=result.getFirst();
  if (null == policy) {
    if (-1 == result.getSecond().intValue()) {
      BucketPolicyVO policyvo=bPolicy.getByName(context.getBucketName());
      String policyInJson=null;
      if (null != policyvo)       policyInJson=policyvo.getPolicy();
      if (null == policyInJson) {
        ServiceProvider.getInstance().setBucketPolicy(context.getBucketName(),null);
        return null;
      }
      PolicyParser parser=new PolicyParser();
      policy=parser.parse(policyInJson,context.getBucketName());
      if (null != policy)       ServiceProvider.getInstance().setBucketPolicy(context.getBucketName(),policy);
    }
  }
  return policy;
}

Fixed version (ground truth):
/** 
 * This method assumes that the bucket has been tested to make sure it exists before it is called.
 * @param context 
 * @return S3BucketPolicy
 * @throws SQLException , ClassNotFoundException, IllegalAccessException, InstantiationException, ParseException 
 */
public static S3BucketPolicy loadPolicy(S3PolicyContext context) throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException, ParseException {
  OrderedPair<S3BucketPolicy,Integer> result=ServiceProvider.getInstance().getBucketPolicy(context.getBucketName());
  S3BucketPolicy policy=result.getFirst();
  if (null == policy) {
    if (-1 == result.getSecond().intValue()) {
      BucketPolicyVO policyvo=s_bPolicy.getByName(context.getBucketName());
      String policyInJson=null;
      if (null != policyvo)       policyInJson=policyvo.getPolicy();
      if (null == policyInJson) {
        ServiceProvider.getInstance().setBucketPolicy(context.getBucketName(),null);
        return null;
      }
      PolicyParser parser=new PolicyParser();
      policy=parser.parse(policyInJson,context.getBucketName());
      if (null != policy)       ServiceProvider.getInstance().setBucketPolicy(context.getBucketName(),policy);
    }
  }
  return policy;
}
Program: 106378
Project: 106378
Buggy source:
/** 
 * This method verifies that the accessing client has the requested permission on the object/bucket/Acl represented by the tuple: <target, targetId> For cases where an ACL is meant for any authenticated user we place a "*" for the Canonical User Id.  N.B. - "*" is not a legal Cloud (Bridge) Access key.    For cases where an ACL is meant for any anonymous user (or 'AllUsers') we place a "A" for the  Canonical User Id.  N.B. - "A" is not a legal Cloud (Bridge) Access key. 
 */
public static void accessAllowed(String target,long targetId,int requestedPermission){
  if (SAcl.PERMISSION_PASS == requestedPermission)   return;
  String userId=UserContext.current().getCanonicalUserId();
  if (0 == userId.length()) {
    if (hasPermission(saclDao.listGrants(target,targetId,"String_Node_Str"),requestedPermission))     return;
  }
 else {
    if (hasPermission(saclDao.listGrants(target,targetId,userId),requestedPermission))     return;
    if (hasPermission(saclDao.listGrants(target,targetId,"String_Node_Str"),requestedPermission))     return;
  }
  throw new PermissionDeniedException("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * This method verifies that the accessing client has the requested permission on the object/bucket/Acl represented by the tuple: <target, targetId> For cases where an ACL is meant for any authenticated user we place a "*" for the Canonical User Id.  N.B. - "*" is not a legal Cloud (Bridge) Access key.    For cases where an ACL is meant for any anonymous user (or 'AllUsers') we place a "A" for the  Canonical User Id.  N.B. - "A" is not a legal Cloud (Bridge) Access key. 
 */
public static void accessAllowed(String target,long targetId,int requestedPermission){
  if (SAcl.PERMISSION_PASS == requestedPermission)   return;
  String userId=UserContext.current().getCanonicalUserId();
  if (0 == userId.length()) {
    if (hasPermission(s_saclDao.listGrants(target,targetId,"String_Node_Str"),requestedPermission))     return;
  }
 else {
    if (hasPermission(s_saclDao.listGrants(target,targetId,userId),requestedPermission))     return;
    if (hasPermission(s_saclDao.listGrants(target,targetId,"String_Node_Str"),requestedPermission))     return;
  }
  throw new PermissionDeniedException("String_Node_Str");
}
Program: 106381
Project: 106381
Buggy source:
private static Long translateUuidToInternalId(String uuid,Parameter annotation){
  if (uuid.equals("String_Node_Str")) {
    return -1L;
  }
  Long internalId=null;
  boolean isPre3x=annotation.since().isEmpty();
  boolean isUuid=uuid.matches("String_Node_Str");
  if (!isPre3x && !isUuid)   return null;
  if (isPre3x && !isUuid) {
    try {
      internalId=Long.parseLong(uuid);
    }
 catch (    NumberFormatException e) {
      internalId=null;
    }
    if (internalId != null)     return internalId;
  }
  Class<?>[] entities=annotation.entityType()[0].getAnnotation(EntityReference.class).value();
  for (  Class<?> entity : entities) {
    Object objVO=s_instance._entityMgr.findByUuid(entity,uuid);
    if (objVO == null) {
      continue;
    }
    try {
      internalId=(Long)((InternalIdentity)objVO).getId();
    }
 catch (    IllegalArgumentException e) {
    }
catch (    NullPointerException e) {
    }
    if (internalId != null)     break;
  }
  if (internalId == null) {
    if (s_logger.isDebugEnabled()) {
      s_logger.debug("String_Node_Str" + uuid + "String_Node_Str");
    }
    throw new InvalidParameterValueException("String_Node_Str" + uuid + "String_Node_Str");
  }
  return internalId;
}

Fixed version (ground truth):
private static Long translateUuidToInternalId(String uuid,Parameter annotation){
  if (uuid.equals("String_Node_Str")) {
    return -1L;
  }
  Long internalId=null;
  boolean isPre3x=annotation.since().isEmpty();
  boolean isUuid=uuid.matches("String_Node_Str");
  if (!isPre3x && !isUuid)   return null;
  if (isPre3x && !isUuid) {
    try {
      internalId=Long.parseLong(uuid);
    }
 catch (    NumberFormatException e) {
      internalId=null;
    }
    if (internalId != null)     return internalId;
  }
  Class<?>[] entities=annotation.entityType()[0].getAnnotation(EntityReference.class).value();
  for (  Class<?> entity : entities) {
    Object objVO=s_instance._entityMgr.findByUuidIncludingRemoved(entity,uuid);
    if (objVO == null) {
      continue;
    }
    try {
      internalId=(Long)((InternalIdentity)objVO).getId();
    }
 catch (    IllegalArgumentException e) {
    }
catch (    NullPointerException e) {
    }
    if (internalId != null)     break;
  }
  if (internalId == null) {
    if (s_logger.isDebugEnabled())     s_logger.debug("String_Node_Str" + uuid + "String_Node_Str");
    throw new InvalidParameterValueException("String_Node_Str" + uuid + "String_Node_Str");
  }
  return internalId;
}
Program: 106382
Project: 106382
Buggy source:
@Override public boolean configure(String name,Map<String,Object> params) throws ConfigurationException {
  hostGuid=(String)params.get("String_Node_Str");
  _locator=ComponentLocator.getLocator("String_Node_Str");
  _simMgr=_locator.getManager(SimulatorManager.class);
  agentHost=getAgentMgr().getHost(hostGuid);
  return true;
}

Fixed version (ground truth):
@Override public boolean configure(String name,Map<String,Object> params) throws ConfigurationException {
  hostGuid=(String)params.get("String_Node_Str");
  _simMgr=ComponentContext.inject(SimulatorManagerImpl.class);
  agentHost=getAgentMgr().getHost(hostGuid);
  return true;
}
Program: 106383
Project: 106383
Buggy source:
@Override public void execute(){
  List<? extends DiskOffering> result=_mgr.searchForDiskOfferings(this);
  ListResponse<DiskOfferingResponse> response=new ListResponse<DiskOfferingResponse>();
  List<DiskOfferingResponse> diskOfferingResponses=new ArrayList<DiskOfferingResponse>();
  for (  DiskOffering offering : result) {
    DiskOfferingResponse diskOffResp=_responseGenerator.createDiskOfferingResponse(offering);
    diskOffResp.setObjectName("String_Node_Str");
    diskOfferingResponses.add(diskOffResp);
  }
  response.setResponses(diskOfferingResponses);
  response.setResponseName(getCommandName());
  this.setResponseObject(response);
}

Fixed version (ground truth):
@Override public void execute(){
  ListResponse<DiskOfferingResponse> response=_queryService.searchForDiskOfferings(this);
  response.setResponseName(getCommandName());
  this.setResponseObject(response);
}
Program: 106384
Project: 106384
Buggy source:
@Override public DiskOfferingResponse createDiskOfferingResponse(DiskOffering offering){
  DiskOfferingResponse diskOfferingResponse=new DiskOfferingResponse();
  diskOfferingResponse.setId(offering.getUuid());
  diskOfferingResponse.setName(offering.getName());
  diskOfferingResponse.setDisplayText(offering.getDisplayText());
  diskOfferingResponse.setCreated(offering.getCreated());
  diskOfferingResponse.setDiskSize(offering.getDiskSize() / (1024 * 1024 * 1024));
  if (offering.getDomainId() != null) {
    Domain domain=ApiDBUtils.findDomainById(offering.getDomainId());
    if (domain != null) {
      diskOfferingResponse.setDomain(domain.getName());
      diskOfferingResponse.setDomainId(domain.getUuid());
    }
  }
  diskOfferingResponse.setTags(offering.getTags());
  diskOfferingResponse.setCustomized(offering.isCustomized());
  diskOfferingResponse.setStorageType(offering.getUseLocalStorage() ? ServiceOffering.StorageType.local.toString() : ServiceOffering.StorageType.shared.toString());
  diskOfferingResponse.setObjectName("String_Node_Str");
  return diskOfferingResponse;
}

Fixed version (ground truth):
@Override public DiskOfferingResponse createDiskOfferingResponse(DiskOffering offering){
  DiskOfferingJoinVO vOffering=ApiDBUtils.newDiskOfferingView(offering);
  return ApiDBUtils.newDiskOfferingResponse(vOffering);
}
Program: 106386
Project: 106386
Buggy source:
private void createFirewallRulesCommands(List<? extends FirewallRule> rules,VirtualRouter router,Commands cmds,long guestNetworkId){
  List<FirewallRuleTO> rulesTO=null;
  if (rules != null) {
    rulesTO=new ArrayList<FirewallRuleTO>();
    for (    FirewallRule rule : rules) {
      IpAddress sourceIp=_networkMgr.getIp(rule.getSourceIpAddressId());
      if (rule.getSourceCidrList() == null && (rule.getPurpose() == Purpose.Firewall || rule.getPurpose() == Purpose.NetworkACL)) {
        _rulesDao.loadSourceCidrs((FirewallRuleVO)rule);
      }
      FirewallRuleTO ruleTO=new FirewallRuleTO(rule,null,sourceIp.getAddress().addr());
      rulesTO.add(ruleTO);
    }
  }
  SetFirewallRulesCommand cmd=new SetFirewallRulesCommand(rulesTO);
  cmd.setAccessDetail(NetworkElementCommand.ROUTER_IP,getRouterControlIp(router.getId()));
  cmd.setAccessDetail(NetworkElementCommand.ROUTER_GUEST_IP,getRouterIpInNetwork(guestNetworkId,router.getId()));
  cmd.setAccessDetail(NetworkElementCommand.ROUTER_NAME,router.getInstanceName());
  DataCenterVO dcVo=_dcDao.findById(router.getDataCenterIdToDeployIn());
  cmd.setAccessDetail(NetworkElementCommand.ZONE_NETWORK_TYPE,dcVo.getNetworkType().toString());
  cmds.addCommand(cmd);
}

Fixed version (ground truth):
private void createFirewallRulesCommands(List<? extends FirewallRule> rules,VirtualRouter router,Commands cmds,long guestNetworkId){
  List<FirewallRuleTO> rulesTO=null;
  if (rules != null) {
    rulesTO=new ArrayList<FirewallRuleTO>();
    for (    FirewallRule rule : rules) {
      IpAddress sourceIp=_networkModel.getIp(rule.getSourceIpAddressId());
      if (rule.getSourceCidrList() == null && (rule.getPurpose() == Purpose.Firewall || rule.getPurpose() == Purpose.NetworkACL)) {
        _rulesDao.loadSourceCidrs((FirewallRuleVO)rule);
      }
      FirewallRuleTO ruleTO=new FirewallRuleTO(rule,null,sourceIp.getAddress().addr());
      rulesTO.add(ruleTO);
    }
  }
  SetFirewallRulesCommand cmd=new SetFirewallRulesCommand(rulesTO);
  cmd.setAccessDetail(NetworkElementCommand.ROUTER_IP,getRouterControlIp(router.getId()));
  cmd.setAccessDetail(NetworkElementCommand.ROUTER_GUEST_IP,getRouterIpInNetwork(guestNetworkId,router.getId()));
  cmd.setAccessDetail(NetworkElementCommand.ROUTER_NAME,router.getInstanceName());
  DataCenterVO dcVo=_dcDao.findById(router.getDataCenterIdToDeployIn());
  cmd.setAccessDetail(NetworkElementCommand.ZONE_NETWORK_TYPE,dcVo.getNetworkType().toString());
  cmds.addCommand(cmd);
}
Program: 106387
Project: 106387
Buggy source:
/** 
 * List hosts for migrating the given VM. The API returns list of all hosts in the VM's cluster minus the current host and also a list of hosts that seem to have enough CPU and RAM capacity to host this VM.
 * @param Long vmId Id of The VM to migrate
 * @return Pair<List<? extends Host>, List<? extends Host>> List of all Hosts in VM's cluster and list of Hosts withenough capacity
 */
Pair<List<? extends Host>,List<? extends Host>> listHostsForMigrationOfVM(Long vmId,Long startIndex,Long pageSize);

Fixed version (ground truth):
/** 
 * List hosts for migrating the given VM. The API returns list of all hosts in the VM's cluster minus the current host and also a list of hosts that seem to have enough CPU and RAM capacity to host this VM.
 * @param Long vmId Id of The VM to migrate
 * @return Pair<List<? extends Host>, List<? extends Host>> List of all Hosts in VM's cluster and list of Hosts withenough capacity
 */
Pair<Pair<List<? extends Host>,Integer>,List<? extends Host>> listHostsForMigrationOfVM(Long vmId,Long startIndex,Long pageSize);
Program: 106388
Project: 106388
Buggy source:
@Override public void execute(){
  ListResponse<HostResponse> response=null;
  if (getVirtualMachineId() == null) {
    response=_queryService.searchForServers(this);
  }
 else {
    List<? extends Host> result=new ArrayList<Host>();
    List<? extends Host> hostsWithCapacity=new ArrayList<Host>();
    Pair<List<? extends Host>,List<? extends Host>> hostsForMigration=_mgr.listHostsForMigrationOfVM(getVirtualMachineId(),this.getStartIndex(),this.getPageSizeVal());
    result=hostsForMigration.first();
    hostsWithCapacity=hostsForMigration.second();
    response=new ListResponse<HostResponse>();
    List<HostResponse> hostResponses=new ArrayList<HostResponse>();
    for (    Host host : result) {
      HostResponse hostResponse=_responseGenerator.createHostResponse(host,getDetails());
      Boolean suitableForMigration=false;
      if (hostsWithCapacity.contains(host)) {
        suitableForMigration=true;
      }
      hostResponse.setSuitableForMigration(suitableForMigration);
      hostResponse.setObjectName("String_Node_Str");
      hostResponses.add(hostResponse);
    }
    response.setResponses(hostResponses);
  }
  response.setResponseName(getCommandName());
  this.setResponseObject(response);
}

Fixed version (ground truth):
@Override public void execute(){
  ListResponse<HostResponse> response=null;
  if (getVirtualMachineId() == null) {
    response=_queryService.searchForServers(this);
  }
 else {
    Pair<List<? extends Host>,Integer> result;
    List<? extends Host> hostsWithCapacity=new ArrayList<Host>();
    Pair<Pair<List<? extends Host>,Integer>,List<? extends Host>> hostsForMigration=_mgr.listHostsForMigrationOfVM(getVirtualMachineId(),this.getStartIndex(),this.getPageSizeVal());
    result=hostsForMigration.first();
    hostsWithCapacity=hostsForMigration.second();
    response=new ListResponse<HostResponse>();
    List<HostResponse> hostResponses=new ArrayList<HostResponse>();
    for (    Host host : result.first()) {
      HostResponse hostResponse=_responseGenerator.createHostResponse(host,getDetails());
      Boolean suitableForMigration=false;
      if (hostsWithCapacity.contains(host)) {
        suitableForMigration=true;
      }
      hostResponse.setSuitableForMigration(suitableForMigration);
      hostResponse.setObjectName("String_Node_Str");
      hostResponses.add(hostResponse);
    }
    response.setResponses(hostResponses,result.second());
  }
  response.setResponseName(getCommandName());
  this.setResponseObject(response);
}
Program: 106393
Project: 106393
Buggy source:
protected IpDeployer getIpDeployerForInlineMode(Network network){
  List<Provider> providers=_networkMgr.getProvidersForServiceInNetwork(network,Service.Firewall);
  if (providers == null) {
    s_logger.error("String_Node_Str" + network.getId());
    return null;
  }
  if (providers.size() != 1) {
    s_logger.error("String_Node_Str" + providers.size() + "String_Node_Str"+ network.getId());
    return null;
  }
  NetworkElement element=_networkMgr.getElementImplementingProvider(providers.get(0).getName());
  if (!(element instanceof IpDeployer)) {
    s_logger.error("String_Node_Str" + network.getName() + "String_Node_Str");
    return null;
  }
  s_logger.info("String_Node_Str" + element.getName() + "String_Node_Str"+ getName()+ "String_Node_Str"+ network.getId());
  return (IpDeployer)element;
}

Fixed version (ground truth):
protected IpDeployer getIpDeployerForInlineMode(Network network){
  List<Provider> providers=_networkMgr.getProvidersForServiceInNetwork(network,Service.Firewall);
  if (providers == null) {
    s_logger.error("String_Node_Str" + network.getId());
    return null;
  }
  if (providers.size() != 1) {
    s_logger.error("String_Node_Str" + providers.size() + "String_Node_Str"+ network.getId());
    return null;
  }
  NetworkElement element=_networkModel.getElementImplementingProvider(providers.get(0).getName());
  if (!(element instanceof IpDeployer)) {
    s_logger.error("String_Node_Str" + network.getName() + "String_Node_Str");
    return null;
  }
  s_logger.info("String_Node_Str" + element.getName() + "String_Node_Str"+ getName()+ "String_Node_Str"+ network.getId());
  return (IpDeployer)element;
}
Program: 106394
Project: 106394
Buggy source:
protected IpAddress allocateIP(Account ipOwner,boolean isSystem,long zoneId) throws ResourceAllocationException, InsufficientAddressCapacityException, ConcurrentOperationException {
  Account caller=UserContext.current().getCaller();
  _accountMgr.checkAccess(caller,null,false,ipOwner);
  DataCenter zone=_configMgr.getZone(zoneId);
  return _networkMgr.allocateIp(ipOwner,isSystem,caller,zone);
}

Fixed version (ground truth):
@Override @ActionEvent(eventType=EventTypes.EVENT_NET_IP_ASSIGN,eventDescription="String_Node_Str",create=true) public IpAddress allocateIP(Account ipOwner,boolean isSystem,long zoneId) throws ResourceAllocationException, InsufficientAddressCapacityException, ConcurrentOperationException {
  Account caller=UserContext.current().getCaller();
  _accountMgr.checkAccess(caller,null,false,ipOwner);
  long callerUserId=UserContext.current().getCallerUserId();
  DataCenter zone=_configMgr.getZone(zoneId);
  return _networkMgr.allocateIp(ipOwner,isSystem,caller,callerUserId,zone);
}
Program: 106395
Project: 106395
Buggy source:
@Override @DB public Network getNetwork(long id){
  return _networksDao.findById(id);
}

Fixed version (ground truth):
@Override public Network getNetwork(String networkUuid){
  return _networksDao.findByUuid(networkUuid);
}
Program: 106397
Project: 106397
Buggy source:
@Override public IpAddress allocateIP(Account ipOwner,long zoneId,Long networkId) throws ResourceAllocationException, InsufficientAddressCapacityException, ConcurrentOperationException {
  return null;
}

Fixed version (ground truth):
@Override public IpAddress allocateIP(Account ipOwner,boolean isSystem,long zoneId) throws ResourceAllocationException, InsufficientAddressCapacityException, ConcurrentOperationException {
  return null;
}
Program: 106398
Project: 106398
Buggy source:
@Override public IpAddress allocateIp(Account ipOwner,boolean isSystem,Account caller,DataCenter zone) throws ConcurrentOperationException, ResourceAllocationException, InsufficientAddressCapacityException {
  return null;
}

Fixed version (ground truth):
@Override public IpAddress allocateIp(Account ipOwner,boolean isSystem,Account caller,long callerId,DataCenter zone) throws ConcurrentOperationException, ResourceAllocationException, InsufficientAddressCapacityException {
  return null;
}
Program: 106401
Project: 106401
Buggy source:
protected StaticRoleBasedAPIAccessChecker(){
  super();
  for (  RoleType roleType : RoleType.values()) {
    s_roleBasedApisMap.put(roleType,new HashSet<String>());
  }
}

Fixed version (ground truth):
protected StaticRoleBasedAPIAccessChecker(){
  super();
  for (  RoleType roleType : RoleType.values())   s_roleBasedApisMap.put(roleType,new HashSet<String>());
}
Program: 106402
Project: 106402
Buggy source:
@Override public boolean configure(String name,Map<String,Object> params) throws ConfigurationException {
  super.configure(name,params);
  ComponentLocator locator=ComponentLocator.getLocator(ManagementServer.Name);
  List<PluggableService> services=locator.getAllPluggableServices();
  services.add((PluggableService)ComponentLocator.getComponent(ManagementServer.Name));
  Map<String,String> configPropertiesMap=new HashMap<String,String>();
  for (  PluggableService service : services) {
    configPropertiesMap.putAll(service.getProperties());
  }
  processConfigFiles(configPropertiesMap);
  return true;
}

Fixed version (ground truth):
@Override public boolean configure(String name,Map<String,Object> params) throws ConfigurationException {
  super.configure(name,params);
  ComponentLocator locator=ComponentLocator.getLocator(ManagementServer.Name);
  List<PluggableService> services=locator.getAllPluggableServices();
  services.add((PluggableService)ComponentLocator.getComponent(ManagementServer.Name));
  for (  PluggableService service : services) {
    processConfigFiles(service.getProperties(),service.getClass().toString());
    s_logger.info("String_Node_Str" + service.toString());
  }
  return true;
}
Program: 106403
Project: 106403
Buggy source:
private void processConfigFiles(Map<String,String> configMap){
  for (  Map.Entry<String,String> entry : configMap.entrySet()) {
    String apiName=entry.getKey();
    String roleMask=entry.getValue();
    try {
      short cmdPermissions=Short.parseShort(roleMask);
      for (      RoleType roleType : RoleType.values()) {
        if ((cmdPermissions & roleType.getValue()) != 0)         s_roleBasedApisMap.get(roleType).add(apiName);
      }
    }
 catch (    NumberFormatException nfe) {
      s_logger.info("String_Node_Str" + entry.toString());
    }
  }
}

Fixed version (ground truth):
private void processConfigFiles(Map<String,String> configMap,String service){
  for (  Map.Entry<String,String> entry : configMap.entrySet()) {
    String apiName=entry.getKey();
    String roleMask=entry.getValue();
    try {
      short cmdPermissions=Short.parseShort(roleMask);
      for (      RoleType roleType : RoleType.values()) {
        if ((cmdPermissions & roleType.getValue()) != 0)         s_roleBasedApisMap.get(roleType).add(apiName);
      }
    }
 catch (    NumberFormatException nfe) {
      s_logger.info("String_Node_Str" + service + "String_Node_Str"+ entry.toString());
    }
  }
}
Program: 106404
Project: 106404
Buggy source:
@PostConstruct void init(){
  _managers.add(_checkPointMgr);
  _managers.add(_clusterMgr);
  _managers.add(_clusterFenceMgr);
  _managers.add(_AgentMgr);
  _managers.add(_sycnQueueMgr);
  _managers.add(_jobMgr);
  _managers.add(_confMgr);
  _managers.add(_accountMgr);
  _managers.add(_domainMgr);
  _managers.add(_resLimitMgr);
  _managers.add(_networkMgr);
  _managers.add(_downloadMonitor);
  _managers.add(_uploadMonitor);
  _managers.add(_ksMgr);
  _managers.add(_ssMgr);
  _managers.add(_userVmMgr);
  _managers.add(_upgradeMgr);
  _managers.add(_storageMgr);
  _managers.add(_alertMgr);
  _managers.add(_tmplMgr);
  _managers.add(_snpahsotMgr);
  _managers.add(_snapshotScheduleMgr);
  _managers.add(_sgMgr);
  _managers.add(_entityMgr);
  _managers.add(_lbRuleMgr);
  _managers.add(_asMgr);
  _managers.add(_rulesMgr);
  _managers.add(_acVpnMgr);
  _managers.add(_capacityMgr);
  _managers.add(_vmMgr);
  _managers.add(_hvGuruMgr);
  _managers.add(_resMgr);
  _managers.add(_ocfsMgr);
  _managers.add(_fwMgr);
  _managers.add(_cpMgr);
  _managers.add(_prjMgr);
  _managers.add(_swiftMgr);
  _managers.add(_s3Mgr);
  _managers.add(_storageNetworkMgr);
  _managers.add(_extlbUsageMgr);
  _managers.add(_haMgr);
  _managers.add(_vpcMgr);
  _managers.add(_vpcNetApplianceMgr);
  _managers.add(_networkAclMgr);
  _managers.add(_taggedResMgr);
  _managers.add(_s2sVpnMgr);
  _managers.add(_queryMgr);
}

Fixed version (ground truth):
@PostConstruct void init(){
  _managers.add(_clusterMgr);
  _managers.add(_clusterFenceMgr);
  _managers.add(_AgentMgr);
  _managers.add(_sycnQueueMgr);
  _managers.add(_jobMgr);
  _managers.add(_confMgr);
  _managers.add(_accountMgr);
  _managers.add(_domainMgr);
  _managers.add(_resLimitMgr);
  _managers.add(_networkMgr);
  _managers.add(_downloadMonitor);
  _managers.add(_uploadMonitor);
  _managers.add(_ksMgr);
  _managers.add(_ssMgr);
  _managers.add(_userVmMgr);
  _managers.add(_upgradeMgr);
  _managers.add(_storageMgr);
  _managers.add(_alertMgr);
  _managers.add(_tmplMgr);
  _managers.add(_snpahsotMgr);
  _managers.add(_snapshotScheduleMgr);
  _managers.add(_sgMgr);
  _managers.add(_entityMgr);
  _managers.add(_lbRuleMgr);
  _managers.add(_asMgr);
  _managers.add(_rulesMgr);
  _managers.add(_acVpnMgr);
  _managers.add(_capacityMgr);
  _managers.add(_vmMgr);
  _managers.add(_hvGuruMgr);
  _managers.add(_resMgr);
  _managers.add(_ocfsMgr);
  _managers.add(_fwMgr);
  _managers.add(_cpMgr);
  _managers.add(_prjMgr);
  _managers.add(_swiftMgr);
  _managers.add(_s3Mgr);
  _managers.add(_storageNetworkMgr);
  _managers.add(_extlbUsageMgr);
  _managers.add(_haMgr);
  _managers.add(_vpcMgr);
  _managers.add(_vpcNetApplianceMgr);
  _managers.add(_networkAclMgr);
  _managers.add(_taggedResMgr);
  _managers.add(_s2sVpnMgr);
  _managers.add(_queryMgr);
}
Program: 106405
Project: 106405
Buggy source:
public static String genAccessTicket(String host,String port,String sid,String tag,Date normalizedHashTime){
  String params="String_Node_Str" + host + "String_Node_Str"+ port+ "String_Node_Str"+ sid+ "String_Node_Str"+ tag;
  try {
    Mac mac=Mac.getInstance("String_Node_Str");
    long ts=normalizedHashTime.getTime();
    ts=ts / 60000;
    String secretKey=_ms.getHashKey();
    SecretKeySpec keySpec=new SecretKeySpec(secretKey.getBytes(),"String_Node_Str");
    mac.init(keySpec);
    mac.update(params.getBytes());
    mac.update(String.valueOf(ts).getBytes());
    byte[] encryptedBytes=mac.doFinal();
    return Base64.encodeBase64String(encryptedBytes);
  }
 catch (  Exception e) {
    s_logger.error("String_Node_Str",e);
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
public static String genAccessTicket(String host,String port,String sid,String tag,Date normalizedHashTime){
  String params="String_Node_Str" + host + "String_Node_Str"+ port+ "String_Node_Str"+ sid+ "String_Node_Str"+ tag;
  try {
    Mac mac=Mac.getInstance("String_Node_Str");
    long ts=normalizedHashTime.getTime();
    ts=ts / 60000;
    String secretKey=s_ms.getHashKey();
    SecretKeySpec keySpec=new SecretKeySpec(secretKey.getBytes(),"String_Node_Str");
    mac.init(keySpec);
    mac.update(params.getBytes());
    mac.update(String.valueOf(ts).getBytes());
    byte[] encryptedBytes=mac.doFinal();
    return Base64.encodeBase64String(encryptedBytes);
  }
 catch (  Exception e) {
    s_logger.error("String_Node_Str",e);
  }
  return "String_Node_Str";
}
Program: 106406
Project: 106406
Buggy source:
/** 
 * @param args - name of server-setup.xml file which contains the bootstrap data
 */
public static void main(String[] args){
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  File file=PropertiesUtil.findConfigFile("String_Node_Str");
  if (file != null) {
    System.out.println("String_Node_Str" + file.getAbsolutePath());
    DOMConfigurator.configureAndWatch(file.getAbsolutePath(),10000);
  }
 else {
    System.out.println("String_Node_Str");
  }
  if (args.length < 1) {
    s_logger.error("String_Node_Str");
  }
 else {
    try {
      DatabaseConfig config=ComponentContext.inject(DatabaseConfig.class,args[0]);
      config.doVersionCheck();
      config.doConfig();
      System.exit(0);
    }
 catch (    Exception ex) {
      System.out.print("String_Node_Str");
      ex.printStackTrace();
      s_logger.error("String_Node_Str",ex);
    }
  }
}

Fixed version (ground truth):
/** 
 * @param args - name of server-setup.xml file which contains the bootstrap data
 */
public static void main(String[] args){
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  File file=PropertiesUtil.findConfigFile("String_Node_Str");
  if (file != null) {
    System.out.println("String_Node_Str" + file.getAbsolutePath());
    DOMConfigurator.configureAndWatch(file.getAbsolutePath(),10000);
  }
 else {
    System.out.println("String_Node_Str");
  }
  if (args.length < 1) {
    s_logger.error("String_Node_Str");
  }
 else {
    try {
      DatabaseConfig config=ComponentContext.inject(DatabaseConfig.class);
      config.doVersionCheck();
      config.doConfig();
      System.exit(0);
    }
 catch (    Exception ex) {
      System.out.print("String_Node_Str");
      ex.printStackTrace();
      s_logger.error("String_Node_Str",ex);
    }
  }
}
Program: 106407
Project: 106407
Buggy source:
public void tstLocking(){
  int testThreads=20;
  Thread[] threads=new Thread[testThreads];
  for (int i=0; i < testThreads; i++) {
    final int current=i;
    threads[i]=new Thread(new Runnable(){
      @Override public void run(){
        final HostDao hostDao=new HostDaoImpl();
        while (true) {
          Transaction txn=Transaction.currentTxn();
          try {
            HostVO host=hostDao.acquireInLockTable(getRandomLockId(),10);
            if (host != null) {
              s_logger.info("String_Node_Str" + (current + 1) + "String_Node_Str");
              try {
                Thread.sleep(getRandomMilliseconds(1000,5000));
              }
 catch (              InterruptedException e) {
              }
              s_logger.info("String_Node_Str" + (current + 1) + "String_Node_Str");
              hostDao.releaseFromLockTable(host.getId());
              try {
                Thread.sleep(getRandomMilliseconds(1000,5000));
              }
 catch (              InterruptedException e) {
              }
            }
 else {
              s_logger.info("String_Node_Str" + (current + 1) + "String_Node_Str");
            }
          }
  finally {
            txn.close();
          }
        }
      }
    }
);
    threads[i].start();
  }
  try {
    for (int i=0; i < testThreads; i++)     threads[i].join();
  }
 catch (  InterruptedException e) {
  }
}

Fixed version (ground truth):
public void tstLocking(){
  int testThreads=20;
  Thread[] threads=new Thread[testThreads];
  for (int i=0; i < testThreads; i++) {
    final int current=i;
    threads[i]=new Thread(new Runnable(){
      @Override public void run(){
        final HostDao hostDao=new HostDaoImpl();
        while (true) {
          Transaction txn=Transaction.currentTxn();
          try {
            HostVO host=hostDao.acquireInLockTable(getRandomLockId(),10);
            if (host != null) {
              s_logger.info("String_Node_Str" + (current + 1) + "String_Node_Str");
              try {
                Thread.sleep(1000);
              }
 catch (              InterruptedException e) {
              }
              s_logger.info("String_Node_Str" + (current + 1) + "String_Node_Str");
              hostDao.releaseFromLockTable(host.getId());
              try {
                Thread.sleep(1000);
              }
 catch (              InterruptedException e) {
              }
            }
 else {
              s_logger.info("String_Node_Str" + (current + 1) + "String_Node_Str");
            }
          }
  finally {
            txn.close();
          }
        }
      }
    }
);
    threads[i].start();
  }
  try {
    for (int i=0; i < testThreads; i++)     threads[i].join();
  }
 catch (  InterruptedException e) {
  }
}
Program: 106408
Project: 106408
Buggy source:
@Override public void run(){
  final HostDao hostDao=new HostDaoImpl();
  while (true) {
    Transaction txn=Transaction.currentTxn();
    try {
      HostVO host=hostDao.acquireInLockTable(getRandomLockId(),10);
      if (host != null) {
        s_logger.info("String_Node_Str" + (current + 1) + "String_Node_Str");
        try {
          Thread.sleep(getRandomMilliseconds(1000,5000));
        }
 catch (        InterruptedException e) {
        }
        s_logger.info("String_Node_Str" + (current + 1) + "String_Node_Str");
        hostDao.releaseFromLockTable(host.getId());
        try {
          Thread.sleep(getRandomMilliseconds(1000,5000));
        }
 catch (        InterruptedException e) {
        }
      }
 else {
        s_logger.info("String_Node_Str" + (current + 1) + "String_Node_Str");
      }
    }
  finally {
      txn.close();
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  final HostDao hostDao=new HostDaoImpl();
  while (true) {
    Transaction txn=Transaction.currentTxn();
    try {
      HostVO host=hostDao.acquireInLockTable(getRandomLockId(),10);
      if (host != null) {
        s_logger.info("String_Node_Str" + (current + 1) + "String_Node_Str");
        try {
          Thread.sleep(1000);
        }
 catch (        InterruptedException e) {
        }
        s_logger.info("String_Node_Str" + (current + 1) + "String_Node_Str");
        hostDao.releaseFromLockTable(host.getId());
        try {
          Thread.sleep(1000);
        }
 catch (        InterruptedException e) {
        }
      }
 else {
        s_logger.info("String_Node_Str" + (current + 1) + "String_Node_Str");
      }
    }
  finally {
      txn.close();
    }
  }
}
Program: 106409
Project: 106409
Buggy source:
public void testDomain(){
  getRandomMilliseconds(1,100);
  DomainDao domainDao=new DomainDaoImpl();
  DomainVO domain1=new DomainVO("String_Node_Str",2L,1L,null);
  domainDao.create(domain1);
  DomainVO domain2=new DomainVO("String_Node_Str",2L,1L,null);
  domainDao.create(domain2);
  DomainVO domain3=new DomainVO("String_Node_Str",2L,1L,null);
  domainDao.create(domain3);
  DomainVO domain11=new DomainVO("String_Node_Str",2L,domain1.getId(),null);
  domainDao.create(domain11);
  domainDao.remove(domain11.getId());
  DomainVO domain12=new DomainVO("String_Node_Str",2L,domain1.getId(),null);
  domainDao.create(domain12);
  domainDao.remove(domain3.getId());
  DomainVO domain4=new DomainVO("String_Node_Str",2L,1L,null);
  domainDao.create(domain4);
}

Fixed version (ground truth):
public void testDomain(){
  DomainDao domainDao=new DomainDaoImpl();
  DomainVO domain1=new DomainVO("String_Node_Str",2L,1L,null);
  domainDao.create(domain1);
  DomainVO domain2=new DomainVO("String_Node_Str",2L,1L,null);
  domainDao.create(domain2);
  DomainVO domain3=new DomainVO("String_Node_Str",2L,1L,null);
  domainDao.create(domain3);
  DomainVO domain11=new DomainVO("String_Node_Str",2L,domain1.getId(),null);
  domainDao.create(domain11);
  domainDao.remove(domain11.getId());
  DomainVO domain12=new DomainVO("String_Node_Str",2L,domain1.getId(),null);
  domainDao.create(domain12);
  domainDao.remove(domain3.getId());
  DomainVO domain4=new DomainVO("String_Node_Str",2L,1L,null);
  domainDao.create(domain4);
}
Program: 106412
Project: 106412
Buggy source:
@Override public void run(){
  while (count < totalRuns * queues) {
    List<SyncQueueItemVO> l=mgr.dequeueFromAny(1L,itemsPerRun);
    if (l != null && l.size() > 0) {
      s_logger.info("String_Node_Str" + l.size() + "String_Node_Str");
      for (      SyncQueueItemVO item : l) {
        s_logger.info("String_Node_Str" + item.toString());
        count++;
        mgr.purgeItem(item.getId());
      }
    }
    try {
      Thread.sleep(getRandomMilliseconds(1,10));
    }
 catch (    InterruptedException e) {
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  while (count < totalRuns * queues) {
    List<SyncQueueItemVO> l=mgr.dequeueFromAny(1L,itemsPerRun);
    if (l != null && l.size() > 0) {
      s_logger.info("String_Node_Str" + l.size() + "String_Node_Str");
      for (      SyncQueueItemVO item : l) {
        s_logger.info("String_Node_Str" + item.toString());
        count++;
        mgr.purgeItem(item.getId());
      }
    }
    try {
      Thread.sleep(100);
    }
 catch (    InterruptedException e) {
    }
  }
}
Program: 106413
Project: 106413
Buggy source:
@Before @Override public void setUp(){
  MockComponentLocator locator=new MockComponentLocator("String_Node_Str");
  locator.addDao("String_Node_Str",ConfigurationDaoImpl.class);
  locator.addDao("String_Node_Str",SecurityGroupDaoImpl.class);
  locator.addDao("String_Node_Str",SecurityGroupRuleDaoImpl.class);
  locator.addDao("String_Node_Str",SecurityGroupJoinDaoImpl.class);
  locator.addDao("String_Node_Str",SecurityGroupVMMapDaoImpl.class);
  locator.addDao("String_Node_Str",SecurityGroupRulesDaoImpl.class);
  locator.addDao("String_Node_Str",UserVmDaoImpl.class);
  locator.addDao("String_Node_Str",AccountDaoImpl.class);
  locator.addDao("String_Node_Str",ConfigurationDaoImpl.class);
  locator.addDao("String_Node_Str",SecurityGroupWorkDaoImpl.class);
  locator.addDao("String_Node_Str",VmRulesetLogDaoImpl.class);
  locator.addDao("String_Node_Str",VMInstanceDaoImpl.class);
  locator.addDao("String_Node_Str",DomainDaoImpl.class);
  locator.addDao("String_Node_Str",UsageEventDaoImpl.class);
  locator.addDao("String_Node_Str",ResourceTagsDaoImpl.class);
  locator.addManager("String_Node_Str",MockAgentManagerImpl.class);
  locator.addManager("String_Node_Str",MockVirtualMachineManagerImpl.class);
  locator.addManager("String_Node_Str",MockUserVmManagerImpl.class);
  locator.addManager("String_Node_Str",MockNetworkManagerImpl.class);
  locator.addManager("String_Node_Str",MockAccountManagerImpl.class);
  locator.addManager("String_Node_Str",MockDomainManagerImpl.class);
  locator.addManager("String_Node_Str",MockProjectManagerImpl.class);
  locator.makeActive(new DefaultInterceptorLibrary());
  _sgMgr=ComponentLocator.inject(SecurityGroupManagerImpl2.class);
  _sgMgr._mBean=new SecurityManagerMBeanImpl(_sgMgr);
}

Fixed version (ground truth):
@Before @Override public void setUp(){
}
Program: 106414
Project: 106414
Buggy source:
public void testListBy(){
  SnapshotDaoImpl dao=ComponentLocator.inject(SnapshotDaoImpl.class);
  List<SnapshotVO> snapshots=dao.listByInstanceId(3,Snapshot.Status.BackedUp);
  for (  SnapshotVO snapshot : snapshots) {
    Assert.assertTrue(snapshot.getStatus() == Snapshot.Status.BackedUp);
  }
}

Fixed version (ground truth):
public void testListBy(){
  List<SnapshotVO> snapshots=dao.listByInstanceId(3,Snapshot.Status.BackedUp);
  for (  SnapshotVO snapshot : snapshots) {
    Assert.assertTrue(snapshot.getStatus() == Snapshot.Status.BackedUp);
  }
}
Program: 106415
Project: 106415
Buggy source:
public void testCountByStatus(){
  StoragePoolDaoImpl dao=ComponentLocator.inject(StoragePoolDaoImpl.class);
  long count=dao.countPoolsByStatus(StoragePoolStatus.Up);
  System.out.println("String_Node_Str" + count + "String_Node_Str");
}

Fixed version (ground truth):
public void testCountByStatus(){
  long count=dao.countPoolsByStatus(StoragePoolStatus.Up);
  System.out.println("String_Node_Str" + count + "String_Node_Str");
}
Program: 106416
Project: 106416
Buggy source:
public static void setComponents(ResponseGenerator generator){
}

Fixed version (ground truth):
public static void setComponents(ResponseGenerator generator){
  ComponentLocator locator=ComponentLocator.getLocator(ManagementService.Name);
  _mgr=(ManagementService)ComponentLocator.getComponent(ManagementService.Name);
  _accountService=locator.getManager(AccountService.class);
  _configService=locator.getManager(ConfigurationService.class);
  _userVmService=locator.getManager(UserVmService.class);
  _storageService=locator.getManager(StorageService.class);
  _resourceService=locator.getManager(ResourceService.class);
  _networkService=locator.getManager(NetworkService.class);
  _templateService=locator.getManager(TemplateService.class);
  _securityGroupService=locator.getManager(SecurityGroupService.class);
  _snapshotService=locator.getManager(SnapshotService.class);
  _consoleProxyService=locator.getManager(ConsoleProxyService.class);
  _routerService=locator.getManager(VpcVirtualNetworkApplianceService.class);
  _entityMgr=locator.getManager(EntityManager.class);
  _rulesService=locator.getManager(RulesService.class);
  _lbService=locator.getManager(LoadBalancingRulesService.class);
  _autoScaleService=locator.getManager(AutoScaleService.class);
  _ravService=locator.getManager(RemoteAccessVpnService.class);
  _responseGenerator=generator;
  _bareMetalVmService=locator.getManager(BareMetalVmService.class);
  _projectService=locator.getManager(ProjectService.class);
  _firewallService=locator.getManager(FirewallService.class);
  _domainService=locator.getManager(DomainService.class);
  _resourceLimitService=locator.getManager(ResourceLimitService.class);
  _identityService=locator.getManager(IdentityService.class);
  _storageNetworkService=locator.getManager(StorageNetworkService.class);
  _taggedResourceService=locator.getManager(TaggedResourceService.class);
  _vpcService=locator.getManager(VpcService.class);
  _networkACLService=locator.getManager(NetworkACLService.class);
  _s2sVpnService=locator.getManager(Site2SiteVpnService.class);
  _queryService=locator.getManager(QueryService.class);
}