Program: 107316
Project: 107316
Buggy source:
protected Map<String,Object> createProxyInstance2(long dataCenterId) throws ConcurrentOperationException {
  long id=_consoleProxyDao.getNextInSequence(Long.class,"String_Node_Str");
  String name=VirtualMachineName.getConsoleProxyName(id,_instance);
  DataCenterVO dc=_dcDao.findById(dataCenterId);
  Account systemAcct=_accountMgr.getSystemAccount();
  DataCenterDeployment plan=new DataCenterDeployment(dataCenterId);
  List<NetworkOfferingVO> defaultOffering=_networkMgr.getSystemAccountNetworkOfferings(NetworkOfferingVO.SystemVmPublicNetwork);
  List<NetworkOfferingVO> offerings=_networkMgr.getSystemAccountNetworkOfferings(NetworkOfferingVO.SystemVmControlNetwork,NetworkOfferingVO.SystemVmManagementNetwork);
  List<Pair<NetworkVO,NicProfile>> networks=new ArrayList<Pair<NetworkVO,NicProfile>>(offerings.size() + 1);
  NicProfile defaultNic=new NicProfile();
  defaultNic.setDefaultNic(true);
  defaultNic.setDeviceId(2);
  networks.add(new Pair<NetworkVO,NicProfile>(_networkMgr.setupNetwork(systemAcct,defaultOffering.get(0),plan,null,null,false).get(0),defaultNic));
  for (  NetworkOfferingVO offering : offerings) {
    networks.add(new Pair<NetworkVO,NicProfile>(_networkMgr.setupNetwork(systemAcct,offering,plan,null,null,false).get(0),null));
  }
  ConsoleProxyVO proxy=new ConsoleProxyVO(id,_serviceOffering.getId(),name,_template.getId(),_template.getGuestOSId(),dataCenterId,systemAcct.getDomainId(),systemAcct.getId(),0);
  try {
    proxy=_itMgr.allocate(proxy,_template,_serviceOffering,networks,plan,systemAcct);
  }
 catch (  InsufficientCapacityException e) {
    s_logger.warn("String_Node_Str",e);
    throw new CloudRuntimeException("String_Node_Str",e);
  }
catch (  StorageUnavailableException e) {
    s_logger.warn("String_Node_Str",e);
    throw new CloudRuntimeException("String_Node_Str",e);
  }
catch (  ResourceUnavailableException e) {
    s_logger.warn("String_Node_Str",e);
    throw new CloudRuntimeException("String_Node_Str",e);
  }
  Map<String,Object> context=new HashMap<String,Object>();
  context.put("String_Node_Str",dc);
  HostPodVO pod=_podDao.findById(proxy.getPodId());
  context.put("String_Node_Str",pod);
  context.put("String_Node_Str",proxy.getId());
  return context;
}

Fixed version (ground truth):
protected Map<String,Object> createProxyInstance2(long dataCenterId) throws ConcurrentOperationException {
  long id=_consoleProxyDao.getNextInSequence(Long.class,"String_Node_Str");
  String name=VirtualMachineName.getConsoleProxyName(id,_instance);
  DataCenterVO dc=_dcDao.findById(dataCenterId);
  Account systemAcct=_accountMgr.getSystemAccount();
  DataCenterDeployment plan=new DataCenterDeployment(dataCenterId);
  List<NetworkOfferingVO> defaultOffering=_networkMgr.getSystemAccountNetworkOfferings(NetworkOfferingVO.SystemVmPublicNetwork);
  List<NetworkOfferingVO> offerings=_networkMgr.getSystemAccountNetworkOfferings(NetworkOfferingVO.SystemVmControlNetwork,NetworkOfferingVO.SystemVmManagementNetwork);
  List<Pair<NetworkVO,NicProfile>> networks=new ArrayList<Pair<NetworkVO,NicProfile>>(offerings.size() + 1);
  NicProfile defaultNic=new NicProfile();
  defaultNic.setDefaultNic(true);
  defaultNic.setDeviceId(2);
  networks.add(new Pair<NetworkVO,NicProfile>(_networkMgr.setupNetwork(systemAcct,defaultOffering.get(0),plan,null,null,false).get(0),defaultNic));
  for (  NetworkOfferingVO offering : offerings) {
    networks.add(new Pair<NetworkVO,NicProfile>(_networkMgr.setupNetwork(systemAcct,offering,plan,null,null,false).get(0),null));
  }
  ConsoleProxyVO proxy=new ConsoleProxyVO(id,_serviceOffering.getId(),name,_template.getId(),_template.getGuestOSId(),dataCenterId,systemAcct.getDomainId(),systemAcct.getId(),0);
  try {
    proxy=_itMgr.allocate(proxy,_template,_serviceOffering,networks,plan,null,systemAcct);
  }
 catch (  InsufficientCapacityException e) {
    s_logger.warn("String_Node_Str",e);
    throw new CloudRuntimeException("String_Node_Str",e);
  }
catch (  StorageUnavailableException e) {
    s_logger.warn("String_Node_Str",e);
    throw new CloudRuntimeException("String_Node_Str",e);
  }
catch (  ResourceUnavailableException e) {
    s_logger.warn("String_Node_Str",e);
    throw new CloudRuntimeException("String_Node_Str",e);
  }
  Map<String,Object> context=new HashMap<String,Object>();
  context.put("String_Node_Str",dc);
  HostPodVO pod=_podDao.findById(proxy.getPodId());
  context.put("String_Node_Str",pod);
  context.put("String_Node_Str",proxy.getId());
  return context;
}