Program: 105786
Project: 105786
Buggy source:
@Override public void migrateForScale(String vmUuid,long srcHostId,DeployDestination dest,Long oldSvcOfferingId) throws ResourceUnavailableException, ConcurrentOperationException {
  AsyncJobExecutionContext jobContext=AsyncJobExecutionContext.getCurrentExecutionContext();
  if (!VmJobEnabled.value() || jobContext.isJobDispatchedBy(VmWorkConstants.VM_WORK_JOB_DISPATCHER)) {
    VmWorkJobVO placeHolder=null;
    if (VmJobEnabled.value()) {
      VirtualMachine vm=_vmDao.findByUuid(vmUuid);
      placeHolder=createPlaceHolderWork(vm.getId());
    }
    try {
      orchestrateMigrateForScale(vmUuid,srcHostId,dest,oldSvcOfferingId);
    }
  finally {
      if (VmJobEnabled.value())       _workJobDao.expunge(placeHolder.getId());
    }
  }
 else {
    Outcome<VirtualMachine> outcome=migrateVmForScaleThroughJobQueue(vmUuid,srcHostId,dest,oldSvcOfferingId);
    try {
      VirtualMachine vm=outcome.get();
    }
 catch (    InterruptedException e) {
      throw new RuntimeException("String_Node_Str",e);
    }
catch (    java.util.concurrent.ExecutionException e) {
      throw new RuntimeException("String_Node_Str",e);
    }
    Object jobResult=_jobMgr.unmarshallResultObject(outcome.getJob());
    if (jobResult != null) {
      if (jobResult instanceof ResourceUnavailableException)       throw (ResourceUnavailableException)jobResult;
 else       if (jobResult instanceof ConcurrentOperationException)       throw (ConcurrentOperationException)jobResult;
 else       if (jobResult instanceof RuntimeException)       throw (RuntimeException)jobResult;
 else       if (jobResult instanceof Throwable)       throw new RuntimeException("String_Node_Str",(Throwable)jobResult);
    }
  }
}

Fixed version (ground truth):
@Override public void migrateForScale(String vmUuid,long srcHostId,DeployDestination dest,Long oldSvcOfferingId) throws ResourceUnavailableException, ConcurrentOperationException {
  AsyncJobExecutionContext jobContext=AsyncJobExecutionContext.getCurrentExecutionContext();
  if (!VmJobEnabled.value() || jobContext.isJobDispatchedBy(VmWorkConstants.VM_WORK_JOB_DISPATCHER)) {
    VmWorkJobVO placeHolder=null;
    if (VmJobEnabled.value()) {
      VirtualMachine vm=_vmDao.findByUuid(vmUuid);
      placeHolder=createPlaceHolderWork(vm.getId());
    }
    try {
      orchestrateMigrateForScale(vmUuid,srcHostId,dest,oldSvcOfferingId);
    }
  finally {
      if (placeHolder != null) {
        _workJobDao.expunge(placeHolder.getId());
      }
    }
  }
 else {
    Outcome<VirtualMachine> outcome=migrateVmForScaleThroughJobQueue(vmUuid,srcHostId,dest,oldSvcOfferingId);
    try {
      VirtualMachine vm=outcome.get();
    }
 catch (    InterruptedException e) {
      throw new RuntimeException("String_Node_Str",e);
    }
catch (    java.util.concurrent.ExecutionException e) {
      throw new RuntimeException("String_Node_Str",e);
    }
    Object jobResult=_jobMgr.unmarshallResultObject(outcome.getJob());
    if (jobResult != null) {
      if (jobResult instanceof ResourceUnavailableException)       throw (ResourceUnavailableException)jobResult;
 else       if (jobResult instanceof ConcurrentOperationException)       throw (ConcurrentOperationException)jobResult;
 else       if (jobResult instanceof RuntimeException)       throw (RuntimeException)jobResult;
 else       if (jobResult instanceof Throwable)       throw new RuntimeException("String_Node_Str",(Throwable)jobResult);
    }
  }
}