nus-yam/ex-repair huggingface dataset:
Program: 106313
Project: 106313
Buggy source:
@Override public List<StoragePool> select(DiskProfile dskCh,VirtualMachineProfile<? extends VirtualMachine> vmProfile,DeploymentPlan plan,ExcludeList avoid,int returnUpTo){
  if (!_storagePoolCleanupEnabled) {
    s_logger.debug("String_Node_Str");
    return null;
  }
  storageMgr.cleanupStorage(false);
  StoragePoolAllocator allocator;
  if (dskCh.useLocalStorage()) {
    allocator=_localStoragePoolAllocator;
  }
 else {
    allocator=_firstFitStoragePoolAllocator;
  }
  ExcludeList myAvoids=new ExcludeList(avoid.getDataCentersToAvoid(),avoid.getPodsToAvoid(),avoid.getClustersToAvoid(),avoid.getHostsToAvoid(),avoid.getPoolsToAvoid());
  return allocator.allocateToPool(dskCh,vmProfile,plan,myAvoids,returnUpTo);
}

Fixed version (ground truth):
@Override public List<StoragePool> select(DiskProfile dskCh,VirtualMachineProfile<? extends VirtualMachine> vmProfile,DeploymentPlan plan,ExcludeList avoid,int returnUpTo){
  s_logger.debug("String_Node_Str");
  if (!_storagePoolCleanupEnabled) {
    s_logger.debug("String_Node_Str");
    return null;
  }
  storageMgr.cleanupStorage(false);
  StoragePoolAllocator allocator;
  if (dskCh.useLocalStorage()) {
    allocator=_localStoragePoolAllocator;
  }
 else {
    allocator=_firstFitStoragePoolAllocator;
  }
  ExcludeList myAvoids=new ExcludeList(avoid.getDataCentersToAvoid(),avoid.getPodsToAvoid(),avoid.getClustersToAvoid(),avoid.getHostsToAvoid(),avoid.getPoolsToAvoid());
  return allocator.allocateToPool(dskCh,vmProfile,plan,myAvoids,returnUpTo);
}
Program: 106315
Project: 106315
Buggy source:
@Override protected List<StoragePool> select(DiskProfile dskCh,VirtualMachineProfile<? extends VirtualMachine> vmProfile,DeploymentPlan plan,ExcludeList avoid,int returnUpTo){
  List<StoragePool> suitablePools=new ArrayList<StoragePool>();
  HypervisorType hypervisor=dskCh.getHypersorType();
  if (hypervisor != null) {
    if (hypervisor != HypervisorType.KVM) {
      s_logger.debug("String_Node_Str");
      return suitablePools;
    }
  }
  List<StoragePoolVO> storagePools=_storagePoolDao.findZoneWideStoragePoolsByTags(plan.getDataCenterId(),dskCh.getTags());
  for (  StoragePoolVO storage : storagePools) {
    if (suitablePools.size() == returnUpTo) {
      break;
    }
    StoragePool pol=(StoragePool)this.dataStoreMgr.getPrimaryDataStore(storage.getId());
    if (filter(avoid,pol,dskCh,plan)) {
      suitablePools.add(pol);
    }
  }
  return suitablePools;
}

Fixed version (ground truth):
@Override protected List<StoragePool> select(DiskProfile dskCh,VirtualMachineProfile<? extends VirtualMachine> vmProfile,DeploymentPlan plan,ExcludeList avoid,int returnUpTo){
  s_logger.debug("String_Node_Str");
  List<StoragePool> suitablePools=new ArrayList<StoragePool>();
  HypervisorType hypervisor=dskCh.getHypersorType();
  if (hypervisor != null) {
    if (hypervisor != HypervisorType.KVM) {
      s_logger.debug("String_Node_Str");
      return suitablePools;
    }
  }
  List<StoragePoolVO> storagePools=_storagePoolDao.findZoneWideStoragePoolsByTags(plan.getDataCenterId(),dskCh.getTags());
  for (  StoragePoolVO storage : storagePools) {
    if (suitablePools.size() == returnUpTo) {
      break;
    }
    StoragePool pol=(StoragePool)this.dataStoreMgr.getPrimaryDataStore(storage.getId());
    if (filter(avoid,pol,dskCh,plan)) {
      suitablePools.add(pol);
    }
  }
  return suitablePools;
}
Program: 106316
Project: 106316
Buggy source:
private void exportVolumeToSecondaryStroage(VirtualMachineMO vmMo,String volumePath,String secStorageUrl,String secStorageDir,String exportName,String workerVmName) throws Exception {
  String secondaryMountPoint=_mountService.getMountPoint(secStorageUrl);
  String exportPath=secondaryMountPoint + "String_Node_Str" + secStorageDir;
synchronized (exportPath.intern()) {
    if (!new File(exportPath).exists()) {
      Script command=new Script(false,"String_Node_Str",_timeout,s_logger);
      command.add("String_Node_Str");
      command.add(exportPath);
      if (command.execute() != null)       throw new Exception("String_Node_Str");
    }
  }
  VirtualMachineMO clonedVm=null;
  try {
    Pair<VirtualDisk,String> volumeDeviceInfo=vmMo.getDiskDevice(volumePath,false);
    if (volumeDeviceInfo == null) {
      String msg="String_Node_Str" + volumePath;
      s_logger.error(msg);
      throw new Exception(msg);
    }
    vmMo.cloneFromCurrentSnapshot(workerVmName,0,4,volumeDeviceInfo.second(),VmwareHelper.getDiskDeviceDatastore(volumeDeviceInfo.first()));
    clonedVm=vmMo.getRunningHost().findVmOnHyperHost(workerVmName);
    if (clonedVm == null) {
      String msg="String_Node_Str" + volumePath;
      s_logger.error(msg);
      throw new Exception(msg);
    }
    clonedVm.exportVm(exportPath,exportName,true,true);
  }
  finally {
    if (clonedVm != null) {
      clonedVm.detachAllDisks();
      clonedVm.destroy();
    }
  }
}

Fixed version (ground truth):
private void exportVolumeToSecondaryStroage(VirtualMachineMO vmMo,String volumePath,String secStorageUrl,String secStorageDir,String exportName,String workerVmName) throws Exception {
  String secondaryMountPoint=_mountService.getMountPoint(secStorageUrl);
  String exportPath=secondaryMountPoint + "String_Node_Str" + secStorageDir+ "String_Node_Str"+ exportName;
synchronized (exportPath.intern()) {
    if (!new File(exportPath).exists()) {
      Script command=new Script(false,"String_Node_Str",_timeout,s_logger);
      command.add("String_Node_Str");
      command.add(exportPath);
      if (command.execute() != null)       throw new Exception("String_Node_Str");
    }
  }
  VirtualMachineMO clonedVm=null;
  try {
    Pair<VirtualDisk,String> volumeDeviceInfo=vmMo.getDiskDevice(volumePath,false);
    if (volumeDeviceInfo == null) {
      String msg="String_Node_Str" + volumePath;
      s_logger.error(msg);
      throw new Exception(msg);
    }
    vmMo.cloneFromCurrentSnapshot(workerVmName,0,4,volumeDeviceInfo.second(),VmwareHelper.getDiskDeviceDatastore(volumeDeviceInfo.first()));
    clonedVm=vmMo.getRunningHost().findVmOnHyperHost(workerVmName);
    if (clonedVm == null) {
      String msg="String_Node_Str" + volumePath;
      s_logger.error(msg);
      throw new Exception(msg);
    }
    clonedVm.exportVm(exportPath,exportName,true,true);
  }
  finally {
    if (clonedVm != null) {
      clonedVm.detachAllDisks();
      clonedVm.destroy();
    }
  }
}
Program: 106318
Project: 106318
Buggy source:
private String backupSnapshotToSecondaryStorage(VirtualMachineMO vmMo,long accountId,long volumeId,String volumePath,String snapshotUuid,String secStorageUrl,String prevSnapshotUuid,String prevBackupUuid,String workerVmName) throws Exception {
  String backupUuid=UUID.randomUUID().toString();
  exportVolumeToSecondaryStroage(vmMo,volumePath,secStorageUrl,getSnapshotRelativeDirInSecStorage(accountId,volumeId),backupUuid,workerVmName);
  return backupUuid;
}

Fixed version (ground truth):
private String backupSnapshotToSecondaryStorage(VirtualMachineMO vmMo,long accountId,long volumeId,String volumePath,String snapshotUuid,String secStorageUrl,String prevSnapshotUuid,String prevBackupUuid,String workerVmName) throws Exception {
  String backupUuid=UUID.randomUUID().toString();
  exportVolumeToSecondaryStroage(vmMo,volumePath,secStorageUrl,getSnapshotRelativeDirInSecStorage(accountId,volumeId),backupUuid,workerVmName);
  return backupUuid + "String_Node_Str" + backupUuid;
}
Program: 106323
Project: 106323
Buggy source:
protected VersionDaoImpl(){
  super();
  CurrentVersionSearch=createSearchBuilder(String.class);
  CurrentVersionSearch.selectField(CurrentVersionSearch.entity().getVersion());
  CurrentVersionSearch.and("String_Node_Str",CurrentVersionSearch.entity().getStep(),Op.EQ);
  CurrentVersionSearch.done();
  AllFieldsSearch=createSearchBuilder();
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getVersion(),Op.EQ);
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getStep(),Op.EQ);
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getUpdated(),Op.EQ);
  AllFieldsSearch.done();
}

Fixed version (ground truth):
public VersionDaoImpl(){
  super();
  CurrentVersionSearch=createSearchBuilder(String.class);
  CurrentVersionSearch.selectField(CurrentVersionSearch.entity().getVersion());
  CurrentVersionSearch.and("String_Node_Str",CurrentVersionSearch.entity().getStep(),Op.EQ);
  CurrentVersionSearch.done();
  AllFieldsSearch=createSearchBuilder();
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getVersion(),Op.EQ);
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getStep(),Op.EQ);
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getUpdated(),Op.EQ);
  AllFieldsSearch.done();
}
Program: 106326
Project: 106326
Buggy source:
protected VersionDaoImpl(){
  super();
  CurrentVersionSearch=createSearchBuilder(String.class);
  CurrentVersionSearch.selectField(CurrentVersionSearch.entity().getVersion());
  CurrentVersionSearch.and("String_Node_Str",CurrentVersionSearch.entity().getStep(),Op.EQ);
  CurrentVersionSearch.done();
  AllFieldsSearch=createSearchBuilder();
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getVersion(),Op.EQ);
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getStep(),Op.EQ);
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getUpdated(),Op.EQ);
  AllFieldsSearch.done();
}

Fixed version (ground truth):
public VersionDaoImpl(){
  super();
  CurrentVersionSearch=createSearchBuilder(String.class);
  CurrentVersionSearch.selectField(CurrentVersionSearch.entity().getVersion());
  CurrentVersionSearch.and("String_Node_Str",CurrentVersionSearch.entity().getStep(),Op.EQ);
  CurrentVersionSearch.done();
  AllFieldsSearch=createSearchBuilder();
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getVersion(),Op.EQ);
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getStep(),Op.EQ);
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getUpdated(),Op.EQ);
  AllFieldsSearch.done();
}
Program: 106329
Project: 106329
Buggy source:
public VersionDaoImpl(){
  super();
  CurrentVersionSearch=createSearchBuilder(String.class);
  CurrentVersionSearch.selectField(CurrentVersionSearch.entity().getVersion());
  CurrentVersionSearch.and("String_Node_Str",CurrentVersionSearch.entity().getStep(),Op.EQ);
  CurrentVersionSearch.done();
  AllFieldsSearch=createSearchBuilder();
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getVersion(),Op.EQ);
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getStep(),Op.EQ);
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getUpdated(),Op.EQ);
  AllFieldsSearch.done();
}

Fixed version (ground truth):
protected VersionDaoImpl(){
  super();
  CurrentVersionSearch=createSearchBuilder(String.class);
  CurrentVersionSearch.selectField(CurrentVersionSearch.entity().getVersion());
  CurrentVersionSearch.and("String_Node_Str",CurrentVersionSearch.entity().getStep(),Op.EQ);
  CurrentVersionSearch.done();
  AllFieldsSearch=createSearchBuilder();
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getVersion(),Op.EQ);
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getStep(),Op.EQ);
  AllFieldsSearch.and("String_Node_Str",AllFieldsSearch.entity().getUpdated(),Op.EQ);
  AllFieldsSearch.done();
}
Program: 106330
Project: 106330
Buggy source:
private File getSystemVMPatchIsoFile(){
  URL url=this.getClass().getProtectionDomain().getCodeSource().getLocation();
  File file=new File(url.getFile());
  File isoFile=new File(file.getParent() + "String_Node_Str");
  if (!isoFile.exists()) {
    isoFile=new File("String_Node_Str" + "String_Node_Str");
    if (!isoFile.exists()) {
      isoFile=new File("String_Node_Str" + "String_Node_Str");
    }
  }
  return isoFile;
}

Fixed version (ground truth):
private File getSystemVMPatchIsoFile(){
  URL url=this.getClass().getClassLoader().getResource("String_Node_Str");
  File isoFile=null;
  if (url != null) {
    isoFile=new File(url.getPath());
  }
  if (isoFile == null || !isoFile.exists()) {
    isoFile=new File("String_Node_Str" + "String_Node_Str");
    if (!isoFile.exists()) {
      isoFile=new File("String_Node_Str" + "String_Node_Str");
    }
  }
  return isoFile;
}
Program: 106331
Project: 106331
Buggy source:
@Override public File getSystemVMKeyFile(){
  URL url=this.getClass().getProtectionDomain().getCodeSource().getLocation();
  File file=new File(url.getFile());
  File keyFile=new File(file.getParent(),"String_Node_Str");
  if (!keyFile.exists()) {
    keyFile=new File("String_Node_Str" + "String_Node_Str");
    if (!keyFile.exists()) {
      keyFile=new File("String_Node_Str" + "String_Node_Str");
    }
  }
  return keyFile;
}

Fixed version (ground truth):
@Override public File getSystemVMKeyFile(){
  URL url=this.getClass().getClassLoader().getResource("String_Node_Str");
  File keyFile=null;
  if (url != null) {
    keyFile=new File(url.getPath());
  }
  if (keyFile == null || !keyFile.exists()) {
    keyFile=new File("String_Node_Str" + "String_Node_Str");
    if (!keyFile.exists()) {
      keyFile=new File("String_Node_Str" + "String_Node_Str");
    }
  }
  return keyFile;
}
Program: 106335
Project: 106335
Buggy source:
protected VirtualMachineMO prepareVolumeHostDummyVm(VmwareHypervisorHost hyperHost,DatastoreMO dsMo,String vmName) throws Exception {
  assert(hyperHost != null);
  VirtualMachineMO vmMo=null;
  VirtualMachineConfigSpec vmConfig=new VirtualMachineConfigSpec();
  vmConfig.setName(vmName);
  vmConfig.setMemoryMB((long)4);
  vmConfig.setNumCPUs(1);
  vmConfig.setGuestId(VirtualMachineGuestOsIdentifier.OTHER_GUEST.toString());
  VirtualMachineFileInfo fileInfo=new VirtualMachineFileInfo();
  fileInfo.setVmPathName(String.format("String_Node_Str",dsMo.getName()));
  vmConfig.setFiles(fileInfo);
  VirtualLsiLogicController scsiController=new VirtualLsiLogicController();
  scsiController.setSharedBus(VirtualSCSISharing.NO_SHARING);
  scsiController.setBusNumber(0);
  scsiController.setKey(1);
  VirtualDeviceConfigSpec scsiControllerSpec=new VirtualDeviceConfigSpec();
  scsiControllerSpec.setDevice(scsiController);
  scsiControllerSpec.setOperation(VirtualDeviceConfigSpecOperation.ADD);
  vmConfig.getDeviceChange().add(scsiControllerSpec);
  hyperHost.createVm(vmConfig);
  vmMo=hyperHost.findVmOnHyperHost(vmName);
  return vmMo;
}

Fixed version (ground truth):
protected VirtualMachineMO prepareVolumeHostDummyVm(VmwareHypervisorHost hyperHost,DatastoreMO dsMo,String vmName) throws Exception {
  assert(hyperHost != null);
  VirtualMachineMO vmMo=null;
  VirtualMachineConfigSpec vmConfig=new VirtualMachineConfigSpec();
  vmConfig.setName(vmName);
  vmConfig.setMemoryMB((long)4);
  vmConfig.setNumCPUs(1);
  vmConfig.setGuestId(VirtualMachineGuestOsIdentifier.OTHER_GUEST.value());
  VirtualMachineFileInfo fileInfo=new VirtualMachineFileInfo();
  fileInfo.setVmPathName(String.format("String_Node_Str",dsMo.getName()));
  vmConfig.setFiles(fileInfo);
  VirtualLsiLogicController scsiController=new VirtualLsiLogicController();
  scsiController.setSharedBus(VirtualSCSISharing.NO_SHARING);
  scsiController.setBusNumber(0);
  scsiController.setKey(1);
  VirtualDeviceConfigSpec scsiControllerSpec=new VirtualDeviceConfigSpec();
  scsiControllerSpec.setDevice(scsiController);
  scsiControllerSpec.setOperation(VirtualDeviceConfigSpecOperation.ADD);
  vmConfig.getDeviceChange().add(scsiControllerSpec);
  hyperHost.createVm(vmConfig);
  vmMo=hyperHost.findVmOnHyperHost(vmName);
  return vmMo;
}
Program: 106336
Project: 106336
Buggy source:
public HttpNfcLeaseState getState() throws Exception {
  return (HttpNfcLeaseState)_context.getVimClient().getDynamicProperty(_mor,"String_Node_Str");
}

Fixed version (ground truth):
public HttpNfcLeaseState getState() throws Exception {
  Object stateProp=_context.getVimClient().getDynamicProperty(_mor,"String_Node_Str");
  assert(stateProp.toString().contains("String_Node_Str"));
  String stateVal=null;
  Element stateElement=(Element)stateProp;
  if (stateElement != null && stateElement.getFirstChild() != null) {
    stateVal=stateElement.getFirstChild().getTextContent();
  }
  if (stateVal != null) {
    return HttpNfcLeaseState.fromValue(stateVal);
  }
  return HttpNfcLeaseState.ERROR;
}
Program: 106337
Project: 106337
Buggy source:
public int tryGetIDEDeviceControllerKey() throws Exception {
  VirtualDevice[] devices=(VirtualDevice[])_context.getVimClient().getDynamicProperty(_mor,"String_Node_Str");
  if (devices != null && devices.length > 0) {
    for (    VirtualDevice device : devices) {
      if (device instanceof VirtualIDEController) {
        return ((VirtualIDEController)device).getKey();
      }
    }
  }
  return -1;
}

Fixed version (ground truth):
public int tryGetIDEDeviceControllerKey() throws Exception {
  List<VirtualDevice> devices=(List<VirtualDevice>)_context.getVimClient().getDynamicProperty(_mor,"String_Node_Str");
  if (devices != null && devices.size() > 0) {
    for (    VirtualDevice device : devices) {
      if (device instanceof VirtualIDEController) {
        return ((VirtualIDEController)device).getKey();
      }
    }
  }
  return -1;
}
Program: 106340
Project: 106340
Buggy source:
private static void setParentBackingInfo(VirtualDiskFlatVer2BackingInfo backingInfo,Pair<String,ManagedObjectReference>[] parentDatastorePathList){
  VirtualDiskFlatVer2BackingInfo parentBacking=new VirtualDiskFlatVer2BackingInfo();
  parentBacking.setDatastore(parentDatastorePathList[0].second());
  parentBacking.setDiskMode(VirtualDiskMode.PERSISTENT.toString());
  if (parentDatastorePathList.length > 1) {
    Pair<String,ManagedObjectReference>[] nextDatastorePathList=new Pair[parentDatastorePathList.length - 1];
    for (int i=0; i < parentDatastorePathList.length - 1; i++)     nextDatastorePathList[i]=parentDatastorePathList[i + 1];
    setParentBackingInfo(parentBacking,nextDatastorePathList);
  }
  parentBacking.setFileName(parentDatastorePathList[0].first());
  backingInfo.setParent(parentBacking);
}

Fixed version (ground truth):
private static void setParentBackingInfo(VirtualDiskFlatVer2BackingInfo backingInfo,Pair<String,ManagedObjectReference>[] parentDatastorePathList){
  VirtualDiskFlatVer2BackingInfo parentBacking=new VirtualDiskFlatVer2BackingInfo();
  parentBacking.setDatastore(parentDatastorePathList[0].second());
  parentBacking.setDiskMode(VirtualDiskMode.PERSISTENT.value());
  if (parentDatastorePathList.length > 1) {
    Pair<String,ManagedObjectReference>[] nextDatastorePathList=new Pair[parentDatastorePathList.length - 1];
    for (int i=0; i < parentDatastorePathList.length - 1; i++)     nextDatastorePathList[i]=parentDatastorePathList[i + 1];
    setParentBackingInfo(parentBacking,nextDatastorePathList);
  }
  parentBacking.setFileName(parentDatastorePathList[0].first());
  backingInfo.setParent(parentBacking);
}
Program: 106341
Project: 106341
Buggy source:
public static VirtualDevice prepareDiskDevice(VirtualMachineMO vmMo,int controllerKey,Pair<String,ManagedObjectReference>[] vmdkDatastorePathChain,int deviceNumber,int contextNumber) throws Exception {
  assert(vmdkDatastorePathChain != null);
  assert(vmdkDatastorePathChain.length >= 1);
  VirtualDisk disk=new VirtualDisk();
  VirtualDiskFlatVer2BackingInfo backingInfo=new VirtualDiskFlatVer2BackingInfo();
  backingInfo.setDatastore(vmdkDatastorePathChain[0].second());
  backingInfo.setFileName(vmdkDatastorePathChain[0].first());
  backingInfo.setDiskMode(VirtualDiskMode.PERSISTENT.toString());
  if (vmdkDatastorePathChain.length > 1) {
    Pair<String,ManagedObjectReference>[] parentDisks=new Pair[vmdkDatastorePathChain.length - 1];
    for (int i=0; i < vmdkDatastorePathChain.length - 1; i++)     parentDisks[i]=vmdkDatastorePathChain[i + 1];
    setParentBackingInfo(backingInfo,parentDisks);
  }
  disk.setBacking(backingInfo);
  if (controllerKey < 0)   controllerKey=vmMo.getIDEDeviceControllerKey();
  if (deviceNumber < 0)   deviceNumber=vmMo.getNextDeviceNumber(controllerKey);
  disk.setControllerKey(controllerKey);
  disk.setKey(-contextNumber);
  disk.setUnitNumber(deviceNumber);
  VirtualDeviceConnectInfo connectInfo=new VirtualDeviceConnectInfo();
  connectInfo.setConnected(true);
  connectInfo.setStartConnected(true);
  disk.setConnectable(connectInfo);
  return disk;
}

Fixed version (ground truth):
public static VirtualDevice prepareDiskDevice(VirtualMachineMO vmMo,int controllerKey,Pair<String,ManagedObjectReference>[] vmdkDatastorePathChain,int deviceNumber,int contextNumber) throws Exception {
  assert(vmdkDatastorePathChain != null);
  assert(vmdkDatastorePathChain.length >= 1);
  VirtualDisk disk=new VirtualDisk();
  VirtualDiskFlatVer2BackingInfo backingInfo=new VirtualDiskFlatVer2BackingInfo();
  backingInfo.setDatastore(vmdkDatastorePathChain[0].second());
  backingInfo.setFileName(vmdkDatastorePathChain[0].first());
  backingInfo.setDiskMode(VirtualDiskMode.PERSISTENT.value());
  if (vmdkDatastorePathChain.length > 1) {
    Pair<String,ManagedObjectReference>[] parentDisks=new Pair[vmdkDatastorePathChain.length - 1];
    for (int i=0; i < vmdkDatastorePathChain.length - 1; i++)     parentDisks[i]=vmdkDatastorePathChain[i + 1];
    setParentBackingInfo(backingInfo,parentDisks);
  }
  disk.setBacking(backingInfo);
  if (controllerKey < 0)   controllerKey=vmMo.getIDEDeviceControllerKey();
  if (deviceNumber < 0)   deviceNumber=vmMo.getNextDeviceNumber(controllerKey);
  disk.setControllerKey(controllerKey);
  disk.setKey(-contextNumber);
  disk.setUnitNumber(deviceNumber);
  VirtualDeviceConnectInfo connectInfo=new VirtualDeviceConnectInfo();
  connectInfo.setConnected(true);
  connectInfo.setStartConnected(true);
  disk.setConnectable(connectInfo);
  return disk;
}
Program: 106344
Project: 106344
Buggy source:
@Override public ManagedObjectReference mountDatastore(boolean vmfsDatastore,String poolHostAddress,int poolHostPort,String poolPath,String poolUuid) throws Exception {
  if (s_logger.isTraceEnabled())   s_logger.trace("String_Node_Str" + _mor.getValue() + "String_Node_Str"+ vmfsDatastore+ "String_Node_Str"+ poolHostAddress+ "String_Node_Str"+ poolHostPort+ "String_Node_Str"+ poolPath+ "String_Node_Str"+ poolUuid);
  ManagedObjectReference morDs=null;
  ManagedObjectReference morDsFirst=null;
  ManagedObjectReference[] hosts=(ManagedObjectReference[])_context.getVimClient().getDynamicProperty(_mor,"String_Node_Str");
  if (hosts != null && hosts.length > 0) {
    for (    ManagedObjectReference morHost : hosts) {
      HostMO hostMo=new HostMO(_context,morHost);
      morDs=hostMo.mountDatastore(vmfsDatastore,poolHostAddress,poolHostPort,poolPath,poolUuid);
      if (morDsFirst == null)       morDsFirst=morDs;
      assert(morDsFirst.getValue().equals(morDs.getValue()));
    }
  }
  if (morDs == null) {
    String msg="String_Node_Str";
    s_logger.error(msg);
    if (s_logger.isTraceEnabled())     s_logger.trace("String_Node_Str");
    throw new Exception(msg);
  }
  if (s_logger.isTraceEnabled())   s_logger.trace("String_Node_Str");
  return morDs;
}

Fixed version (ground truth):
@Override public ManagedObjectReference mountDatastore(boolean vmfsDatastore,String poolHostAddress,int poolHostPort,String poolPath,String poolUuid) throws Exception {
  if (s_logger.isTraceEnabled())   s_logger.trace("String_Node_Str" + _mor.getValue() + "String_Node_Str"+ vmfsDatastore+ "String_Node_Str"+ poolHostAddress+ "String_Node_Str"+ poolHostPort+ "String_Node_Str"+ poolPath+ "String_Node_Str"+ poolUuid);
  ManagedObjectReference morDs=null;
  ManagedObjectReference morDsFirst=null;
  List<ManagedObjectReference> hosts=(List<ManagedObjectReference>)_context.getVimClient().getDynamicProperty(_mor,"String_Node_Str");
  if (hosts != null && hosts.size() > 0) {
    for (    ManagedObjectReference morHost : hosts) {
      HostMO hostMo=new HostMO(_context,morHost);
      morDs=hostMo.mountDatastore(vmfsDatastore,poolHostAddress,poolHostPort,poolPath,poolUuid);
      if (morDsFirst == null)       morDsFirst=morDs;
      assert(morDsFirst.getValue().equals(morDs.getValue()));
    }
  }
  if (morDs == null) {
    String msg="String_Node_Str";
    s_logger.error(msg);
    if (s_logger.isTraceEnabled())     s_logger.trace("String_Node_Str");
    throw new Exception(msg);
  }
  if (s_logger.isTraceEnabled())   s_logger.trace("String_Node_Str");
  return morDs;
}
Program: 106345
Project: 106345
Buggy source:
@Override public VmwareHypervisorHostResourceSummary getHyperHostResourceSummary() throws Exception {
  if (s_logger.isTraceEnabled())   s_logger.trace("String_Node_Str" + _mor.getValue());
  VmwareHypervisorHostResourceSummary summary=new VmwareHypervisorHostResourceSummary();
  ComputeResourceSummary vmwareSummary=(ComputeResourceSummary)_context.getVimClient().getDynamicProperty(_mor,"String_Node_Str");
  int cpuNumInCpuThreads=1;
  ManagedObjectReference[] hosts=(ManagedObjectReference[])_context.getVimClient().getDynamicProperty(_mor,"String_Node_Str");
  if (hosts != null && hosts.length > 0) {
    for (    ManagedObjectReference morHost : hosts) {
      HostMO hostMo=new HostMO(_context,morHost);
      HostHardwareSummary hardwareSummary=hostMo.getHostHardwareSummary();
      if (hardwareSummary.getNumCpuCores() * hardwareSummary.getNumCpuThreads() > cpuNumInCpuThreads)       cpuNumInCpuThreads=hardwareSummary.getNumCpuCores() * hardwareSummary.getNumCpuThreads();
    }
  }
  summary.setCpuCount(cpuNumInCpuThreads);
  summary.setCpuSpeed(vmwareSummary.getTotalCpu());
  summary.setMemoryBytes(vmwareSummary.getTotalMemory());
  if (s_logger.isTraceEnabled())   s_logger.trace("String_Node_Str");
  return summary;
}

Fixed version (ground truth):
@Override public VmwareHypervisorHostResourceSummary getHyperHostResourceSummary() throws Exception {
  if (s_logger.isTraceEnabled())   s_logger.trace("String_Node_Str" + _mor.getValue());
  VmwareHypervisorHostResourceSummary summary=new VmwareHypervisorHostResourceSummary();
  ComputeResourceSummary vmwareSummary=(ComputeResourceSummary)_context.getVimClient().getDynamicProperty(_mor,"String_Node_Str");
  int cpuNumInCpuThreads=1;
  List<ManagedObjectReference> hosts=(List<ManagedObjectReference>)_context.getVimClient().getDynamicProperty(_mor,"String_Node_Str");
  if (hosts != null && hosts.size() > 0) {
    for (    ManagedObjectReference morHost : hosts) {
      HostMO hostMo=new HostMO(_context,morHost);
      HostHardwareSummary hardwareSummary=hostMo.getHostHardwareSummary();
      if (hardwareSummary.getNumCpuCores() * hardwareSummary.getNumCpuThreads() > cpuNumInCpuThreads)       cpuNumInCpuThreads=hardwareSummary.getNumCpuCores() * hardwareSummary.getNumCpuThreads();
    }
  }
  summary.setCpuCount(cpuNumInCpuThreads);
  summary.setCpuSpeed(vmwareSummary.getTotalCpu());
  summary.setMemoryBytes(vmwareSummary.getTotalMemory());
  if (s_logger.isTraceEnabled())   s_logger.trace("String_Node_Str");
  return summary;
}
Program: 106346
Project: 106346
Buggy source:
@Override public VmwareHypervisorHostNetworkSummary getHyperHostNetworkSummary(String esxServiceConsolePort) throws Exception {
  if (s_logger.isTraceEnabled())   s_logger.trace("String_Node_Str" + _mor.getValue() + "String_Node_Str"+ esxServiceConsolePort);
  ManagedObjectReference[] hosts=(ManagedObjectReference[])_context.getVimClient().getDynamicProperty(_mor,"String_Node_Str");
  if (hosts != null && hosts.length > 0) {
    VmwareHypervisorHostNetworkSummary summary=new HostMO(_context,hosts[0]).getHyperHostNetworkSummary(esxServiceConsolePort);
    if (s_logger.isTraceEnabled())     s_logger.trace("String_Node_Str");
    return summary;
  }
  if (s_logger.isTraceEnabled())   s_logger.trace("String_Node_Str");
  return null;
}

Fixed version (ground truth):
@Override public VmwareHypervisorHostNetworkSummary getHyperHostNetworkSummary(String esxServiceConsolePort) throws Exception {
  if (s_logger.isTraceEnabled())   s_logger.trace("String_Node_Str" + _mor.getValue() + "String_Node_Str"+ esxServiceConsolePort);
  List<ManagedObjectReference> hosts=(List<ManagedObjectReference>)_context.getVimClient().getDynamicProperty(_mor,"String_Node_Str");
  if (hosts != null && hosts.size() > 0) {
    VmwareHypervisorHostNetworkSummary summary=new HostMO(_context,hosts.get(0)).getHyperHostNetworkSummary(esxServiceConsolePort);
    if (s_logger.isTraceEnabled())     s_logger.trace("String_Node_Str");
    return summary;
  }
  if (s_logger.isTraceEnabled())   s_logger.trace("String_Node_Str");
  return null;
}
Program: 106347
Project: 106347
Buggy source:
@Override public void unmountDatastore(String poolUuid) throws Exception {
  if (s_logger.isTraceEnabled())   s_logger.trace("String_Node_Str" + _mor.getValue() + "String_Node_Str"+ poolUuid);
  ManagedObjectReference[] hosts=(ManagedObjectReference[])_context.getVimClient().getDynamicProperty(_mor,"String_Node_Str");
  if (hosts != null && hosts.length > 0) {
    for (    ManagedObjectReference morHost : hosts) {
      HostMO hostMo=new HostMO(_context,morHost);
      hostMo.unmountDatastore(poolUuid);
    }
  }
  if (s_logger.isTraceEnabled())   s_logger.trace("String_Node_Str");
}

Fixed version (ground truth):
@Override public void unmountDatastore(String poolUuid) throws Exception {
  if (s_logger.isTraceEnabled())   s_logger.trace("String_Node_Str" + _mor.getValue() + "String_Node_Str"+ poolUuid);
  List<ManagedObjectReference> hosts=(List<ManagedObjectReference>)_context.getVimClient().getDynamicProperty(_mor,"String_Node_Str");
  if (hosts != null && hosts.size() > 0) {
    for (    ManagedObjectReference morHost : hosts) {
      HostMO hostMo=new HostMO(_context,morHost);
      hostMo.unmountDatastore(poolUuid);
    }
  }
  if (s_logger.isTraceEnabled())   s_logger.trace("String_Node_Str");
}
Program: 106348
Project: 106348
Buggy source:
public CustomFieldDef[] getFields() throws Exception {
  return (CustomFieldDef[])_context.getVimClient().getDynamicProperty(getMor(),"String_Node_Str");
}

Fixed version (ground truth):
public List<CustomFieldDef> getFields() throws Exception {
  return (List<CustomFieldDef>)_context.getVimClient().getDynamicProperty(getMor(),"String_Node_Str");
}
Program: 106349
Project: 106349
Buggy source:
public int getCustomFieldKey(String morType,String fieldName) throws Exception {
  CustomFieldDef[] fields=getFields();
  if (fields != null) {
    for (    CustomFieldDef field : fields) {
      if (field.getName().equals(fieldName) && field.getManagedObjectType().equals(morType))       return field.getKey();
    }
  }
  return 0;
}

Fixed version (ground truth):
public int getCustomFieldKey(String morType,String fieldName) throws Exception {
  List<CustomFieldDef> fields=getFields();
  if (fields != null) {
    for (    CustomFieldDef field : fields) {
      if (field.getName().equals(fieldName) && field.getManagedObjectType().equals(morType))       return field.getKey();
    }
  }
  return 0;
}
Program: 106350
Project: 106350
Buggy source:
public ManagedObjectReference findDatastoreByExportPath(String exportPath) throws Exception {
  assert(exportPath != null);
  ManagedObjectReference[] datastores=getDatastores();
  if (datastores != null && datastores.length > 0) {
    for (    ManagedObjectReference morDatastore : datastores) {
      DatastoreMO dsMo=new DatastoreMO(_context,morDatastore);
      if (dsMo.getInventoryPath().equals(exportPath))       return morDatastore;
      NasDatastoreInfo info=getNasDatastoreInfo(morDatastore);
      if (info != null) {
        String vmwareUrl=info.getUrl();
        if (vmwareUrl.charAt(vmwareUrl.length() - 1) == '/')         vmwareUrl=vmwareUrl.substring(0,vmwareUrl.length() - 1);
        URI uri=new URI(vmwareUrl);
        if (uri.getPath().equals("String_Node_Str" + exportPath))         return morDatastore;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
public ManagedObjectReference findDatastoreByExportPath(String exportPath) throws Exception {
  assert(exportPath != null);
  List<ManagedObjectReference> datastores=getDatastores();
  if (datastores != null && datastores.size() > 0) {
    for (    ManagedObjectReference morDatastore : datastores) {
      DatastoreMO dsMo=new DatastoreMO(_context,morDatastore);
      if (dsMo.getInventoryPath().equals(exportPath))       return morDatastore;
      NasDatastoreInfo info=getNasDatastoreInfo(morDatastore);
      if (info != null) {
        String vmwareUrl=info.getUrl();
        if (vmwareUrl.charAt(vmwareUrl.length() - 1) == '/')         vmwareUrl=vmwareUrl.substring(0,vmwareUrl.length() - 1);
        URI uri=new URI(vmwareUrl);
        if (uri.getPath().equals("String_Node_Str" + exportPath))         return morDatastore;
      }
    }
  }
  return null;
}
Program: 106351
Project: 106351
Buggy source:
public ManagedObjectReference[] getDatastores() throws Exception {
  return (ManagedObjectReference[])_context.getVimClient().getDynamicProperty(_mor,"String_Node_Str");
}

Fixed version (ground truth):
public List<ManagedObjectReference> getDatastores() throws Exception {
  return (List<ManagedObjectReference>)_context.getVimClient().getDynamicProperty(_mor,"String_Node_Str");
}
Program: 106352
Project: 106352
Buggy source:
public ManagedObjectReference findDatastoreByUrl(String storeUrl) throws Exception {
  assert(storeUrl != null);
  ManagedObjectReference[] datastores=getDatastores();
  if (datastores != null && datastores.length > 0) {
    for (    ManagedObjectReference morDatastore : datastores) {
      NasDatastoreInfo info=getNasDatastoreInfo(morDatastore);
      if (info != null) {
        URI uri=new URI(storeUrl);
        String vmwareStyleUrl="String_Node_Str" + uri.getHost() + "String_Node_Str"+ uri.getPath()+ "String_Node_Str";
        if (info.getUrl().equals(vmwareStyleUrl))         return morDatastore;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
public ManagedObjectReference findDatastoreByUrl(String storeUrl) throws Exception {
  assert(storeUrl != null);
  List<ManagedObjectReference> datastores=getDatastores();
  if (datastores != null && datastores.size() > 0) {
    for (    ManagedObjectReference morDatastore : datastores) {
      NasDatastoreInfo info=getNasDatastoreInfo(morDatastore);
      if (info != null) {
        URI uri=new URI(storeUrl);
        String vmwareStyleUrl="String_Node_Str" + uri.getHost() + "String_Node_Str"+ uri.getPath()+ "String_Node_Str";
        if (info.getUrl().equals(vmwareStyleUrl))         return morDatastore;
      }
    }
  }
  return null;
}
Program: 106353
Project: 106353
Buggy source:
public ManagedObjectReference getExistingDataStoreOnHost(boolean vmfsDatastore,String hostAddress,int hostPort,String path,String uuid,HostDatastoreSystemMO hostDatastoreSystemMo){
  ManagedObjectReference[] morArray;
  try {
    morArray=hostDatastoreSystemMo.getDatastores();
  }
 catch (  Exception e) {
    s_logger.info("String_Node_Str");
    return null;
  }
  if (morArray.length > 0) {
    int i;
    for (i=0; i < morArray.length; i++) {
      NasDatastoreInfo nasDS;
      try {
        nasDS=hostDatastoreSystemMo.getNasDatastoreInfo(morArray[i]);
        if (nasDS != null) {
          if (nasDS.getNas().getRemoteHost().equalsIgnoreCase(hostAddress) && nasDS.getNas().getRemotePath().equalsIgnoreCase(path)) {
            return morArray[i];
          }
        }
      }
 catch (      Exception e) {
        s_logger.info("String_Node_Str");
        return null;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
public ManagedObjectReference getExistingDataStoreOnHost(boolean vmfsDatastore,String hostAddress,int hostPort,String path,String uuid,HostDatastoreSystemMO hostDatastoreSystemMo){
  List<ManagedObjectReference> morArray;
  try {
    morArray=hostDatastoreSystemMo.getDatastores();
  }
 catch (  Exception e) {
    s_logger.info("String_Node_Str");
    return null;
  }
  if (morArray.size() > 0) {
    int i;
    for (i=0; i < morArray.size(); i++) {
      NasDatastoreInfo nasDS;
      try {
        nasDS=hostDatastoreSystemMo.getNasDatastoreInfo(morArray.get(i));
        if (nasDS != null) {
          if (nasDS.getNas().getRemoteHost().equalsIgnoreCase(hostAddress) && nasDS.getNas().getRemotePath().equalsIgnoreCase(path)) {
            return morArray.get(i);
          }
        }
      }
 catch (      Exception e) {
        s_logger.info("String_Node_Str");
        return null;
      }
    }
  }
  return null;
}
Program: 106354
Project: 106354
Buggy source:
public HostVirtualSwitch[] getHostVirtualSwitch() throws Exception {
  return (HostVirtualSwitch[])_context.getVimClient().getDynamicProperty(_mor,"String_Node_Str");
}

Fixed version (ground truth):
public List<HostVirtualSwitch> getHostVirtualSwitch() throws Exception {
  return (List<HostVirtualSwitch>)_context.getVimClient().getDynamicProperty(_mor,"String_Node_Str");
}
Program: 106355
Project: 106355
Buggy source:
public ManagedObjectReference[] getHostLocalDatastore() throws Exception {
  ManagedObjectReference[] datastores=(ManagedObjectReference[])_context.getVimClient().getDynamicProperty(_mor,"String_Node_Str");
  List<ManagedObjectReference> l=new ArrayList<ManagedObjectReference>();
  if (datastores != null) {
    for (    ManagedObjectReference mor : datastores) {
      DatastoreSummary summary=(DatastoreSummary)_context.getVimClient().getDynamicProperty(mor,"String_Node_Str");
      if (summary.getType().equalsIgnoreCase("String_Node_Str") && !summary.isMultipleHostAccess())       l.add(mor);
    }
  }
  return l.toArray(new ManagedObjectReference[1]);
}

Fixed version (ground truth):
public ManagedObjectReference[] getHostLocalDatastore() throws Exception {
  List<ManagedObjectReference> datastores=(List<ManagedObjectReference>)_context.getVimClient().getDynamicProperty(_mor,"String_Node_Str");
  List<ManagedObjectReference> l=new ArrayList<ManagedObjectReference>();
  if (datastores != null) {
    for (    ManagedObjectReference mor : datastores) {
      DatastoreSummary summary=(DatastoreSummary)_context.getVimClient().getDynamicProperty(mor,"String_Node_Str");
      if (summary.getType().equalsIgnoreCase("String_Node_Str") && !summary.isMultipleHostAccess())       l.add(mor);
    }
  }
  return l.toArray(new ManagedObjectReference[1]);
}
Program: 106357
Project: 106357
Buggy source:
public VirtualNicManagerNetConfig[] getHostVirtualNicManagerNetConfig() throws Exception {
  VirtualNicManagerNetConfig[] netConfigs=(VirtualNicManagerNetConfig[])_context.getVimClient().getDynamicProperty(_mor,"String_Node_Str");
  return netConfigs;
}

Fixed version (ground truth):
public List<VirtualNicManagerNetConfig> getHostVirtualNicManagerNetConfig() throws Exception {
  return (List<VirtualNicManagerNetConfig>)_context.getVimClient().getDynamicProperty(_mor,"String_Node_Str");
}
Program: 106358
Project: 106358
Buggy source:
public HostVirtualSwitch getHostVirtualSwitchByName(String name) throws Exception {
  HostVirtualSwitch[] switches=(HostVirtualSwitch[])_context.getVimClient().getDynamicProperty(_mor,"String_Node_Str");
  if (switches != null) {
    for (    HostVirtualSwitch vswitch : switches) {
      if (vswitch.getName().equals(name))       return vswitch;
    }
  }
  return null;
}

Fixed version (ground truth):
public HostVirtualSwitch getHostVirtualSwitchByName(String name) throws Exception {
  List<HostVirtualSwitch> switches=(List<HostVirtualSwitch>)_context.getVimClient().getDynamicProperty(_mor,"String_Node_Str");
  if (switches != null) {
    for (    HostVirtualSwitch vswitch : switches) {
      if (vswitch.getName().equals(name))       return vswitch;
    }
  }
  return null;
}
Program: 106359
Project: 106359
Buggy source:
public HostIpRouteEntry[] getHostIpRouteEntries() throws Exception {
  HostIpRouteEntry[] entries=(HostIpRouteEntry[])_context.getVimClient().getDynamicProperty(_mor,"String_Node_Str");
  return entries;
}

Fixed version (ground truth):
public List<HostIpRouteEntry> getHostIpRouteEntries() throws Exception {
  return (List<HostIpRouteEntry>)_context.getVimClient().getDynamicProperty(_mor,"String_Node_Str");
}
Program: 106360
Project: 106360
Buggy source:
public HostVirtualSwitch getVirtualSwitchByName(String vSwitchName) throws Exception {
  HostVirtualSwitch[] vSwitchs=getHostVirtualSwitch();
  if (vSwitchs != null) {
    for (    HostVirtualSwitch vSwitch : vSwitchs) {
      if (vSwitch.getName().equals(vSwitchName))       return vSwitch;
    }
  }
  return null;
}

Fixed version (ground truth):
public HostVirtualSwitch getVirtualSwitchByName(String vSwitchName) throws Exception {
  List<HostVirtualSwitch> vSwitchs=getHostVirtualSwitch();
  if (vSwitchs != null) {
    for (    HostVirtualSwitch vSwitch : vSwitchs) {
      if (vSwitch.getName().equals(vSwitchName))       return vSwitch;
    }
  }
  return null;
}
Program: 106361
Project: 106361
Buggy source:
public ManagedObjectReference[] getVmMorsOnNetwork(String portGroupName) throws Exception {
  ManagedObjectReference morNetwork=getNetworkMor(portGroupName);
  if (morNetwork != null)   return (ManagedObjectReference[])_context.getVimClient().getDynamicProperty(morNetwork,"String_Node_Str");
  return null;
}

Fixed version (ground truth):
public List<ManagedObjectReference> getVmMorsOnNetwork(String portGroupName) throws Exception {
  ManagedObjectReference morNetwork=getNetworkMor(portGroupName);
  if (morNetwork != null)   return (List<ManagedObjectReference>)_context.getVimClient().getDynamicProperty(morNetwork,"String_Node_Str");
  return null;
}
Program: 106362
Project: 106362
Buggy source:
public String getPortGroupNameByNicType(HostVirtualNicType nicType) throws Exception {
  assert(nicType != null);
  VirtualNicManagerNetConfig[] netConfigs=(VirtualNicManagerNetConfig[])_context.getVimClient().getDynamicProperty(_mor,"String_Node_Str");
  if (netConfigs != null) {
    for (    VirtualNicManagerNetConfig netConfig : netConfigs) {
      if (netConfig.getNicType().equals(nicType.toString())) {
        List<HostVirtualNic> nics=netConfig.getCandidateVnic();
        if (nics != null) {
          for (          HostVirtualNic nic : nics) {
            return nic.getPortgroup();
          }
        }
      }
    }
  }
  if (nicType == HostVirtualNicType.management) {
    HostNetworkInfo netInfo=getHostNetworkInfo();
    assert(netInfo != null);
    List<HostVirtualNic> nics=netInfo.getConsoleVnic();
    if (nics != null) {
      for (      HostVirtualNic nic : nics) {
        return nic.getPortgroup();
      }
    }
  }
  return null;
}

Fixed version (ground truth):
public String getPortGroupNameByNicType(HostVirtualNicType nicType) throws Exception {
  assert(nicType != null);
  List<VirtualNicManagerNetConfig> netConfigs=(List<VirtualNicManagerNetConfig>)_context.getVimClient().getDynamicProperty(_mor,"String_Node_Str");
  if (netConfigs != null) {
    for (    VirtualNicManagerNetConfig netConfig : netConfigs) {
      if (netConfig.getNicType().equals(nicType.toString())) {
        List<HostVirtualNic> nics=netConfig.getCandidateVnic();
        if (nics != null) {
          for (          HostVirtualNic nic : nics) {
            return nic.getPortgroup();
          }
        }
      }
    }
  }
  if (nicType == HostVirtualNicType.management) {
    HostNetworkInfo netInfo=getHostNetworkInfo();
    assert(netInfo != null);
    List<HostVirtualNic> nics=netInfo.getConsoleVnic();
    if (nics != null) {
      for (      HostVirtualNic nic : nics) {
        return nic.getPortgroup();
      }
    }
  }
  return null;
}
Program: 106363
Project: 106363
Buggy source:
@Override public String getHyperHostDefaultGateway() throws Exception {
  HostIpRouteEntry[] entries=getHostIpRouteEntries();
  for (  HostIpRouteEntry entry : entries) {
    if (entry.getNetwork().equalsIgnoreCase("String_Node_Str"))     return entry.getGateway();
  }
  throw new Exception("String_Node_Str");
}

Fixed version (ground truth):
@Override public String getHyperHostDefaultGateway() throws Exception {
  List<HostIpRouteEntry> entries=getHostIpRouteEntries();
  for (  HostIpRouteEntry entry : entries) {
    if (entry.getNetwork().equalsIgnoreCase("String_Node_Str"))     return entry.getGateway();
  }
  throw new Exception("String_Node_Str");
}
Program: 106365
Project: 106365
Buggy source:
public ManagedObjectReference[] getVMsOnNetwork() throws Exception {
  ManagedObjectReference[] vms=(ManagedObjectReference[])_context.getVimClient().getDynamicProperty(_mor,"String_Node_Str");
  return vms;
}

Fixed version (ground truth):
public List<ManagedObjectReference> getVMsOnNetwork() throws Exception {
  return (List<ManagedObjectReference>)_context.getVimClient().getDynamicProperty(_mor,"String_Node_Str");
}
Program: 106367
Project: 106367
Buggy source:
private boolean validateDiscoveredHosts(VmwareContext context,ManagedObjectReference morCluster,List<ManagedObjectReference> morHosts) throws Exception {
  if (morCluster == null) {
    for (    ManagedObjectReference morHost : morHosts) {
      ManagedObjectReference morParent=(ManagedObjectReference)context.getServiceUtil().getDynamicProperty(morHost,"String_Node_Str");
      if (morParent.getType().equalsIgnoreCase("String_Node_Str"))       return false;
    }
  }
 else {
    for (    ManagedObjectReference morHost : morHosts) {
      ManagedObjectReference morParent=(ManagedObjectReference)context.getServiceUtil().getDynamicProperty(morHost,"String_Node_Str");
      if (!morParent.getType().equalsIgnoreCase("String_Node_Str"))       return false;
      if (!morParent.get_value().equals(morCluster.get_value()))       return false;
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean validateDiscoveredHosts(VmwareContext context,ManagedObjectReference morCluster,List<ManagedObjectReference> morHosts) throws Exception {
  if (morCluster == null) {
    for (    ManagedObjectReference morHost : morHosts) {
      ManagedObjectReference morParent=(ManagedObjectReference)context.getVimClient().getDynamicProperty(morHost,"String_Node_Str");
      if (morParent.getType().equalsIgnoreCase("String_Node_Str"))       return false;
    }
  }
 else {
    for (    ManagedObjectReference morHost : morHosts) {
      ManagedObjectReference morParent=(ManagedObjectReference)context.getVimClient().getDynamicProperty(morHost,"String_Node_Str");
      if (!morParent.getType().equalsIgnoreCase("String_Node_Str"))       return false;
      if (!morParent.getValue().equals(morCluster.getValue()))       return false;
    }
  }
  return true;
}
Program: 106371
Project: 106371
Buggy source:
/** 
 * We build the path to where the keystore holding the WS-Security X509 certificates are stored.
 */
@Override @DB public void init(ServletConfig config) throws ServletException {
  try {
    SpringBeanAutowiringSupport.processInjectionBasedOnServletContext(this,config.getServletContext());
    ConfigurationHelper.preConfigureConfigPathFromServletContext(config.getServletContext());
    String value=csDao.getConfigValue(ENABLE_EC2_API);
    if (value != null) {
      isEC2APIEnabled=Boolean.valueOf(value);
    }
    logger.info("String_Node_Str" + value);
  }
 catch (  Exception e) {
    throw new ServletException("String_Node_Str" + e.getMessage(),e);
  }
}

Fixed version (ground truth):
/** 
 * We build the path to where the keystore holding the WS-Security X509 certificates are stored.
 */
@Override @DB public void init(ServletConfig config) throws ServletException {
  try {
    LogUtils.initLog4j("String_Node_Str");
    SpringBeanAutowiringSupport.processInjectionBasedOnServletContext(this,config.getServletContext());
    ConfigurationHelper.preConfigureConfigPathFromServletContext(config.getServletContext());
    ComponentContext.initComponentsLifeCycle();
    String value=csDao.getConfigValue(ENABLE_EC2_API);
    if (value != null) {
      isEC2APIEnabled=Boolean.valueOf(value);
    }
    logger.info("String_Node_Str" + value);
  }
 catch (  Exception e) {
    throw new ServletException("String_Node_Str" + e.getMessage(),e);
  }
}